private Map<IBond, IAtomContainer> fillBondRingMap(IRingSet ringSet) { Map<IBond, IAtomContainer> bondRingMap = new HashMap<>(); for (IAtomContainer ringAsAtomContainer : ringSet.atomContainers()) { IRing ring = (IRing) ringAsAtomContainer; for (IBond bond : ring.bonds()) { bondRingMap.put(bond, ring); } } return bondRingMap; }
private Map<IBond, IAtomContainer> fillBondRingMap(IRingSet ringSet) { HashMap<IBond, IAtomContainer> bondRingMap = new HashMap<>(); for (IAtomContainer ringAsAtomContainer : ringSet.atomContainers()) { IRing ring = (IRing) ringAsAtomContainer; for (IBond bond : ring.bonds()) { bondRingMap.put(bond, (IAtomContainer) ring); } } return bondRingMap; }
for (IRing ring : ringsystem) { int numAttach = 0; for (IBond bond : ring.bonds()) { for (IRing attached : ringlookup.get(bond)) { if (attached != ring && ringsystem.contains(attached)) {
for (IRing ring : ringsystem) { int numAttach = 0; for (IBond bond : ring.bonds()) { for (IRing attached : ringlookup.get(bond)) { if (attached != ring && ringsystem.contains(attached)) {
private static boolean deAromatizeBenzene(IRing ring) { if (ring.getBondCount() != 6) return false; int counter = 0; for (IBond bond : ring.bonds()) { if (counter % 2 == 0) { bond.setOrder(Order.SINGLE); } else { bond.setOrder(Order.DOUBLE); } counter++; } return true; }
if (nrAtoms % 2 == 0) { int nrSingleBonds = 0; Iterator<IBond> bondrs = ring.bonds().iterator(); while (bondrs.hasNext()) { if (bondrs.next().getOrder() == IBond.Order.SINGLE) nrSingleBonds++; Iterator<IBond> bondfs = ring.bonds().iterator(); while (bondfs.hasNext()) bondfs.next().setFlag(CDKConstants.REACTIVE_CENTER, true);
private boolean ringIsAromatic(IRing ring) { boolean isAromatic = true; for (IAtom atom : ring.atoms()) { if (!atom.getFlag(ISAROMATIC)) { isAromatic = false; break; } } if (!isAromatic) { isAromatic = true; for (IBond b : ring.bonds()) { if (!b.getFlag(ISAROMATIC)) { return false; } } } return isAromatic; }
/** * Check if a ring in a ring set is a macro cycle. We define this as a * ring with >= 10 atom and has at least one bond that isn't contained * in any other rings. * * @param ring ring to check * @param rs rest of ring system * @return ring is a macro cycle */ private boolean isMacroCycle(IRing ring, IRingSet rs) { if (ring.getAtomCount() < 8) return false; for (IBond bond : ring.bonds()) { boolean found = false; for (IAtomContainer other : rs.atomContainers()) { if (ring == other) continue; if (other.contains(bond)) { found = true; break; } } if (!found) return true; } return false; }
/** * Check if a ring in a ring set is a macro cycle. We define this as a * ring with >= 10 atom and has at least one bond that isn't contained * in any other rings. * * @param ring ring to check * @param rs rest of ring system * @return ring is a macro cycle */ private boolean isMacroCycle(IRing ring, IRingSet rs) { if (ring.getAtomCount() < 8) return false; for (IBond bond : ring.bonds()) { boolean found = false; for (IAtomContainer other : rs.atomContainers()) { if (ring == other) continue; if (other.contains(bond)) { found = true; break; } } if (!found) return true; } return false; }
/** * Marks the ring aromatic if all atoms and all bonds are aromatic. * * The method assumes that aromaticity of atoms and bonds have been * detected beforehand * * @param ring The ring to examine */ public static void markAromaticRings(IRing ring) { // return as soon as the conditions are not met: // 1. all atoms are labeled aromatic for (IAtom atom : ring.atoms()) if (!atom.getFlag(CDKConstants.ISAROMATIC)) return; // 2. all bonds are labeled aromatic for (IBond bond : ring.bonds()) if (!bond.getFlag(CDKConstants.ISAROMATIC)) return; // OK, all conditions are met, so ring is aromatic ring.setFlag(CDKConstants.ISAROMATIC, true); }
if (nrAtoms % 2 == 0) { int nrSingleBonds = 0; Iterator<IBond> bondrs = ring.bonds().iterator(); while (bondrs.hasNext()) { if (bondrs.next().getOrder() == IBond.Order.SINGLE) nrSingleBonds++; Iterator<IBond> bondfs = ring.bonds().iterator(); boolean ringCompletActive = false; while (bondfs.hasNext()) { Iterator<IBond> bondis = ring.bonds().iterator(); while (bondis.hasNext()) { IBond bondi = bondis.next();
@Test public void testMarkAromaticRings() { IRing ring = new Ring(3, "C"); Assert.assertNotNull(ring); RingManipulator.markAromaticRings(ring); Assert.assertFalse(ring.getFlag(CDKConstants.ISAROMATIC)); Iterator<IAtom> atoms = ring.atoms().iterator(); while (atoms.hasNext()) atoms.next().setFlag(CDKConstants.ISAROMATIC, true); RingManipulator.markAromaticRings(ring); Assert.assertFalse(ring.getFlag(CDKConstants.ISAROMATIC)); Iterator<IBond> bonds = ring.bonds().iterator(); while (bonds.hasNext()) bonds.next().setFlag(CDKConstants.ISAROMATIC, true); RingManipulator.markAromaticRings(ring); Assert.assertTrue(ring.getFlag(CDKConstants.ISAROMATIC)); }
int minMax = 0; logger.debug("Molecule: " + molecule); Iterator<IBond> bonds = ring.bonds().iterator(); while (bonds.hasNext()) { bond = (IBond) bonds.next();
if (nrAtoms % 2 == 0) { int nrSingleBonds = 0; for (IBond iBond : ring.bonds()) { if (iBond.getOrder() == IBond.Order.SINGLE) nrSingleBonds++; Iterator<IBond> bondfs = ring.bonds().iterator(); boolean ringCompletActive = false; while (bondfs.hasNext()) { for (IBond bondi : ring.bonds()) { int bondiP = reactant.indexOf(bondi); if (bondi.getOrder() == IBond.Order.SINGLE)
for(IBond atom : ring.bonds()) this.chemModelRelay.addPhantomBond(atom);
for (IBond ringBond : newRing.bonds()) { if (ringBond != bond) { if (phantom)
for (IBond ringBond : newRing.bonds()) { if (phantom) this.addPhantomBond(ringBond);
for (IBond ringBond : newRing.bonds()) { if (phantom) this.addPhantomBond(ringBond);