New INSTALL.WIN doc (from wiki)
[bioperl-live.git] / scripts / seq / translate_seq.PLS
blobafe49f018b0381b8d609974f1b1a99973a05c817
1 #!perl -w
2 use strict;
3 # $Id: translate_seq.PLS,v 1.7 2006-07-04 22:23:29 mauricio Exp $
5 =head1 NAME
7 translate_seq - translates a sequence
9 =head1 SYNOPSIS
11 translate_seq E<lt> cdna_cds.fa E<gt> protein.fa
13 =head1 DESCRIPTION 
15 The script will translate one fasta file (on stdin) to protein on stdout
17 =head1 FEEDBACK
19 =head2 Mailing Lists
21 User feedback is an integral part of the evolution of this and other
22 Bioperl modules. Send your comments and suggestions preferably to
23 the Bioperl mailing list.  Your participation is much appreciated.
25   bioperl-l@bioperl.org                  - General discussion
26   http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
28 =head2 Reporting Bugs
30 Report bugs to the Bioperl bug tracking system to help us keep track
31 of the bugs and their resolution. Bug reports can be submitted via
32 email or the web:
34   http://bugzilla.open-bio.org/
36 =head1 AUTHOR
38   Ewan Birney E<lt>birney@ebi.ac.ukE<gt>
40 =cut
42 use Bio::SeqIO;
43 use Getopt::Long;
45 my ($format) = 'fasta';
47 GetOptions(
48            'format:s'  => \$format,
49            );
51 my $oformat = 'fasta';
53 # this implicity uses the <> file stream
54 my $seqin = Bio::SeqIO->new( -format => $format, -file => shift); 
55 my $seqout = Bio::SeqIO->new( -format => $oformat, -file => ">-" );
58 while( (my $seq = $seqin->next_seq()) ) {
59         my $pseq = $seq->translate();
60         $seqout->write_seq($pseq);
63 __END__