This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Aminoacid Composition Using Biopython

How to find amino acid composition using Biopython?

biopython

As it seems to be a homework, what did you try so far ?

2 answers

Bio.SeqUtils.ProtParam contains a method, count_amino_acids to do this for you.

However, it does it by iterating over a dictionary, exactly as Chris said: source code.

Since this is so elementary you won't need biopython for this. Create a dictionary which holds the 20 aminoacids as keys and iterate over each position in your sequence collection while raising the counter (the value of the specific aminoacid) by one when seeing the specific aa. Finally, divide each number by the aa total to get relative frequencies. Very easy.

@Chris My supervisor told me to use biopython to find aminoacid composition.Do you know how to do it using Biopython?

As Chris mentionned, Biopython is not necessary here.

but supervisor wants biopython ;)!!

Log in to answer this question.