Getting ready

If you are using Jupyter Notebook, then open Chapter02/Basic_Sequence_Processing.ipynb. If not, you will need to download a FASTA sequence. We will use the human Lactase (LCT) gene as an example; you can get this using your knowledge from the previous recipe, by using the Entrez research interface:

from Bio import Entrez, SeqIO
Entrez.email = "your@email.here"
hdl = Entrez.efetch(db='nucleotide', id=['NM_002299'], rettype='fasta') # Lactase gene
seq = SeqIO.read(hdl, 'fasta')

Note that our example sequence is available on the Biopython sequence record.