/** * Returns all the AtomContainer's of a Reaction. * @param reaction The reaction being considered * @return a list of the IAtomContainer objects comprising the reaction */ public static List<IAtomContainer> getAllAtomContainers(IReaction reaction) { return MoleculeSetManipulator.getAllAtomContainers(getAllMolecules(reaction)); }
/** * Returns all the AtomContainer's of a Reaction. * @param set the reaction set to get the molecules from * @return a List containing the IAtomContainer objects in the IReactionSet */ public static List<IAtomContainer> getAllAtomContainers(IReactionSet set) { return MoleculeSetManipulator.getAllAtomContainers(getAllMolecules(set)); }
public void redo() { IAtomContainer relevantContainer = ChemModelManipulator.getRelevantAtomContainer(chemModel, oldAtom); AtomContainerManipulator.replaceAtomByAtom(relevantContainer, oldAtom, newAtom); }
static IAtomContainer type(IAtomContainer molecule) throws Exception { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); return molecule; } }
/** * Converts a formula string (like "C2H4") into an atom container with atoms * but no bonds. * * @param formulaString the formula to convert * @param builder a chem object builder * @return atoms wrapped in an atom container */ public static IAtomContainer getAtomContainer(String formulaString, IChemObjectBuilder builder) { return MolecularFormulaManipulator.getAtomContainer(MolecularFormulaManipulator.getMolecularFormula( formulaString, builder)); }
/** * add in a instance of IMolecularFormula the elements extracts form * molecular formula string. The string is immediately analyzed and a set of Nodes * is built based on this analysis * <p> The hydrogens must be implicit. * * @param stringMF The molecularFormula string * @return The filled IMolecularFormula * @see #getMolecularFormula(String, IChemObjectBuilder) */ public static IMolecularFormula getMolecularFormula(String stringMF, IMolecularFormula formula) { return getMolecularFormula(stringMF, formula, false); }
/** * Constructor to initialize the surface calculation with default values. * * This constructor use the Van der Waals radii as defined in <i>org/openscience/cdk/config/data/jmol_atomtypes.txt</i> * of the source distribution. Also uses a tesselation level of 4 and solvent radius of 1.4A. * * @param atomContainer The {@link IAtomContainer} for which the surface is to be calculated */ public NumericalSurface(IAtomContainer atomContainer) { this.atoms = AtomContainerManipulator.getAtomArray(atomContainer); }
void assertAtomCount(int expectedAtomCount, IChemObject chemObject) { if (expectedAtomCount != -1) { if (chemObject instanceof IChemFile) { Assert.assertEquals(expectedAtomCount, ChemFileManipulator.getAtomCount((IChemFile) chemObject)); } else if (chemObject instanceof IChemModel) { Assert.assertEquals(expectedAtomCount, ChemModelManipulator.getAtomCount((IChemModel) chemObject)); } else if (chemObject instanceof IAtomContainer) { Assert.assertEquals(expectedAtomCount, ((IAtomContainer) chemObject).getAtomCount()); } else if (chemObject instanceof IReaction) { Assert.assertEquals(expectedAtomCount, ReactionManipulator.getAtomCount((IReaction) chemObject)); } } }
void assertBondCount(int expectedBondCount, IChemObject chemObject) { if (expectedBondCount != -1) { if (chemObject instanceof IChemFile) { Assert.assertEquals(expectedBondCount, ChemFileManipulator.getBondCount((IChemFile) chemObject)); } else if (chemObject instanceof IChemModel) { Assert.assertEquals(expectedBondCount, ChemModelManipulator.getBondCount((IChemModel) chemObject)); } else if (chemObject instanceof IAtomContainer) { Assert.assertEquals(expectedBondCount, ((IAtomContainer) chemObject).getBondCount()); } else if (chemObject instanceof IReaction) { Assert.assertEquals(expectedBondCount, ReactionManipulator.getBondCount((IReaction) chemObject)); } } }
/** * Get the total formal charge on a molecule. * * @param atomContainer the atom container to consider * @return The summed formal charges of all atoms in this AtomContainer. */ public static int getTotalFormalCharge(IAtomContainer atomContainer) { int chargeP = getTotalNegativeFormalCharge(atomContainer); int chargeN = getTotalPositiveFormalCharge(atomContainer); return chargeP + chargeN; }
/** * Returns all the AtomContainer's of a MoleculeSet. * @param set The collection of IAtomContainer objects * @return a list containing individual IAtomContainer's */ public static List<IAtomContainer> getAllAtomContainers(IAtomContainerSet set) { return AtomContainerSetManipulator.getAllAtomContainers(set); }
/** * * @return */ @Override public int getCovalentCount() { int count = getBondArray(molecule).length; return count; } }
/** * @param set The collection of IAtomContainer objects * @see AtomContainerSetManipulator * @return The total formal charge on the collection of molecules */ public static double getTotalFormalCharge(IAtomContainerSet set) { return AtomContainerSetManipulator.getTotalFormalCharge(set); }
/** * Create an copy of the {@code org} structure with explicit hydrogens * removed. Stereochemistry is updated but up and down bonds in a depiction * may need to be recalculated (see. StructureDiagramGenerator). * * @param org The AtomContainer from which to remove the hydrogens * @return The molecule without hydrogens. * @cdk.keyword hydrogens, removal, suppress * @see #copyAndSuppressedHydrogens */ public static IAtomContainer removeHydrogens(IAtomContainer org) { return copyAndSuppressedHydrogens(org); }
public static int getAtomCount(IAtomContainerSet set) { return AtomContainerSetManipulator.getAtomCount(set); }
/** * @param set The collection of IAtomContainer objects * @see AtomContainerSetManipulator * @return The total charge on the collection of molecules */ public static double getTotalCharge(IAtomContainerSet set) { return AtomContainerSetManipulator.getTotalCharge(set); }
/** * @param set The collection of IAtomContainer objects * @see AtomContainerSetManipulator * @return the total implicit hydrogen count on the collection of molecules */ public static int getTotalHydrogenCount(IAtomContainerSet set) { return AtomContainerSetManipulator.getTotalHydrogenCount(set); }
public static void removeElectronContainer(IAtomContainerSet set, IElectronContainer electrons) { AtomContainerSetManipulator.removeElectronContainer(set, electrons); }
public void undo() { IAtomContainer relevantContainer = ChemModelManipulator.getRelevantAtomContainer(chemModel, newAtom); AtomContainerManipulator.replaceAtomByAtom(relevantContainer, newAtom, oldAtom); }