/** * Creates a QueryAtomContainer with the following settings: * * <pre> * QueryAtomContainer.create(container, * Expr.Type.ELEMENT, * Expr.Type.ORDER); * </pre> * * @param container The AtomContainer that stands as model * @return The new QueryAtomContainer created from container. */ public static QueryAtomContainer createSymbolAndBondOrderQueryContainer(IAtomContainer container) { return QueryAtomContainer.create(container, Expr.Type.ELEMENT, Expr.Type.ORDER); }
/** * Creates a QueryAtomContainer with the following settings: * * <pre> * QueryAtomContainer.create(container, * Expr.Type.ELEMENT, * Expr.Type.FORMAL_CHARGE, * Expr.Type.IS_AROMATIC, * Expr.Type.ORDER); * </pre> * * @param container The AtomContainer that stands as model * @return The new QueryAtomContainer created from container. */ public static QueryAtomContainer createSymbolAndChargeQueryContainer(IAtomContainer container) { return QueryAtomContainer.create(container, Expr.Type.ELEMENT, Expr.Type.FORMAL_CHARGE, Expr.Type.IS_AROMATIC, Expr.Type.ORDER); }
/** * Creates a QueryAtomContainer with the following settings: * * <pre> * QueryAtomContainer.create(container, * Expr.Type.ELEMENT, * Expr.Type.IS_AROMATIC, * Expr.Type.ALIPHATIC_ORDER); * </pre> * * @param container The AtomContainer that stands as model * @return The new QueryAtomContainer created from container. */ public static QueryAtomContainer createAnyAtomForPseudoAtomQueryContainer(IAtomContainer container) { return QueryAtomContainer.create(container, Expr.Type.ELEMENT, Expr.Type.IS_AROMATIC, Expr.Type.ALIPHATIC_ORDER); } }
/** * Creates a QueryAtomContainer with the following settings: * * <pre> * // aromaticity = true * QueryAtomContainer.create(container, * Expr.Type.IS_AROMATIC); * // aromaticity = false * QueryAtomContainer.create(container); * </pre> * * @param container The AtomContainer that stands as model * @param aromaticity option flag * @return The new QueryAtomContainer created from container. */ public static QueryAtomContainer createAnyAtomAnyBondContainer(IAtomContainer container, boolean aromaticity) { if (aromaticity) return QueryAtomContainer.create(container, Expr.Type.IS_AROMATIC); else return QueryAtomContainer.create(container); }
/** * Creates a QueryAtomContainer with the following settings: * * <pre> * QueryAtomContainer.create(container, * Expr.Type.ALIPHATIC_ELEMENT, * Expr.Type.AROMATIC_ELEMENT, * Expr.Type.IS_AROMATIC, * Expr.Type.ALIPHATIC_ORDER, * Expr.Type.STEREOCHEMISTRY); * </pre> * * @param container The AtomContainer that stands as model * @return The new QueryAtomContainer created from container. */ public static QueryAtomContainer createBasicQueryContainer(IAtomContainer container) { return QueryAtomContainer.create(container, Expr.Type.ALIPHATIC_ELEMENT, Expr.Type.AROMATIC_ELEMENT, Expr.Type.IS_AROMATIC, Expr.Type.ALIPHATIC_ORDER, Expr.Type.STEREOCHEMISTRY); }
/** * Creates a QueryAtomContainer with the following settings: * * <pre> * // aromaticity = true * QueryAtomContainer.create(container, * Expr.Type.IS_AROMATIC, * Expr.Type.ALIPHATIC_ORDER); * // aromaticity = false * QueryAtomContainer.create(container, * Expr.Type.ORDER); * </pre> * * @param container The AtomContainer that stands as model * @param aromaticity option flag * @return The new QueryAtomContainer created from container. */ public static QueryAtomContainer createAnyAtomContainer(IAtomContainer container, boolean aromaticity) { if (aromaticity) return QueryAtomContainer.create(container, Expr.Type.IS_AROMATIC, Expr.Type.ALIPHATIC_ORDER); else return QueryAtomContainer.create(container, Expr.Type.ORDER); }
/** * Create a pattern which can be used to find molecules which contain the * {@code query} structure. If a 'real' molecule is provided is is converted * with {@link QueryAtomContainer#create(IAtomContainer, Expr.Type...)} * matching elements, aromaticity status, and bond orders. * * @param query the substructure to find * @return a pattern for finding the {@code query} * @see QueryAtomContainer#create(IAtomContainer, Expr.Type...) */ public static DfPattern findSubstructure(IAtomContainer query) { if (query instanceof IQueryAtomContainer) return new DfPattern((IQueryAtomContainer) query); else return new DfPattern(QueryAtomContainer.create(query, ALIPHATIC_ELEMENT, AROMATIC_ELEMENT, SINGLE_OR_AROMATIC, ALIPHATIC_ORDER, STEREOCHEMISTRY)); }
private void test(String expected, String smi, Expr.Type... opts) throws InvalidSmilesException { IAtomContainer mol = smipar.parseSmiles(smi); Cycles.markRingAtomsAndBonds(mol); IQueryAtomContainer query = QueryAtomContainer.create(mol, opts); String actual = Smarts.generate(query); assertThat(actual, is(expected)); }