10 my $table = new Bio::SeqUtils;
11 my @BASES = $table->valid_aa(0);
12 my %all = $table->valid_aa(2);
13 my ($file,$format,$help) = ( undef, 'fasta');
16 'f|format:s' => \$format,
20 my $USAGE = "usage: aacomp [-f format] filename\n\tdefault format is fasta\n";
21 $file = shift unless $file;
27 print "Could not open file [$file]\n$USAGE" and exit unless -e $file;
28 $seqin = new Bio::SeqIO(-format => $format,
31 $seqin = new Bio::SeqIO(-format => $format,
37 foreach my $base ( @BASES ) {
38 $composition{$base} = 0;
40 while ( my $seq = $seqin->next_seq ) {
41 if( $seq->alphabet ne 'protein' ) {
42 confess("Must only provide amino acid sequences to aacomp...skipping this seq");
45 foreach my $base ( split(//,$seq->seq()) ) {
46 $composition{uc $base}++;
51 printf("%d aa\n",$total);
52 printf("%5s %4s\n", 'aa', '#' );
54 foreach my $base ( @BASES ) {
55 printf(" %s %s %3d\n", $base, $all{$base}, $composition{$base} );
56 $ct += $composition{$base};
58 printf( "%6s %s\n", '','-'x5);
59 printf( "%6s %3d\n", '',$ct);
67 aacomp - amino acid composition of protein sequences
71 aacomp [-f/--format FORMAT] [-h/--help] filename
73 aacomp [-f/--format FORMAT] < filename
75 aacomp [-f/--format FORMAT] -i filename
79 This scripts prints out the count of amino acids over all protein
80 sequences from the input file.
84 The default sequence format is fasta.
86 The sequence input can be provided using any of the three methods:
90 =item unnamed argument
108 User feedback is an integral part of the evolution of this and other
109 Bioperl modules. Send your comments and suggestions preferably to
110 the Bioperl mailing list. Your participation is much appreciated.
112 bioperl-l@bioperl.org - General discussion
113 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
115 =head2 Reporting Bugs
117 Report bugs to the Bioperl bug tracking system to help us keep track
118 of the bugs and their resolution. Bug reports can be submitted via the
121 https://redmine.open-bio.org/projects/bioperl/
123 =head1 AUTHOR - Jason Stajich
125 Email jason@bioperl.org
129 Based on aacomp.c from an old version of EMBOSS