[BioPython] Transcription

Martin MOKREJŠ mmokrejs at ribosome.natur.cuni.cz
Tue Jul 17 09:07:44 UTC 2007


Peter,

Peter wrote:
> Martin MOKREJŠ wrote:
>> BTW, someone who has the rights should include this example in the docs.
>> The relevant section is empty: 
>> http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc68
> 
> Or remove it? We cover transcription and translation earlier:
> 
> Section 2.2  Working with sequences
> http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc8

But is is buried in the text, it is more helpful to have a chapter item
like this. Moreover, I ended up going through my thrash and picking up
the email on this thread last from week. Now I have

from Bio.Seq import translate
...
print ''.join(('>', _record.id, ' ', _description, ' ', _start.strip(), '..', _stop.strip(), '\n', translate(_record.seq.tostring()[int(_start)-1:int(_stop)])))


but following the Tutorial would have been better as one could choose
different translator.

For example, now I wanted to look again into the docs to show you what's in,
I did search on the main webpage but searching for 'translate' gave nothing,
so I ticked also some additional set like the discussion but nothing came.
I went to Documentation section, picked up API documentation as that is the
fastest http://biopython.org/DIST/docs/api/public/trees.html , found the
Bio.Translate.Translator . Again, the generated docs are bad:
http://biopython.org/DIST/docs/api/public/Bio.Translate.Translator-class.html

and

>>> help(Translate)

is not much helpful ither:

<quote>
Help on module Bio.Translate in Bio:

NAME
    Bio.Translate

FILE
    /usr/lib/python2.4/site-packages/Bio/Translate.py

CLASSES
    Translator
    
    class Translator
     |  Methods defined here:
     |  
     |  __init__(self, table)
     |  
     |  back_translate(self, seq)
     |  
     |  translate(self, seq, stop_symbol='*')
     |  
     |  translate_to_stop(self, seq)

DATA
    ambiguous_dna_by_id = {1: <Bio.Translate.Translator instance>, 2: <Bio...
    ambiguous_dna_by_name = {'Alternative Yeast Nuclear': <Bio.Translate.T...
    ambiguous_rna_by_id = {1: <Bio.Translate.Translator instance>, 2: <Bio...
    ambiguous_rna_by_name = {'Alternative Yeast Nuclear': <Bio.Translate.T...
    key = 15
    unambiguous_dna_by_id = {1: <Bio.Translate.Translator instance>, 2: <B...
    unambiguous_dna_by_name = {'Alternative Yeast Nuclear': <Bio.Translate...
    unambiguous_rna_by_id = {1: <Bio.Translate.Translator instance>, 2: <B...
    unambiguous_rna_by_name = {'Alternative Yeast Nuclear': <Bio.Translate...
    value = <Bio.Data.CodonTable.AmbiguousCodonTable instance>
</quote>


I think the classes should be documented at least in the source code.
That's one of the very nice python features, of course not unique only to it.

Regards,
Martin





More information about the Biopython mailing list