Dear all, I found some bugs about the calculation of molecular weight: The first problem: 1) In the "RuleOfFiveDescriptor.java" code, the molecular weight is calculate as below: “IAtomContainer mol = rof.readMol2("test.mol2"); IMolecularDescriptor mw = new WeightDescriptor(); Object[] mwparams = { "" }; mw.setParameters(mwparams); double mwvalue = ((DoubleResult) mw.calculate(mol).getValue()).doubleValue(); " However, if Object[] mwparams = { "" }; The molecular weigh is 0.0. When I modify it to "Object[] mwparams = { "*" };" it can calculte the molecular weight. Is it the bug ofRuleOfFiveDescriptor in CDK?
The second problem: 2) I calculate the molecule weight by using the below code: “IAtomContainer mol = rof.readMol2("test.mol2"); IMolecularDescriptor mw = new WeightDescriptor(); Object[] mwparams = { "*" }; mw.setParameters(mwparams); double mwvalue = ((DoubleResult) mw.calculate(mol).getValue()).doubleValue(); " The calculated molecular weight is different with the results from the website https://zh.webqc.org/mmcalc.php or https://www.lenntech.com/calculators/molecular/molecular-weight-calculator.htm For example, I use the attached "test.mol2" file (formula is: C27H32N5O4S). The molecular weight of test.mol2 is 522.2175005040009 by using the above CDK code; The molecular weight of test.mol2 is 522.6391 by using website https://zh.webqc.org/mmcalc.php or https://www.lenntech.com/calculators/molecular/molecular-weight-calculator.htm In my opinion, It should not the a cumulative rounding off error, some parameters of atom are err. I had calculated it by Chemoffice, it also is 522.64, please check it. Is it the bug of molecular weight calculation in CDK code? I am waiting for somebody to solve this problem. Thanks. To show the example clearly, I also paste the "test.mol2" content as below: @<TRIPOS>MOLECULE ligand.pdb 69 72 1 0 0 SMALL AMBER ff14SB @<TRIPOS>ATOM 1 N1 33.4730 12.2860 22.0110 N.am 1 MID 0.0000 2 C2 33.6900 11.1160 21.1670 C.3 1 MID 0.0000 3 C3 32.9400 9.9200 21.7710 C.3 1 MID 0.0000 4 C4 33.3310 9.7150 23.2650 C.3 1 MID 0.0000 5 C5 33.0510 10.9910 24.0860 C.3 1 MID 0.0000 6 C6 33.7560 12.1980 23.4560 C.3 1 MID 0.0000 7 N7 31.5060 14.2480 23.1380 N.am 1 MID 0.0000 8 C8 32.7930 14.5390 22.4860 C.3 1 MID 0.0000 9 C9 32.9780 13.4720 21.4620 C.2 1 MID 0.0000 10 O10 32.7440 13.5950 20.2550 O.2 1 MID 0.0000 11 C11 32.7220 15.8910 21.7900 C.3 1 MID 0.0000 12 C12 32.6760 16.9470 22.8070 C.ar 1 MID 0.0000 13 C13 33.8380 17.4680 23.3090 C.ar 1 MID 0.0000 14 C14 31.4630 17.3550 23.2950 C.ar 1 MID 0.0000 15 C15 33.7800 18.4850 24.2800 C.ar 1 MID 0.0000 16 C16 31.3820 18.3620 24.2600 C.ar 1 MID 0.0000 17 C17 32.5450 18.9280 24.7480 C.ar 1 MID 0.0000 18 N18 29.9850 13.7390 26.3060 N.pl3 1 MID 0.0000 19 C19 30.0460 13.7400 24.8830 C.3 1 MID 0.0000 20 C20 31.4080 14.0330 24.4730 C.2 1 MID 0.0000 21 O21 32.3780 14.1170 25.2350 O.2 1 MID 0.0000 22 S22 29.3410 12.4380 27.0580 S.o2 1 MID 0.0000 23 O23 28.3630 11.8390 26.1820 O.2 1 MID 0.0000 24 O24 29.0620 12.8090 28.4350 O.2 1 MID 0.0000 25 C25 30.5070 10.1480 26.3150 C.ar 1 MID 0.0000 26 C26 30.6400 11.2630 27.1350 C.ar 1 MID 0.0000 27 C27 31.7270 11.4390 27.9370 C.ar 1 MID 0.0000 28 C28 32.7410 10.4530 27.9200 C.ar 1 MID 0.0000 29 C29 32.5820 9.2850 27.1330 C.ar 1 MID 0.0000 30 C30 31.4640 9.1710 26.3000 C.ar 1 MID 0.0000 31 C31 33.8930 10.5930 28.7020 C.ar 1 MID 0.0000 32 C32 34.8520 9.5850 28.6810 C.ar 1 MID 0.0000 33 C33 34.6900 8.4150 27.8780 C.ar 1 MID 0.0000 34 C34 33.5680 8.2670 27.1180 C.ar 1 MID 0.0000 35 C35 32.4750 19.9650 25.7860 C.2 1 MID 0.0000 36 N36 31.2960 20.4290 26.2370 N.pl3 1 MID 0.0000 37 N37 33.5310 20.7490 26.0440 N.pl3 1 MID 0.0000 38 H22 33.3140 11.3140 20.1630 H 1 MID 0.0000 39 H23 34.7560 10.8920 21.1200 H 1 MID 0.0000 40 H32 31.8670 10.1010 21.7050 H 1 MID 0.0000 41 H33 33.1870 9.0200 21.2080 H 1 MID 0.0000 42 H42 34.3930 9.4770 23.3270 H 1 MID 0.0000 43 H43 32.7530 8.8880 23.6780 H 1 MID 0.0000 44 H52 31.9770 11.1740 24.1090 H 1 MID 0.0000 45 H53 33.4150 10.8520 25.1040 H 1 MID 0.0000 46 H62 34.8310 12.0980 23.6020 H 1 MID 0.0000 47 H63 33.4110 13.1090 23.9450 H 1 MID 0.0000 48 H7 30.6700 14.2070 22.5730 H 1 MID 0.0000 49 H8 33.6060 14.5210 23.2120 H 1 MID 0.0000 50 H112 31.8250 15.9380 21.1730 H 1 MID 0.0000 51 H113 33.6040 16.0260 21.1630 H 1 MID 0.0000 52 H13 34.7930 17.1010 22.9620 H 1 MID 0.0000 53 H14 30.5580 16.8930 22.9290 H 1 MID 0.0000 54 H15 34.6910 18.9210 24.6620 H 1 MID 0.0000 55 H16 30.4200 18.6950 24.6210 H 1 MID 0.0000 56 H18 30.3320 14.5240 26.8380 H 1 MID 0.0000 57 H192 29.3730 14.5010 24.4880 H 1 MID 0.0000 58 H193 29.7530 12.7610 24.5040 H 1 MID 0.0000 59 H25 29.6370 10.0520 25.6820 H 1 MID 0.0000 60 H27 31.8120 12.3100 28.5700 H 1 MID 0.0000 61 H30 31.3570 8.3160 25.6490 H 1 MID 0.0000 62 H31 34.0360 11.4720 29.3140 H 1 MID 0.0000 63 H321 35.7400 9.6900 29.2860 H 1 MID 0.0000 64 H331 35.4530 7.6510 27.8730 H 1 MID 0.0000 65 H34 33.4320 7.3840 26.5110 H 1 MID 0.0000 66 H361 30.4340 19.9760 25.9700 H 1 MID 0.0000 67 H362 31.2730 21.2340 26.8460 H 1 MID 0.0000 68 H371 34.4290 20.5490 25.6260 H 1 MID 0.0000 69 H372 33.4290 21.5440 26.6590 H 1 MID 0.0000 @<TRIPOS>BOND 1 11 8 1 2 11 12 1 3 11 50 1 4 11 51 1 5 12 13 ar 6 12 14 ar 7 13 15 ar 8 13 52 1 9 14 16 ar 10 14 53 1 11 15 17 ar 12 15 54 1 13 16 17 ar 14 16 55 1 15 17 35 1 16 19 18 1 17 19 20 1 18 19 57 1 19 19 58 1 20 2 1 1 21 2 3 1 22 2 38 1 23 2 39 1 24 20 7 am 25 20 21 2 26 25 26 ar 27 25 30 ar 28 25 59 1 29 26 22 1 30 26 27 ar 31 27 28 ar 32 27 60 1 33 28 29 ar 34 28 31 ar 35 29 30 ar 36 29 34 ar 37 3 4 1 38 3 41 1 39 3 40 1 40 30 61 1 41 31 32 ar 42 31 62 1 43 32 33 ar 44 32 63 1 45 33 34 ar 46 33 64 1 47 34 65 1 48 35 36 2 49 35 37 2 50 4 5 1 51 4 42 1 52 4 43 1 53 5 6 1 54 5 44 1 55 5 45 1 56 6 1 1 57 6 46 1 58 6 47 1 59 8 7 1 60 8 9 1 61 8 49 1 62 9 1 am 63 9 10 2 64 56 18 1 65 66 36 1 66 67 36 1 67 68 37 1 68 69 37 1 69 48 7 1 70 18 22 1 71 23 22 2 72 24 22 2 @<TRIPOS>SUBSTRUCTURE 1 MID 1 RESIDUE 4 A MID 0 ROOT
test.mol2
Description: Binary data
_______________________________________________ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user