use strict; use warnings; use diagnostics; open PROTEOME, 'human_complete_proteome_without_isoforms.fasta'; my $peptide; while( ) { chomp; $peptide .= $_ unless /^>/; } print "The proteome is loaded\n"; my %count; my $aminoacid_ix = 0; for( my $aminoacid_ix = 0; $aminoacid_ix < length $peptide; ++$aminoacid_ix ) { my $aminoacid = substr $peptide, $aminoacid_ix, 1; $count{$aminoacid}++; } print "Finished searching the document\n"; foreach my $aminoacid ( keys %count ) { print "$aminoacid\t occurs $count{$aminoacid} times \n"; }