Search in sources :

Example 1 with ChemSequence

use of org.openscience.cdk.ChemSequence in project cdk by cdk.

the class ChemSequenceManipulatorTest method setUp.

@Before
public void setUp() {
    molecule1 = new AtomContainer();
    atomInMol1 = new Atom("Cl");
    molecule1.addAtom(atomInMol1);
    molecule1.addAtom(new Atom("Cl"));
    bondInMol1 = new Bond(atomInMol1, molecule1.getAtom(1));
    molecule1.addBond(bondInMol1);
    molecule2 = new AtomContainer();
    atomInMol2 = new Atom("O");
    atomInMol2.setImplicitHydrogenCount(2);
    molecule2.addAtom(atomInMol2);
    moleculeSet = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainerSet.class);
    moleculeSet.addAtomContainer(molecule1);
    moleculeSet.addAtomContainer(molecule2);
    reaction = new Reaction();
    reaction.addReactant(molecule1);
    reaction.addProduct(molecule2);
    reactionSet = new ReactionSet();
    reactionSet.addReaction(reaction);
    chemModel1 = new ChemModel();
    chemModel1.setMoleculeSet(moleculeSet);
    chemModel2 = new ChemModel();
    chemModel2.setReactionSet(reactionSet);
    chemSequence = new ChemSequence();
    chemSequence.addChemModel(chemModel1);
    chemSequence.addChemModel(chemModel2);
}
Also used : ChemSequence(org.openscience.cdk.ChemSequence) IChemSequence(org.openscience.cdk.interfaces.IChemSequence) IAtomContainer(org.openscience.cdk.interfaces.IAtomContainer) AtomContainer(org.openscience.cdk.AtomContainer) IReactionSet(org.openscience.cdk.interfaces.IReactionSet) ReactionSet(org.openscience.cdk.ReactionSet) ChemModel(org.openscience.cdk.ChemModel) IChemModel(org.openscience.cdk.interfaces.IChemModel) IAtomContainerSet(org.openscience.cdk.interfaces.IAtomContainerSet) Bond(org.openscience.cdk.Bond) IBond(org.openscience.cdk.interfaces.IBond) Reaction(org.openscience.cdk.Reaction) IReaction(org.openscience.cdk.interfaces.IReaction) IAtom(org.openscience.cdk.interfaces.IAtom) Atom(org.openscience.cdk.Atom) Before(org.junit.Before)

Example 2 with ChemSequence

use of org.openscience.cdk.ChemSequence in project cdk by cdk.

the class INChIHandler method startDocument.

@Override
public void startDocument() {
    chemFile = new ChemFile();
    chemSequence = new ChemSequence();
    chemModel = new ChemModel();
    setOfMolecules = new AtomContainerSet();
}
Also used : ChemSequence(org.openscience.cdk.ChemSequence) ChemModel(org.openscience.cdk.ChemModel) ChemFile(org.openscience.cdk.ChemFile) IAtomContainerSet(org.openscience.cdk.interfaces.IAtomContainerSet) AtomContainerSet(org.openscience.cdk.AtomContainerSet)

Example 3 with ChemSequence

use of org.openscience.cdk.ChemSequence in project cdk by cdk.

the class ChemFileManipulatorTest method setUp.

@Before
public void setUp() {
    molecule1 = new AtomContainer();
    atomInMol1 = new Atom("Cl");
    molecule1.addAtom(atomInMol1);
    molecule1.addAtom(new Atom("Cl"));
    bondInMol1 = new Bond(atomInMol1, molecule1.getAtom(1));
    molecule1.addBond(bondInMol1);
    molecule2 = new AtomContainer();
    atomInMol2 = new Atom("O");
    atomInMol2.setImplicitHydrogenCount(2);
    molecule2.addAtom(atomInMol2);
    moleculeSet = new AtomContainerSet();
    moleculeSet.addAtomContainer(molecule1);
    moleculeSet.addAtomContainer(molecule2);
    reaction = new Reaction();
    reaction.addReactant(molecule1);
    reaction.addProduct(molecule2);
    reactionSet = new ReactionSet();
    reactionSet.addReaction(reaction);
    chemModel = new ChemModel();
    chemModel.setMoleculeSet(moleculeSet);
    chemModel.setReactionSet(reactionSet);
    chemSequence1 = new ChemSequence();
    chemSequence1.addChemModel(chemModel);
    chemSequence2 = new ChemSequence();
    chemFile = new ChemFile();
    chemFile.addChemSequence(chemSequence1);
    chemFile.addChemSequence(chemSequence2);
}
Also used : ChemSequence(org.openscience.cdk.ChemSequence) IChemSequence(org.openscience.cdk.interfaces.IChemSequence) IAtomContainer(org.openscience.cdk.interfaces.IAtomContainer) AtomContainer(org.openscience.cdk.AtomContainer) IReactionSet(org.openscience.cdk.interfaces.IReactionSet) ReactionSet(org.openscience.cdk.ReactionSet) ChemModel(org.openscience.cdk.ChemModel) IChemModel(org.openscience.cdk.interfaces.IChemModel) ChemFile(org.openscience.cdk.ChemFile) IChemFile(org.openscience.cdk.interfaces.IChemFile) Bond(org.openscience.cdk.Bond) IBond(org.openscience.cdk.interfaces.IBond) Reaction(org.openscience.cdk.Reaction) IReaction(org.openscience.cdk.interfaces.IReaction) IAtom(org.openscience.cdk.interfaces.IAtom) Atom(org.openscience.cdk.Atom) AtomContainerSet(org.openscience.cdk.AtomContainerSet) IAtomContainerSet(org.openscience.cdk.interfaces.IAtomContainerSet) Before(org.junit.Before)

Aggregations

ChemModel (org.openscience.cdk.ChemModel)3 ChemSequence (org.openscience.cdk.ChemSequence)3 IAtomContainerSet (org.openscience.cdk.interfaces.IAtomContainerSet)3 Before (org.junit.Before)2 Atom (org.openscience.cdk.Atom)2 AtomContainer (org.openscience.cdk.AtomContainer)2 AtomContainerSet (org.openscience.cdk.AtomContainerSet)2 Bond (org.openscience.cdk.Bond)2 ChemFile (org.openscience.cdk.ChemFile)2 Reaction (org.openscience.cdk.Reaction)2 ReactionSet (org.openscience.cdk.ReactionSet)2 IAtom (org.openscience.cdk.interfaces.IAtom)2 IAtomContainer (org.openscience.cdk.interfaces.IAtomContainer)2 IBond (org.openscience.cdk.interfaces.IBond)2 IChemModel (org.openscience.cdk.interfaces.IChemModel)2 IChemSequence (org.openscience.cdk.interfaces.IChemSequence)2 IReaction (org.openscience.cdk.interfaces.IReaction)2 IReactionSet (org.openscience.cdk.interfaces.IReactionSet)2 IChemFile (org.openscience.cdk.interfaces.IChemFile)1