@Override public boolean matches(IAtom atom) { return qatom.matches(atom); } }
/** * Constructor * @param smartQueryAtom query atom * @param container */ public DefaultMCSPlusAtomMatcher(IQueryAtom smartQueryAtom, IQueryAtomContainer container) { this(); this.smartQueryAtom = smartQueryAtom; this.symbol = smartQueryAtom.getSymbol(); }
/** * Conjunction the provided expressions. * * @param left expression * @param right expression * @return conjunction of the left and right expressions */ public static SMARTSAtom and(IQueryAtom left, IQueryAtom right) { return new Conjunction(left.getBuilder(), left, right); }
/** * Determine if a atom from the molecule is unvisited and if it is matched * by the query atom. If the match is feasible the provided query bond index * stored on the stack. * * @param qatom atom from the query * @param atom atom from the molecule * @return the match was feasible and the state was stored */ private boolean feasible(int bidx, IQueryAtom qatom, IAtom atom) { int aidx = atom.getIndex(); if (avisit[aidx] || !qatom.matches(atom)) return false; ++numMapped; amap[qatom.getIndex()] = aidx; avisit[aidx] = true; store(bidx, qatom); return true; }
private void setSourceSingleAtomMap(IQueryAtomContainer source, boolean removeHydrogen) throws CDKException { int counter = 0; BondEnergies be = BondEnergies.getInstance(); for (IAtom sourceAtom : source.atoms()) { IQueryAtom smartAtom = (IQueryAtom) sourceAtom; if ((removeHydrogen && !smartAtom.getSymbol().equals("H")) || (!removeHydrogen)) { for (IAtom targetAtom : target.atoms()) { Map<IAtom, IAtom> mapAtoms = new HashMap<IAtom, IAtom>(); if (smartAtom.matches(targetAtom)) { mapAtoms.put(sourceAtom, targetAtom); List<IBond> bonds = target.getConnectedBondsList(targetAtom); double totalOrder = 0; for (IBond bond : bonds) { Order order = bond.getOrder(); totalOrder += order.numeric() + be.getEnergies(bond); } if (!Objects.equals(targetAtom.getFormalCharge(), sourceAtom.getFormalCharge())) { totalOrder += 0.5; } connectedBondOrder.put(counter, totalOrder); mappings.add(counter++, mapAtoms); } } } else { System.err.println("Skippping Hydrogen mapping or This is not a single mapping case!"); } } }
@Deprecated @Override public boolean getFlag(int flagType) { boolean val = false; boolean leftFlag = left.getFlag(flagType); if (right != null) { if ("and".equals(operator) && leftFlag) { boolean rightFlag = right.getFlag(flagType); val = leftFlag && rightFlag; } else if ("or".equals(operator)) { boolean rightFlag = right.getFlag(flagType); val = leftFlag || rightFlag; } } else { if ("not".equals(operator)) { val = (!leftFlag); } else { val = leftFlag; } } return val; }
@Override public boolean matches(IAtom atom) { return qatom.matches(atom); } }
/** * Constructor * @param smartQueryAtom query atom * @param container */ public DefaultVFAtomMatcher(IQueryAtom smartQueryAtom, IQueryAtomContainer container) { this(); this.smartQueryAtom = smartQueryAtom; this.symbol = smartQueryAtom.getSymbol(); }
/** * Disjunction the provided expressions. * * @param left expression * @param right expression * @return disjunction of the left and right expressions */ public static SMARTSAtom or(IQueryAtom left, IQueryAtom right) { return new Disjunction(left.getBuilder(), left, right); }
@Override public boolean matches(IAtom atom) { return qatom.matches(atom); } }
referenceAtom = ((IQueryAtom) refAtom).getSymbol() == null ? "*" : ((IQueryAtom) refAtom).getSymbol(); if (DEBUG) { System.out.println("referenceAtom " + referenceAtom); String neighbouringAtom; if (refAtom instanceof IQueryAtom) { neighbouringAtom = ((IQueryAtom) negAtom).getSymbol() == null ? "*" : ((IQueryAtom) negAtom).getSymbol();
/** * Negate the provided expression. * * @param expr expression to negate * @return a SMARTS atom which is the negation of the expression */ public static SMARTSAtom not(IQueryAtom expr) { return new Negation(expr.getBuilder(), expr); }
@Override public boolean matches(IAtom atom) { return qatom.matches(atom); } }
/**{@inheritDoc} */ @Override public boolean matches(IAtom atom1, IAtom atom2) { return ((IQueryAtom) atom1).matches(atom2); } }
/** * {@inheritDoc} */ @Override public boolean matches(IAtom atom1, IAtom atom2) { return ((IQueryAtom) atom1).matches(atom2); }
@Override public boolean matches(IAtom atom) { return this.atom.matches(atom); }