cgohlke / molmass

Molecular mass calculations
https://pypi.org/project/molmass
BSD 3-Clause "New" or "Revised" License
56 stars 13 forks source link

Mass distribution output missing for larger molecular masses #13

Closed oskar-november closed 12 months ago

oskar-november commented 12 months ago

I'm using molmass to calculate isotopic distribution from Hill Notation. When using inputting e.g. C97H119N15O18 I'm receiving the desired mass distribution listing, however when I input C98H119N15O18 (i.e. one additional C) the mass distribution is truncated.Is there a way to override this?

o_nentwich@MP2405ZM:~/cfx$ molmass C97H119N15O18

Formula: C97H119N15O18

Average mass: 1783.0766
Monoisotopic mass: 1781.8858
Nominal mass: 1781

Elemental Composition

Element  Number  Relative mass  Fraction %
C            97      1165.0418     65.3389
H           119       119.9450      6.7269
N            15       210.1005     11.7830
O            18       287.9893     16.1513
Total:      249      1783.0766    100.0000

Mass Distribution

Most abundant mass: 1782.8888 (35.403%)
Mean mass: 1783.0761

Relative mass    Fraction %      Intensity
1781.8858         31.484610      88.930916
1782.8888         35.403448     100.000000
1783.8918         20.887794      58.999322
1784.8947          8.566799      24.197641
1785.8975          2.733783       7.721798
1786.9003          0.721027       2.036601
1787.9031          0.163158       0.460852
1788.9058          0.032486       0.091759
1789.9085          0.005795       0.016369
1790.9111          0.000939       0.002651
1791.9138          0.000139       0.000392
1792.9166          0.000018       0.000051
1793.9197          0.000001       0.000003
1794.9230          0.000000       0.000000
o_nentwich@MP2405ZM:~/cfx$ molmass C98H119N15O18

Formula: C98H119N15O18

Average mass: 1795.0873
Monoisotopic mass: 1793.8858
Nominal mass: 1793

Elemental Composition

Element  Number  Relative mass  Fraction %
C            98      1177.0525     65.5708
H           119       119.9450      6.6818
N            15       210.1005     11.7042
O            18       287.9893     16.0432
Total:      250      1795.0873    100.0000
cgohlke commented 12 months ago

Try the latest version of molmass, which sets the limit of calculating the distribution to 512 atoms:

$ py -m molmass C98H119N15O18

Formula: C98H119N15O18

Nominal mass: 1793
Average mass: 1795.0873
Monoisotopic mass: 1793.8858 (31.148%)
Most abundant mass: 1794.8888 (35.362%)
Mean of distribution: 1795.0865

Number of atoms: 250

Elemental Composition

Element  Count  Relative mass  Fraction %
C           98      1177.0525     65.5708
H          119       119.9450      6.6818
N           15       210.1005     11.7042
O           18       287.9893     16.0432

Mass Distribution

A     Relative mass  Fraction %  Intensity %
1793      1793.8858   31.147725    88.083680
1794      1794.8888   35.361516   100.000000
1795      1795.8918   21.043111    59.508510
1796      1796.8947    8.698634    24.599154
1797      1797.8976    2.796196     7.907455
1798      1798.9004    0.742564     2.099920
1799      1799.9031    0.169127     0.478279
1800      1800.9058    0.033884     0.095822
1801      1801.9085    0.006081     0.017196
1802      1802.9112    0.000991     0.002802
1803      1803.9138    0.000148     0.000419
oskar-november commented 12 months ago

Thanks! That works great! Much appreciated!