Skip to content

Instantly share code, notes, and snippets.

@gilleain
Created November 20, 2012 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilleain/4118095 to your computer and use it in GitHub Desktop.
Save gilleain/4118095 to your computer and use it in GitHub Desktop.
public class AtomTests {
public final static IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
@Test
public void one_four_cyclohexadiene() throws InvalidSmilesException {
String acpString = "C0C1C2C3C4C5 0:1(2),0:5(1),1:2(1),2:3(1),3:4(2),4:5(1)";
IAtomContainer cyclohexadiene = AtomContainerPrinter.fromString(acpString, builder);
AtomDiscretePartitionRefiner refiner = new AtomDiscretePartitionRefiner();
PermutationGroup aut = refiner.getAutomorphismGroup(cyclohexadiene);
for (Permutation automorphism : aut.all()) {
System.out.println(automorphism.toCycleString());
}
}
@Test
public void four_H_pyran() throws InvalidSmilesException {
String acpString = "C0C1C2C3C4O5 0:1(2),0:5(1),1:2(1),2:3(1),3:4(2),4:5(1)";
IAtomContainer cyclohexadiene = AtomContainerPrinter.fromString(acpString, builder);
AtomDiscretePartitionRefiner refiner = new AtomDiscretePartitionRefiner();
PermutationGroup aut = refiner.getAutomorphismGroup(cyclohexadiene);
for (Permutation automorphism : aut.all()) {
System.out.println(automorphism.toCycleString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment