[Biopython-dev] 5/9 BioStar - Biopython Questions

Feed My Inbox updates at feedmyinbox.com
Sun May 9 06:08:19 UTC 2010


==================================================
1. I wonder why it is so important to use Seq objects in stead of plain ol' strings in Biopyton?
==================================================
May 8, 2010 at 5:10 PM

This may seem like a superfluous question, and perhaps it is, but it's important to get the basic raison d'etres of the programming habits that are encouraged in the tutorial straight. (Wow that's a strange and awkward sentence but it's good to write in English and show off literal non-skills.)

In short: Why use:

    >>> from Bio.Seq import Seq
    >>> from Bio.Alphabet import IUPAC

    >>> messenger_rna = Seq("AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG",
        IUPAC.unambiguous_rna)
    >>> messenger_rna
        Seq('AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG', 
        IUPACUnambiguousRNA())
    >>> messenger_rna.translate()
        Seq('MAIVMGR*KGAR*', HasStopCodon(IUPACProtein(), '*'))


When you can simply use:

    >>> from Bio.Seq import translate

    >>> my_string_messenger_rna = "AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG"
    >>> translate(my_string_messenger_rna)
        'MAIVMGR*KGAR*'

http://biostar.stackexchange.com/questions/1001/i-wonder-why-it-is-so-important-to-use-seq-objects-in-stead-of-plain-ol-strings

--------------------------------------------------

===========================================================
Source: http://biostar.stackexchange.com/questions/tagged/biopython
This email was sent to biopython-dev at lists.open-bio.org.

Account Login: 
https://www.feedmyinbox.com/members/login/
Don't want to receive this feed any longer? Unsubscribe here: http://www.feedmyinbox.com/feeds/unsubscribe/311791/6ca55937c6ac7ef56420a858404addee7b17d3e7/
-----------------------------------------------------------
This email was carefully delivered by FeedMyInbox.com. 
230 Franklin Road Suite 814 Franklin, TN 37064




More information about the Biopython-dev mailing list