Closed WWilhelmsen closed 7 months ago
Molmass recognizes 'WQ'
as a peptide of Tryptophan and Glutamine. Besides the chemical elements, Deuterium, many chemical groups, peptide sequences, and oligonucleotide sequences are recognized. There is currently no option to disable this. I'll look into that.
>>> Formula('WQ')
Formula('((C5H8N2O2)(C11H10N2O)H2O)')
Would this work for you?
>>> Formula('WQ', parse_oligos=False).formula
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "Python311\Lib\functools.py", line 1001, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "molmass\molmass.py", line 628, in formula
return from_elements(self._elements, charge=self._charge)
^^^^^^^^^^^^^^
File "Python311\Lib\functools.py", line 1001, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "molmass\molmass.py", line 541, in _elements
raise FormulaError(
molmass.molmass.FormulaError: unexpected character 'Q'
WQ
.^
In a test of this program it was possible to find the molar mass of WQ which does not exist: Program code:
The result was 332.355092 The molecular mass of AQ, CQ is also possible to calculate but not BQ. This error is not so serious in normal use of the module but should have been corrected