From: <eg...@us...> - 2007-11-29 22:17:38
|
Revision: 9531 http://cdk.svn.sourceforge.net/cdk/?rev=9531&view=rev Author: egonw Date: 2007-11-29 14:17:34 -0800 (Thu, 29 Nov 2007) Log Message: ----------- Added some more comments and questions, and a nice test for MassToFormulaTool, with a mass 5577.4848something Modified Paths: -------------- branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MassToFormulaTool.java branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MolecularFormulaManipulator.java branches/miguelrojasch/mf/src/org/openscience/cdk/test/formula/MassToFormulaToolTest.java Modified: branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MassToFormulaTool.java =================================================================== --- branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MassToFormulaTool.java 2007-11-29 21:47:35 UTC (rev 9530) +++ branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MassToFormulaTool.java 2007-11-29 22:17:34 UTC (rev 9531) @@ -475,6 +475,8 @@ * of maximum and minimum of repetitive elements that will be contained in the * molecular formula. * + * FIXME: MF: maybe rename to IsotopeCountRestriction? + * * @author rojasm * */ @@ -493,7 +495,8 @@ */ public IElement_Nr(String symbol, int min, int max){ - + // FIXME: MF: why do you use isotopes here, if the API is build + // around IElement for the rest? try { IsotopeFactory ifac = IsotopeFactory.getInstance(builder); myElement = ifac.getElement(symbol); @@ -718,6 +721,9 @@ /** * Class which defines the restrictions * + * FIXME: MF: better not use an inner class + * FIXME: MF: rename to MassToFormulaRestrictions? (Use Eclipse refactoring...) + * * @author rojasm * */ Modified: branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MolecularFormulaManipulator.java =================================================================== --- branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MolecularFormulaManipulator.java 2007-11-29 21:47:35 UTC (rev 9530) +++ branches/miguelrojasch/mf/src/org/openscience/cdk/formula/MolecularFormulaManipulator.java 2007-11-29 22:17:34 UTC (rev 9531) @@ -260,6 +260,7 @@ */ public static IMolecularFormula getMolecularFormula(String stringMF, IMolecularFormula formula) { + // FIXME: MF: variables with lower case first char char ThisChar; /* * Buffer for Modified: branches/miguelrojasch/mf/src/org/openscience/cdk/test/formula/MassToFormulaToolTest.java =================================================================== --- branches/miguelrojasch/mf/src/org/openscience/cdk/test/formula/MassToFormulaToolTest.java 2007-11-29 21:47:35 UTC (rev 9530) +++ branches/miguelrojasch/mf/src/org/openscience/cdk/test/formula/MassToFormulaToolTest.java 2007-11-29 22:17:34 UTC (rev 9531) @@ -35,14 +35,19 @@ import org.openscience.cdk.test.CDKTestCase; /** + * FIXME: MF: move to test-formula module? + * * @cdk.module test-experimental */ public class MassToFormulaToolTest extends CDKTestCase { private DefaultChemObjectBuilder builder; private IsotopeFactory ifac; + /** * Constructor for the MassToFormulaToolTest object + * + * FIXME: MF: fix description of parameter, or remove from JavaDoc * *@param name Description of the Parameter */ @@ -190,7 +195,7 @@ IIsotope nit = builder.newIsotope("N"); nit.setExactMass(ifac.getMajorIsotope(nit.getSymbol()).getExactMass()); - + // FIXME: MF: this looks like two tests... is that really so? IMolecularFormula mf1 = new MolecularFormula(); mf1.addIsotope(carb,3); mf1.addIsotope(h,11); @@ -205,6 +210,7 @@ IMolecularFormulaSet mfSet = new MassToFormulaTool().generate(133.0968); + // FIXME: MF: why compare as doubles? assertEquals(8,mfSet.size(),0.000001); @@ -260,6 +266,24 @@ assertEquals(mf1.getIsotopeCount(builder.newIsotope("N")), mfSet.getMolecularFormula(0).getIsotopeCount(builder.newIsotope("C"))); } + + /** + * @cdk.inchi InChI=1/C111H166N8O184S32/c1-18(121)113-35-52(43(281-313(172,173)174)27(249-96(35)144)9-241-304(145,146)147)258-105-81(297-329(220,221)222)67(290-322(199,200)201)60(74(273-105)89(130)131)266-97-36(112-17-120)53(44(282-314(175,176)177)28(251-97)10-242-305(148,149)150)259-106-82(298-330(223,224)225)68(291-323(202,203)204)61(75(274-106)90(132)133)268-99-38(115-20(3)123)55(46(284-316(181,182)183)30(253-99)12-244-307(154,155)156)261-108-84(300-332(229,230)231)70(293-325(208,209)210)63(77(276-108)92(136)137)270-101-40(117-22(5)125)57(48(286-318(187,188)189)32(255-101)14-246-309(160,161)162)263-110-86(302-334(235,236)237)72(295-327(214,215)216)65(79(278-110)94(140)141)272-103-42(119-24(7)127)59(50(288-320(193,194)195)34(257-103)16-248-311(166,167)168)265-111-87(303-335(238,239)240)73(296-328(217,218)219)66(80(279-111)95(142)143)271-102-41(118-23(6)126)58(49(287-319(190,191)192)33(256-102)15-247-310(163,164)165)264-109-85(301-333(232,233)234)71(294-326(211,212)213)64(78(277-109)93(138)139)269-100-39(116-21(4)124)56(47(285-317(184,185)186)31(254-100)13-245-308(157,158)159)262-107-83(299-331(226,227)228)69(292-324(205,206)207)62(76(275-107)91(134)135)267-98-37(114-19(2)122)54(45(283-315(178,179)180)29(252-98)11-243-306(151,152)153)260-104-51(289-321(196,197)198)25(280-312(169,170)171)8-26(250-104)88(128)129/h8,17,25,27-87,96-111,144H,9-16H2,1-7H3,(H,112,120)(H,113,121)(H,114,122)(H,115,123)(H,116,124)(H,117,125)(H,118,126)(H,119,127)(H,128,129)(H,130,131)(H,132,133)(H,134,135)(H,136,137)(H,138,139)(H,140,141)(H,142,143)(H,145,146,147)(H,148,149,150)(H,151,152,153)(H,154,155,156)(H,157,158,159)(H,160,161,162)(H,163,164,165)(H,166,167,168)(H,169,170,171)(H,172,173,174)(H,175,176,177)(H,178,179,180)(H,181,182,183)(H,184,185,186)(H,187,188,189)(H,190,191,192)(H,193,194,195)(H,196,197,198)(H,199,200,201)(H,202,203,204)(H,205,206,207)(H,208,209,210)(H,211,212,213)(H,214,215,216)(H,217,218,219)(H,220,221,222)(H,223,224,225)(H,226,227,228)(H,229,230,231)(H,232,233,234)(H,235,236,237)(H,238,239,240)/t25-,27+,28+,29+,30+,31+,32+,33+,34+,35+,36+,37+,38+,39+,40+,41+,42+,43+,44+,45+,46+,47+,48+,49+,50+,51+,52+,53+,54+,55+,56+,57+,58+,59+,60-,61-,62-,63-,64-,65-,66-,67-,68-,69-,70-,71-,72-,73-,74-,75-,76-,77-,78-,79-,80-,81+,82+,83+,84+,85+,86+,87+,96?,97-,98-,99-,100-,101-,102-,103-,104-,105+,106+,107+,108+,109+,110+,111+/m0/s1/f/h112-119,128,130,132,134,136,138,140,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238H + */ + public void testHighMass() { + MassToFormulaTool mfTool = new MassToFormulaTool(); + Restrictions restrictions = mfTool.new Restrictions(); + restrictions.addElement("C",0,200); + restrictions.addElement("H",0,200); + restrictions.addElement("N",0,50); + restrictions.addElement("O",0,200); + restrictions.addElement("S",0,50); + mfTool.setRestrictions(restrictions); + IMolecularFormulaSet mfSet = mfTool.generate(5577.48486328125); + // FIXME: MF: no hits found. InChI of at least one hit is given in the JavaDoc + assertNotNull(mfSet); + assertNotSame(0, mfSet.size()); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |