🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.python
Article #5

Re: Python module for DNA to amino acid and reverse complement translation.

#5
From: David Mathog
Date: Wed, 06 Sep 2000 03:39
48 lines
3246 bytes
In article <etdd7ioult0.fsf@w20-575-31.mit.edu>, Alex <cut_me_out@hotmail.com> writes:
>
>
>
>
>Hi.  Here is a python wrapper around some simple C functions that
>translate DNA sequences into amino acid residues and give their reverse
>complements.  I guess it's something like 10 times faster than the pure
>python versions, but I haven't done any benchmarking.
>
>
>No doubt there is already a module out there that does these things.
>Apologies to whoever's work I'm duplicating.
>

Just for kicks you might want to compare this one with yours (for
speed):

  http://seqaxp.bio.caltech.edu/pub/SOFTWARE/FASTTRANS.C


I use this to translate genpept or nr on the fly into either full
translated frames or the set of ORF's greater than (for instance) 75 AA.)
It will handle a single DBA sequence entry up to 1 MB (use another program 
in the pipe to fragment larger sequences if you expect to encounter them.)


$ fasttrans
 usage (UNIX):     fasttrans 123456 [minAA] <in.nfa >out.pfa
 usage (OpenVMS):  pipe fasttrans 123456 [minAA] <in.nfa >out.pfa
    input is a fasta dna sequence via stdin
    output is the translated protein sequence via stdout
    Specify the set of frames to translate on command line
       1,2,3 are the 3 forward frames
       4,5,6 are the 3 reverse frames
    minAA is an optional value.  If present and greater than zero
       it emits each ORF that has at least that many AA residues
       in it as a separate fasta fragment.  If not present or set to zero
       or less the entire translated frame is emitted

This is ANSII C code and compiles cleanly on VMS and Linux (and probably 
everywhere else.)  

Regards,

David Mathog
mathog@seqaxp.bio.caltech.edu
Manager, sequence analysis facility, biology division, Caltech 
Technical Details
Message-ID: <8p319g$l83@gap.cco.caltech.edu>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-east!sn-xit-uk!supernews.com!193.162.153.122.MISMATCH!news.tele.dk!144.212.100.101!newsfeed.mathworks.com!bloom-beacon.mit.edu!hgmp.mrc.ac.uk!net.bio.net
References: <etdd7ioult0.fsf@w20-575-31.mit.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10e2ff,d11af406695d581
X-Google-Attributes: gid10e2ff,public
X-Google-Thread: 10dd18,d11af406695d581
X-Google-Attributes: gid10dd18,public
X-Google-ArrivalTime: 2000-09-05 20:39:46 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-east!sn-xit-uk!supernews.com!193.162.153.122.MISMATCH!news.tele.dk!144.212.100.101!newsfeed.mathworks.com!bloom-beacon.mit.edu!hgmp.mrc.ac.uk!net.bio.net
From: mathog@seqaxp.bio.caltech.edu (David Mathog)
Newsgroups: comp.lang.python,bionet.biology.computational
Subject: Re: Python module for DNA to amino acid and reverse complement translation.
Date: 6 Sep 2000 04:39:43 +0100
Organization: Biology Division, Caltech, Pasadena CA 91125
Lines: 50
Approved: BIOSCI Approval Key <biosci-approval-key@net.bio.net>
Message-ID: <8p319g$l83@gap.cco.caltech.edu>
References: <etdd7ioult0.fsf@w20-575-31.mit.edu>
Reply-To: mathog@seqaxp.bio.caltech.edu
NNTP-Posting-Host: mercury.hgmp.mrc.ac.uk
X-Trace: niobium.hgmp.mrc.ac.uk 968211583 22756 193.62.192.80 (6 Sep 2000 03:39:43 GMT)
X-Complaints-To: news@net.bio.net
NNTP-Posting-Date: 6 Sep 2000 03:39:43 GMT
X-Auth: PGPMoose V1.1 PGP bionet.biology.computational
 iQCVAwUAObW8fqCIqsWvyF5FAQFEggQAiPnI4CyCOVxzVmrgAccdMCVymsK/m0WD
 P1Qs4wHu6EQ0+kCpB/WZrpkVbaOlCoN6I0b/CfhbzS5VUbq0vRJRXIQ3LVYticUY
 3GdyJAWxBZdCjLqzusNzpcVlgDXbw1WkfI8QNItwmRzOloechsiQDGf0arMwMrvV
 ttLzmWm9Dwk=
 =e+ti