/** {@inheritDoc} */ @Override public boolean isAromatic() { return getFlag(CDKConstants.ISAROMATIC); }
/** * Sets the the exact bond order sum attribute of the AtomType object. * * @param bondOrderSum The new bondOrderSum value * * @see #getBondOrderSum */ @Override public void setBondOrderSum(Double bondOrderSum) { this.bondOrderSum = bondOrderSum; notifyChanged(); }
/** {@inheritDoc} */ @Override public void setIsInRing(boolean ring) { setFlag(CDKConstants.ISINRING, ring); }
private static Expr getAtomExpr(IAtom atom) { return ((QueryAtom) AtomRef.deref(atom)).getExpression(); }
QueryAtom qatom = new QueryAtom(expr); optset.contains(Expr.Type.AROMATIC_ELEMENT) || optset.contains(Expr.Type.ALIPHATIC_ELEMENT)) qatom.setSymbol(atom.getSymbol()); if (optset.contains(Expr.Type.AROMATIC_ELEMENT) || optset.contains(Expr.Type.IS_AROMATIC)) qatom.setIsAromatic(atom.isAromatic());
void append(Expr expr) { QueryAtom atom = new QueryAtom(mol.getBuilder()); atom.setExpression(expr); append(atom); }
/** * Make a query atom that matches atomic number, h count, valence, and * connectivity. This effectively provides an exact match for that atom * type. * * @param mol molecule * @param atom atom of molecule * @return the query atom (null if attachment point) */ private IQueryAtom matchExact(final IAtomContainer mol, final IAtom atom) { final IChemObjectBuilder bldr = atom.getBuilder(); int elem = atom.getAtomicNumber(); // attach atom skipped if (elem == 0) return null; int hcnt = atom.getImplicitHydrogenCount(); int val = hcnt; int con = hcnt; for (IBond bond : mol.getConnectedBondsList(atom)) { val += bond.getOrder().numeric(); con++; if (bond.getOther(atom).getAtomicNumber() == 1) hcnt++; } Expr expr = new Expr(Expr.Type.ELEMENT, elem) .and(new Expr(Expr.Type.TOTAL_DEGREE, con)) .and(new Expr(Expr.Type.TOTAL_H_COUNT, hcnt)) .and(new Expr(Expr.Type.VALENCE, val)); return new QueryAtom(expr); }
sb.append(generate(atom, ((QueryBond) BondRef.deref(prev)))); sb.append(generateAtom(atom, ((QueryAtom) AtomRef.deref(atom)).getExpression())); avisit.add(atom);
private boolean parseAtomExpr() { QueryAtom atom = new QueryAtom(mol.getBuilder()); Expr expr = new Expr(Expr.Type.NONE); atom.setExpression(expr); if (!parseExplicitHydrogen(atom, expr) && !parseAtomExpr(atom, expr, '\0')) { error = "Invalid atom expression"; return false; } append(atom); return true; }
/** * Make a query atom that matches atomic number, h count, valence, and * connectivity. This effectively provides an exact match for that atom * type. * * @param mol molecule * @param atom atom of molecule * @return the query atom (null if attachment point) */ private IQueryAtom matchExact(final IAtomContainer mol, final IAtom atom) { final IChemObjectBuilder bldr = atom.getBuilder(); int elem = atom.getAtomicNumber(); // attach atom skipped if (elem == 0) return null; int hcnt = atom.getImplicitHydrogenCount(); int val = hcnt; int con = hcnt; for (IBond bond : mol.getConnectedBondsList(atom)) { val += bond.getOrder().numeric(); con++; if (bond.getOther(atom).getAtomicNumber() == 1) hcnt++; } Expr expr = new Expr(Expr.Type.ELEMENT, elem) .and(new Expr(Expr.Type.TOTAL_DEGREE, con)) .and(new Expr(Expr.Type.TOTAL_H_COUNT, hcnt)) .and(new Expr(Expr.Type.VALENCE, val)); return new QueryAtom(expr); }
return ((QueryAtom)queryAtom).getExpression().matches(targetAtom, 0); return ((QueryAtom) queryAtom).getExpression() .matches(targetAtom, IStereoElement.LEFT); else if (parity > 0) return ((QueryAtom) queryAtom).getExpression() .matches(targetAtom, IStereoElement.RIGHT); else return ((QueryAtom) queryAtom).getExpression() .matches(targetAtom, 0);
/** * Sets the atomic mass of this element. * * @param massNumber The atomic mass to be assigned to this element * * @see #getMassNumber */ @Override public void setMassNumber(Integer massNumber) { this.massNumber = massNumber; notifyChanged(); }
/** {@inheritDoc} */ @Override public void setIsAromatic(boolean arom) { setFlag(CDKConstants.ISAROMATIC, arom); }
/** {@inheritDoc} */ @Override public boolean isInRing() { return getFlag(CDKConstants.ISINRING); }
return ((SMARTSAtom) queryAtom).chiralityMatches(targetAtom, 0, p); else return ((QueryAtom)queryAtom).getExpression().matches(targetAtom, 0); q *= p; if (q < 0) return ((QueryAtom) queryAtom).getExpression().matches(targetAtom, IStereoElement.LEFT); else if (q > 0) return ((QueryAtom) queryAtom).getExpression().matches(targetAtom, IStereoElement.RIGHT); else return ((QueryAtom) queryAtom).getExpression().matches(targetAtom, 0);
/** * Sets the formal charge of this atom. * * @param charge The formal charge * * @see #getFormalCharge */ @Override public void setFormalCharge(Integer charge) { this.formalCharge = charge; notifyChanged(); }
for (IAtom atom : mol.atoms()) { ReactionRole role = atom.getProperty(CDKConstants.REACTION_ROLE); ((QueryAtom) atom).getExpression().and( new Expr(Expr.Type.REACTION_ROLE, role.ordinal())
/** * Sets the NaturalAbundance attribute of the Isotope object. * * @param naturalAbundance The new NaturalAbundance value * * @see #getNaturalAbundance */ @Override public void setNaturalAbundance(Double naturalAbundance) { this.naturalAbundance = naturalAbundance; notifyChanged(); }
return false; if (submol.getAtomCount() == 1) { expr = ((QueryAtom) submol.getAtom(0)).getExpression(); } else { expr = new Expr(Expr.Type.RECURSIVE, submol);
/** * Sets the the exact electron valency of the AtomType object. * * @param valency The new valency value * @see #getValency * */ @Override public void setValency(Integer valency) { this.electronValency = valency; notifyChanged(); }