This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Why does BioPython compute the isoelectric point but not the molecular weight for an ambiguous protein ?

I have the following code:

from Bio.SeqUtils.ProtParam import ProteinAnalysis
my_seq = 'XXMSLLPVPYTEA'
analysed_seq = ProteinAnalysis(my_seq)
analysed_seq.molecular_weight()
analysed_seq.isoelectric_point()

And I get the following outputs:

>>> analysed_seq.molecular_weight()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "[...]/python2.7/site-packages/Bio/SeqUtils/ProtParam.py", line 100, in molecular_weight
    return molecular_weight(self.sequence, monoisotopic=self.monoisotopic)
  File "[...]/python2.7/site-packages/Bio/SeqUtils/__init__.py", line 443, in molecular_weight
    % (e, seq_type))
ValueError: 'X' is not a valid unambiguous letter for protein

>>> analysed_seq.isoelectric_point()
3.99969482421875

Since the protein contains Xs, I get why the molecular weight isn't computed, but I don't get why the isoelectric point is. Am I missing something ? Is there any explanation for this ?

biopython protein

1 answer

If you look at the source code (http://biopython.org/DIST/docs/api/Bio.SeqUtils.IsoelectricPoint-pysrc.html#IsoelectricPoint), you'll see that it basically assumes that your Xs are not charged. I didn't dig deeper, but it also seems that it never checks whether you have only non-ambiguous amino acid codes in your sequence.

Edit: Grammar.

Thank you for this answer. Is there any biological reason that justifies estimating the isoelectric point of an ambiguous protein but not the molecular weight (which could be done by taking the average weight of an amino acid) ?

Log in to answer this question.