On 17/04/2008, Miguel Rojas Cherto <[EMAIL PROTECTED]> wrote:
> Hi Noel,
>
>
> > I see that MFAnalyser is gone from trunk, to be replaced by
> > MolecularFormulaManipulator. Using MolecularFormulaManipulator and the
> > jar at http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/,
> > I have the following results...
> >
> > For the molecule represented by the SMILES string "C", I get a
> > molecular formula of "C1" (getString)
>
> How Egon commented you have to make explicit the hydrogens
> using CDKHydrogenAdded before calling the MolecularFormulaGenerator.
Sorry - I didn't make myself clear. The correct molecular formula is
"C" not "C1". Single atoms shouldn't have a number specified. See
output of MFAnalyser for example.
> > and a molecular weight of -1
> > (getTotalExactMass).
> >
>
> The other problem with calculating the exact mass is that you have to
> specify what Isotope is the element with the corresponding exact mass.
> Of course, we think automatically C is 12 and H is 1 but could not be.
> You have different examples in MolecularFormulaManipulatorTest.
> Nevertheless I add one possible solution that it could help you.
>
>
> IsotopeFactory ifac = IsotopeFactory.getInstance(builder);
>
> MolecularFormula formula = new MolecularFormula();
> formula.addIsotope(ifac.getMajorIsotope("C"),2);
> formula.addIsotope(ifac.getMajorIsotope("H"),6);
>
> For this case you will obtain the correctly exact mass.
Thanks for the explanation. I'm still disappointed that trunk CDK is
not able to calculate the molecular weight or molecular mass based on
natural abundances (the two most common measures) by a simple function
call (rather than having to specify the isotopes myself). Hopefully,
these will be added by the next release. In the meanwhile, I think it
is better for me to continue using CDK 1.0.2 where MFAnalyser is able
to do everything I need.
Regards,
Noel
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user