[Bio-software] Re: transeq

npriya via bio-soft%40net.bio.net (by npriyarao from gmail.com)
Fri Mar 30 01:34:29 EST 2007


On Mar 27, 7:58 pm, don gilbert <gilbe... from indiana.edu> wrote:
> #!/usr/bin/perl
> # from Bioperl scripts bp_translate.pl, athttp://bioperl.org/
>
> use Bio::SeqIO;
> use Getopt::Long;
>
> my ($format) = 'fasta';
>
> GetOptions(
>             'format:s'  => \$format,
>             );
>
> my $oformat = 'fasta';
>
> # this implicity uses the <> file stream
> my $seqin = Bio::SeqIO->new( -format => $format, -file => shift);
> my $seqout = Bio::SeqIO->new( -format => $oformat, -file => ">-" );
>
> while( (my $seq = $seqin->next_seq()) ) {
>          my ($frame)= $seq->desc() =~ m/frame=([+-]\d)/;
>          my $pseq = $seq->translate(-frame => $frame % 3);# only
> 0,1,2 valid values for frame
>          $seqout->write_seq($pseq);
>
> }
>
> __END__
>
> > I have a list of nucleotide sequences (in fasta format) that I want to
> > translate to protein using frames specified by me.  Is there any
> > software that can do this.
>
> > ..
> > eg:
>
> > >ABCD frame=+1
> > ATCTCTCTCTCTCTTCTCTTC
>
> > >CDEF frame=-3
> > ATGTCTCTCTCTCTCTCT
>
> > etc...
>
> > I tried to write a perl program to do this.
> > ...
> > Any help will be greatly appreciated.
>
> > Thank you,
> > Priya

Hi,

Thanks a lot for sharing the code and introducing bioperl. I got very
fascinated with the range of modules in there.

But the "translate" was not translating the dna sequence properly. It
was a little strange, when frame 1 was given - it was translating as
frame 3, frame 2-->1, frame 3--> frame 2. So I back tracked, the
modulus function was giving the right output (ie mod 1-->1, 2-->2, 3--
>0) but the translation was not correct. I checked it with transeq and
well as manually checking the translation of the first few bases.

I could also not find any documentation on the translate method (other
than the basic syntax) and their various options in the bioperl
website (atleast not in detail).  Can you please direct me to any
website that talks about the options in details. Also, why is it
designed to not accept "3" as a frame value?
I am a Microbiologist, wetting my feet at bioinformatics ... my
apologies if the questions seem dumb.

Thanks,
Priya



More information about the Bio-soft mailing list