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

« back to all changes in this revision

Viewing changes to scripts/seq/translate_seq.PLS

  • 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 -w
2
 
use strict;
3
 
 
4
 
=head1 NAME
5
 
 
6
 
translate_seq - translates a sequence
7
 
 
8
 
=head1 SYNOPSIS
9
 
 
10
 
translate_seq E<lt> cdna_cds.fa E<gt> protein.fa
11
 
 
12
 
=head1 DESCRIPTION 
13
 
 
14
 
The script will translate one fasta file (on stdin) to protein on stdout
15
 
 
16
 
=head1 FEEDBACK
17
 
 
18
 
=head2 Mailing Lists
19
 
 
20
 
User feedback is an integral part of the evolution of this and other
21
 
Bioperl modules. Send your comments and suggestions preferably to
22
 
the Bioperl mailing list.  Your participation is much appreciated.
23
 
 
24
 
  bioperl-l@bioperl.org                  - General discussion
25
 
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
26
 
 
27
 
=head2 Reporting Bugs
28
 
 
29
 
Report bugs to the Bioperl bug tracking system to help us keep track
30
 
of the bugs and their resolution. Bug reports can be submitted via
31
 
email or the web:
32
 
 
33
 
  https://redmine.open-bio.org/projects/bioperl/
34
 
 
35
 
=head1 AUTHOR
36
 
 
37
 
  Ewan Birney E<lt>birney@ebi.ac.ukE<gt>
38
 
 
39
 
=cut
40
 
 
41
 
use Bio::SeqIO;
42
 
use Getopt::Long;
43
 
 
44
 
my ($format) = 'fasta';
45
 
 
46
 
GetOptions(
47
 
           'format:s'  => \$format,
48
 
           );
49
 
 
50
 
my $oformat = 'fasta';
51
 
 
52
 
# this implicity uses the <> file stream
53
 
my $seqin = Bio::SeqIO->new( -format => $format, -file => shift); 
54
 
my $seqout = Bio::SeqIO->new( -format => $oformat, -file => ">-" );
55
 
 
56
 
 
57
 
while( (my $seq = $seqin->next_seq()) ) {
58
 
        my $pseq = $seq->translate();
59
 
        $seqout->write_seq($pseq);
60
 
}
61
 
 
62
 
__END__