Given a large amount of FASTA files (the peptidome for various organisms for secreted peptides), how can I read the FASTA files (from UNIProt) with Python (Or Matlab), and count the frequencies of each Amino Acid, and of amino-acid "double" pairings?
(I.E - the output should have the % of each individual amino acid (Out of the 22 letters/Chars) AND the frequencies of pairings of amino acids.
Effectively, I want to count the bigram (or n-gram if easy to implement) frequencies for letter pairs.
The 22 amino acids are each represented by a unique letter in the FASTA file, and the name of each protein is preceded on its line by >. ( already parsed it, so only relevent characters remain)
Sample of a file:
FFKA
FLRN
MTTVSYVTILLTVLVQVLTSDAKATNNKRELSSGLKERSLSDDAPQFWKGRFSRSEEDPQ FWKGRFSDPQFWKGRFSDPQFWKGRFSDPQFWKGRFSDPQFWKGRFSDPQFWKGRFSDPQ FWKGRFSDGTKRENDPQYWKGRFSRSFEDQPDSEAQFWKGRFARTSSGEKREPQYWKGRF SRDSVPGRYGRELQGRFGRELQGRFGREAQGRFGRELQGRFGREFQGRFGREDQGRFGRE DQGRFGREDQGRFGREDQGRFGREDQGRFGREDQGRFGRELQGRFGREFQGRFGREDQGR FGREDQGRFGRELQGRFGREDQGRFGREDQGRFGREDLAKEDQGRFGREDLAKEDQGRFG REDIAEADQGRFGRNAAAAAAAAAAAKKRTIDVIDIESDPKPQTRFRDGKDMQEKRKVEK KDKIEKSDDALAKTS
Thank you very much!