/** * * @return productSet expanded STOICHIOMETRY * @throws java.io.IOException */ @Override public synchronized IAtomContainerSet getExpandedProducts() throws IOException { return reactionWithUniqueSTOICHIOMETRY.getProducts(); }
/** * Gets a permutation of the product atom containers. * * @return */ public int[] getPermutationOfProducts() { return getContainerPermutation(reaction.getProducts(), productBlockMap); }
/** * * @return all the products in the read reaction */ public IAtomContainerSet getProducts() { return getMolecules(reaction.getProducts()); }
/** * * @param i Index at I th position * @return Stoichiometry weight of the product molecule at i th Position * */ @Override public synchronized Double getExpandedProductStoichiometry(int i) { IAtomContainer Mol = reactionWithUniqueSTOICHIOMETRY.getProducts().getAtomContainer(i); return reactionWithUniqueSTOICHIOMETRY.getProductCoefficient(Mol); }
private double caclModelScale(IReaction rxn) { List<IAtomContainer> mols = new ArrayList<>(); for (IAtomContainer mol : rxn.getReactants().atomContainers()) mols.add(mol); for (IAtomContainer mol : rxn.getProducts().atomContainers()) mols.add(mol); for (IAtomContainer mol : rxn.getAgents().atomContainers()) mols.add(mol); return caclModelScale(mols); }
private double caclModelScale(IReaction rxn) { List<IAtomContainer> mols = new ArrayList<>(); for (IAtomContainer mol : rxn.getReactants().atomContainers()) mols.add(mol); for (IAtomContainer mol : rxn.getProducts().atomContainers()) mols.add(mol); for (IAtomContainer mol : rxn.getAgents().atomContainers()) mols.add(mol); return caclModelScale(mols); }
public static IAtomContainer getRelevantAtomContainer(IReaction reaction, IBond bond) { IAtomContainer result = MoleculeSetManipulator.getRelevantAtomContainer(reaction.getReactants(), bond); if (result != null) { return result; } return MoleculeSetManipulator.getRelevantAtomContainer(reaction.getProducts(), bond); }
/** * * @param reaction */ protected void detectAromaticity(IReaction reaction) { detectAromaticity(reaction.getReactants()); detectAromaticity(reaction.getProducts()); }
/** * * @param reaction */ protected void addImplicitHydrogens(IReaction reaction) { addImplicitHydrogens(reaction.getReactants()); addImplicitHydrogens(reaction.getProducts()); }
public static IAtomContainer getRelevantAtomContainer(IReaction reaction, IAtom atom) { IAtomContainer result = MoleculeSetManipulator.getRelevantAtomContainer(reaction.getReactants(), atom); if (result != null) { return result; } return MoleculeSetManipulator.getRelevantAtomContainer(reaction.getProducts(), atom); }
public static Rectangle2D calculateBounds(IReaction reaction) { // get the participants in the reaction IAtomContainerSet reactants = reaction.getReactants(); IAtomContainerSet products = reaction.getProducts(); if (reactants == null || products == null) return null; // determine the bounds of everything in the reaction Rectangle2D reactantsBounds = calculateBounds(reactants); return reactantsBounds.createUnion(calculateBounds(products)); }
/** * * @param reaction */ protected void setLonePairs(IReaction reaction) { LonePairElectronChecker checker = new LonePairElectronChecker(); setLonePairs(reaction.getReactants(), checker); setLonePairs(reaction.getProducts(), checker); }
public IRenderingElement generate(IReaction reaction, JChemPaintRendererModel model) { ElementGroup elementGroup = new ElementGroup(); IAtomContainerSet reactants = reaction.getReactants(); if (reactants != null) { elementGroup.add(this.generate(reactants, model)); } IAtomContainerSet products = reaction.getProducts(); if (products != null) { elementGroup.add(this.generate(products, model)); } return elementGroup; }
public static void setAtomProperties(IReaction reaction, Object propKey, Object propVal) { IAtomContainerSet reactants = reaction.getReactants(); for (int j = 0; j < reactants.getAtomContainerCount(); j++) { AtomContainerManipulator.setAtomProperties(reactants.getAtomContainer(j), propKey, propVal); } IAtomContainerSet products = reaction.getProducts(); for (int j = 0; j < products.getAtomContainerCount(); j++) { AtomContainerManipulator.setAtomProperties(products.getAtomContainer(j), propKey, propVal); } }
/** {@inheritDoc} */ @Override public IRenderingElement generate(IReaction reaction, RendererModel model) { Rectangle2D totalBoundsReactants = BoundsCalculator.calculateBounds(reaction.getReactants()); Rectangle2D totalBoundsProducts = BoundsCalculator.calculateBounds(reaction.getProducts()); if (totalBoundsReactants == null || totalBoundsProducts == null) return null; double separation = model.getParameter(BondLength.class).getValue() / model.getParameter(Scale.class).getValue(); Color foregroundColor = model.getParameter(BasicSceneGenerator.ForegroundColor.class).getValue(); return new ArrowElement(totalBoundsReactants.getMaxX() + separation, totalBoundsReactants.getCenterY(), totalBoundsProducts.getMinX() - separation, totalBoundsReactants.getCenterY(), 1 / model.getParameter( Scale.class).getValue(), true, foregroundColor); }
/** {@inheritDoc} */ @Override public IRenderingElement generateDiagram(IReaction reaction) { ElementGroup diagram = new ElementGroup(); for (IGenerator<IReaction> generator : this.generators) { diagram.add(generator.generate(reaction, rendererModel)); } diagram.add(moleculeSetRenderer.generateDiagram(reaction.getReactants())); diagram.add(moleculeSetRenderer.generateDiagram(reaction.getProducts())); return diagram; }
/** {@inheritDoc} */ @Override public IRenderingElement generateDiagram(IReaction reaction) { ElementGroup diagram = new ElementGroup(); for (IGenerator<IReaction> generator : this.generators) { diagram.add(generator.generate(reaction, rendererModel)); } diagram.add(moleculeSetRenderer.generateDiagram(reaction.getReactants())); diagram.add(moleculeSetRenderer.generateDiagram(reaction.getProducts())); return diagram; }
private IRenderingElement generateDiagram(IReaction reaction) { ElementGroup diagram = new ElementGroup(); for (IReactionGenerator generator : this.reactionGenerators) { diagram.add(generator.generate(reaction, rendererModel)); } diagram.add(generateDiagram(reaction.getReactants())); diagram.add(generateDiagram(reaction.getProducts())); return diagram; }
@Test public void testGetProducts() { IReaction reaction = (IReaction) newChemObject(); IAtomContainer sodiumhydroxide = reaction.getBuilder().newInstance(IAtomContainer.class); IAtomContainer aceticAcid = reaction.getBuilder().newInstance(IAtomContainer.class); IAtomContainer water = reaction.getBuilder().newInstance(IAtomContainer.class); reaction.addProduct(sodiumhydroxide); reaction.addProduct(aceticAcid); reaction.addProduct(water); Assert.assertEquals(3, reaction.getProducts().getAtomContainerCount()); }
protected static String cansmi(IReaction rxn) throws CDKException { IReaction copy = rxn.getBuilder().newInstance(IReaction.class); for (IAtomContainer mol : rxn.getReactants().atomContainers()) copy.addReactant(AtomContainerManipulator.copyAndSuppressedHydrogens(mol)); for (IAtomContainer mol : rxn.getProducts().atomContainers()) copy.addProduct(AtomContainerManipulator.copyAndSuppressedHydrogens(mol)); for (IAtomContainer mol : rxn.getAgents().atomContainers()) copy.addAgent(AtomContainerManipulator.copyAndSuppressedHydrogens(mol)); return smigen.create(copy); }