Created
May 4, 2010 17:10
-
-
Save gilleain/389670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IChemObjectBuilder builder = | |
NoNotificationChemObjectBuilder.getInstance(); | |
public IMolecule makeCHXFragment(int hCount) { | |
IMolecule mol = builder.newMolecule(); | |
mol.addAtom(builder.newAtom("C")); | |
mol.getAtom(0).setHydrogenCount(hCount); | |
return mol; | |
} | |
@Test | |
public void c6H12Test() throws Exception { | |
DeterministicGenerator dg = new DeterministicGenerator(false); | |
List<IMolecule> input = new ArrayList<IMolecule>(); | |
input.add(makeCHXFragment(1)); | |
input.add(makeCHXFragment(1)); | |
input.add(makeCHXFragment(2)); | |
input.add(makeCHXFragment(2)); | |
input.add(makeCHXFragment(3)); | |
input.add(makeCHXFragment(3)); | |
FragmentList result = dg.generateIsomers(input, "C6H12"); | |
for (String smiles : result.smiles) { | |
System.out.println(smiles); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment