[Biopython-dev] Determining if seq alphabet is protein/dna/rna

Michiel de Hoon mdehoon at c2b2.columbia.edu
Mon Oct 30 03:20:48 UTC 2006


Peter (BioPython Dev) wrote:
> Given one or more Seq objects, how can I reliably decide if they are 
> protein, DNA, or RNA?
> 
> (These are the relevant choices in a Nexus file's format datatype=... 
> header.)
> 
> I'm resigned to the fact that if the Seq object has the generic alphabet 
> this boils down to looking at the sequence strings and making an 
> educated guess (probably following an established algorithm from an 
> alignment program).  Does any such code already exist in BioPython?

Something similar exists in Bio.Seq in the complement, 
reverse_complement methods of Seq objects, but it only distinguishes 
between DNA and RNA. I don't know of any official way to do that in 
Biopython.

--Michiel.



More information about the Biopython-dev mailing list