Chapter 9 BioPython
BioPython is a package aimed at bioinformatics work. As with many Python packages, it is opinionated towards the needs of the developers, so might not meet everyone’s needs.
You can install BioPython using conda install biopython
.
We’ll do a short example
from Bio.Seq import Seq
#create a sequence object
my_seq = Seq("CATGTAGACTAG")
#print out some details about it
print("seq %s is %i bases long" % (my_seq, len(my_seq)))
seq CATGTAGACTAG is 12 bases long
reverse complement is CTAGTCTACATG
protein translation is HVD*
BioPython has capabilities for querying databases like Entrez
, read sequences, do alignments using FASTA, and the like.