maint: remove Travis stuff which has been replaced with Github actions (#325)
[bioperl-live.git] / bin / bp_translate_seq
bloba0157bc921643b4e31e9e5421448936ccca4bf77
1 #!/usr/bin/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,$outfile) = 'fasta';
47 GetOptions(
48 'f|format:s' => \$format,
49 'o|out|outfile:s' => \$outfile,
52 my $oformat = 'fasta';
54 # this implicity uses the <> file stream
55 my $seqin = Bio::SeqIO->new( -format => $format, -fh => \*ARGV);
56 my $seqout;
57 if( $outfile ) {
58 $seqout = Bio::SeqIO->new( -format => $oformat, -file => ">$outfile" );
59 } else {
60 # defaults to writing to STDOUT
61 $seqout = Bio::SeqIO->new( -format => $oformat );
63 while( (my $seq = $seqin->next_seq()) ) {
64 my $pseq = $seq->translate();
65 $seqout->write_seq($pseq);
68 __END__