~ubuntu-branches/ubuntu/trusty/bioperl/trusty

« back to all changes in this revision

Viewing changes to scripts/seq/bp_translate_seq.pl

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2013-09-22 13:39:48 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20130922133948-c6z62zegjyp7ztou
Tags: 1.6.922-1
* New upstream release.
* Replaces and Breaks grinder (<< 0.5.3-3~) because of overlaping contents.
  Closes: #722910
* Stop Replacing and Breaking bioperl ( << 1.6.9 ): not needed anymore. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!perl
 
2
use strict;
 
3
use warnings;
 
4
 
 
5
=head1 NAME
 
6
 
 
7
bp_translate_seq - translates a sequence
 
8
 
 
9
=head1 SYNOPSIS
 
10
 
 
11
bp_translate_seq E<lt> cdna_cds.fa E<gt> protein.fa
 
12
 
 
13
=head1 DESCRIPTION 
 
14
 
 
15
The script will translate one fasta file (on stdin) to protein on stdout
 
16
 
 
17
=head1 FEEDBACK
 
18
 
 
19
=head2 Mailing Lists
 
20
 
 
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.
 
24
 
 
25
  bioperl-l@bioperl.org                  - General discussion
 
26
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
 
27
 
 
28
=head2 Reporting Bugs
 
29
 
 
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:
 
33
 
 
34
  https://redmine.open-bio.org/projects/bioperl/
 
35
 
 
36
=head1 AUTHOR
 
37
 
 
38
  Ewan Birney E<lt>birney@ebi.ac.ukE<gt>
 
39
 
 
40
=cut
 
41
 
 
42
use Bio::SeqIO;
 
43
use Getopt::Long;
 
44
 
 
45
my ($format) = 'fasta';
 
46
 
 
47
GetOptions(
 
48
           'format:s'  => \$format,
 
49
           );
 
50
 
 
51
my $oformat = 'fasta';
 
52
 
 
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 => ">-" );
 
56
 
 
57
 
 
58
while( (my $seq = $seqin->next_seq()) ) {
 
59
        my $pseq = $seq->translate();
 
60
        $seqout->write_seq($pseq);
 
61
}
 
62
 
 
63
__END__