Reformat, correct docs, for legibility
[bioperl-live.git] / scripts / seq / bp_translate_seq.pl
blob6b7194455e22cc06a8313ac25f82f6bff5ff4dc0
1 #!perl
2 use strict;
3 use warnings;
5 =head1 NAME
7 bp_translate_seq - translates a sequence
9 =head1 SYNOPSIS
11 bp_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 https://github.com/bioperl/bioperl-live/issues
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,
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__