@TestClass(value="org.openscience.cdk.formula.MassToFormulaToolTest") public class MassToFormulaTool extends Object
Tool to determine molecular formula consistent with a given accurate mass. The molecular formulas are not validate. It only consist in generate combination according object (see MolecularFormulaChecker). The algorithm is published in Rojas-Cherto M. et.al. .
MassToFormulaTool mf = new MassToFormulaTool(); double myMass = 133.004242; IMolecularFormulaSet mfSet = mf.generate(myMass);
The elements are listed according on difference with the proposed mass.
Constructor and Description |
---|
MassToFormulaTool(IChemObjectBuilder builder)
Construct an instance of MassToFormulaTool.
|
Modifier and Type | Method and Description |
---|---|
IMolecularFormulaSet |
generate(double mass)
Method that actually does the work of extracting the molecular formula.
|
List<IRule> |
getRestrictions()
Get the restrictions that must be presents in the molecular formula.
|
void |
setDefaultRestrictions()
Set the default restrictions that must be presents in the molecular formula.
|
void |
setRestrictions(List<IRule> rulesNew)
Set the restrictions that must be presents in the molecular formula.
|
public MassToFormulaTool(IChemObjectBuilder builder)
setDefaultRestrictions()
@TestMethod(value="testSetRestrictions_List") public void setRestrictions(List<IRule> rulesNew) throws CDKException
rulesNew
- The restrictions to imposeCDKException
getRestrictions()
,
setDefaultRestrictions()
,
IRule
@TestMethod(value="testGetRestrictions") public List<IRule> getRestrictions()
setDefaultRestrictions()
@TestMethod(value="testSetDefaultRestrictions") public void setDefaultRestrictions()
getRestrictions()
@TestMethod(value="testGenerate_double") public IMolecularFormulaSet generate(double mass)
mass
- molecular formula to create from the mass