11 my $table = new Bio
::SeqUtils
;
12 my @BASES = $table->valid_aa(0);
13 my %all = $table->valid_aa(2);
14 my ($file,$format,$help) = ( undef, 'fasta');
17 'f|format:s' => \
$format,
21 my $USAGE = "usage: aacomp [-f format] filename\n\tdefault format is fasta\n";
22 $file = shift unless $file;
28 print "Could not open file [$file]\n$USAGE" and exit unless -e
$file;
29 $seqin = new Bio
::SeqIO
(-format
=> $format,
32 $seqin = new Bio
::SeqIO
(-format
=> $format,
38 foreach my $base ( @BASES ) {
39 $composition{$base} = 0;
41 while ( my $seq = $seqin->next_seq ) {
42 if( $seq->alphabet ne 'protein' ) {
43 confess
("Must only provide amino acid sequences to aacomp...skipping this seq");
46 foreach my $base ( split(//,$seq->seq()) ) {
47 $composition{uc $base}++;
52 printf("%d aa\n",$total);
53 printf("%5s %4s\n", 'aa', '#' );
55 foreach my $base ( @BASES ) {
56 printf(" %s %s %3d\n", $base, $all{$base}, $composition{$base} );
57 $ct += $composition{$base};
59 printf( "%6s %s\n", '','-'x5
);
60 printf( "%6s %3d\n", '',$ct);
68 bp_aacomp - amino acid composition of protein sequences
72 bp_aacomp [-f/--format FORMAT] [-h/--help] filename
74 bp_aacomp [-f/--format FORMAT] < filename
76 bp_aacomp [-f/--format FORMAT] -i filename
80 This scripts prints out the count of amino acids over all protein
81 sequences from the input file.
85 The default sequence format is fasta.
87 The sequence input can be provided using any of the three methods:
91 =item unnamed argument
109 User feedback is an integral part of the evolution of this and other
110 Bioperl modules. Send your comments and suggestions preferably to
111 the Bioperl mailing list. Your participation is much appreciated.
113 bioperl-l@bioperl.org - General discussion
114 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
116 =head2 Reporting Bugs
118 Report bugs to the Bioperl bug tracking system to help us keep track
119 of the bugs and their resolution. Bug reports can be submitted via the
122 https://github.com/bioperl/bioperl-live/issues
124 =head1 AUTHOR - Jason Stajich
126 Email jason@bioperl.org
130 Based on aacomp.c from an old version of EMBOSS