/** * Convenience method to count the number of unique atom mappings. Note * mappings are lazily generated and checking the count and then iterating * over the mappings currently performs two searches. If the mappings are * also needed, it is more efficient to check the mappings and count * manually. * * The method is simply invokes <pre>mappings.uniqueAtoms().count()</pre>. * * @return number of matches */ public int countUnique() { return uniqueAtoms().count(); }
/** * Get the uniue matching pharmacophore groups. * * The method should be called after performing the match, otherwise the return value is null. * The method returns a List of List's. Each List represents the pharmacophore groups in the * target molecule that matched the query. Each pharmacophore group contains the indices of the * atoms (in the target molecule) that correspond to the group. * * This is analogous to the USA form of return value from a SMARTS match. * * @return a List of a List of pharmacophore groups in the target molecule that match the query * @see org.openscience.cdk.pharmacophore.PharmacophoreAtom */ public List<List<PharmacophoreAtom>> getUniqueMatchingPharmacophoreAtoms() { if (pharmacophoreMolecule == null || mappings == null) return null; return getPCoreAtoms(mappings.uniqueAtoms()); }
/** * Get the uniue matching pharmacophore groups. * * The method should be called after performing the match, otherwise the return value is null. * The method returns a List of List's. Each List represents the pharmacophore groups in the * target molecule that matched the query. Each pharmacophore group contains the indices of the * atoms (in the target molecule) that correspond to the group. * * This is analogous to the USA form of return value from a SMARTS match. * * @return a List of a List of pharmacophore groups in the target molecule that match the query * @see org.openscience.cdk.pharmacophore.PharmacophoreAtom */ public List<List<PharmacophoreAtom>> getUniqueMatchingPharmacophoreAtoms() { if (pharmacophoreMolecule == null || mappings == null) return null; return getPCoreAtoms(mappings.uniqueAtoms()); }
.uniqueAtoms() .toAtomBondMap()) { boolean overlaps = false;
.uniqueAtoms() .toAtomBondMap()) { boolean overlaps = false;
if (pattern.matchAll(container).uniqueAtoms().atLeast(key.count + 1)) fp.set(i);
@Test public void toSubstructures() throws Exception { IAtomContainer query = smi("O1CC1"); IAtomContainer target = smi("C1OC1CCC"); Iterable<IAtomContainer> iterable = Pattern.findSubstructure(query) .matchAll(target) .uniqueAtoms() .toSubstructures(); Iterator<IAtomContainer> iterator = iterable.iterator(); assertTrue(iterator.hasNext()); IAtomContainer submol = iterator.next(); assertThat(submol, is(not(query))); // note that indices are mapped from query to target assertThat(submol.getAtom(0), is(target.getAtom(1))); // oxygen assertThat(submol.getAtom(1), is(target.getAtom(0))); // C assertThat(submol.getAtom(2), is(target.getAtom(2))); // C assertThat(submol.getBond(0), is(target.getBond(0))); // C-O bond assertThat(submol.getBond(1), is(target.getBond(2))); // O-C bond assertThat(submol.getBond(2), is(target.getBond(1))); // C-C bond assertFalse(iterator.hasNext()); }
.uniqueAtoms() .atLeast(keys[i].count + 1)) fp.set(i);
for (Map<IAtom, IAtom> atoms : ptrn.matchAll(mol).uniqueAtoms().toAtomMap()) { for (Map.Entry<IAtom, IAtom> e : atoms.entrySet()) { e.getValue().setPoint2d(new Point2d(e.getKey().getPoint2d()));
for (Map<IAtom, IAtom> atoms : ptrn.matchAll(mol).uniqueAtoms().toAtomMap()) { for (Map.Entry<IAtom, IAtom> e : atoms.entrySet()) { e.getValue().setPoint2d(new Point2d(e.getKey().getPoint2d()));