Class PharmacophoreMatcher


  • public class PharmacophoreMatcher
    extends Object
    Identifies atoms whose 3D arrangement matches a specified pharmacophore query. A pharmacophore is defined by a set of atoms and distances between them. More generically we can restate this as a set of pharmacophore groups and the distances between them. Note that a pharmacophore group may consist of one or more atoms and the distances can be specified as a distance range rather than an exact distance. The goal of a pharmacophore query is to identify atom in a molecule whose 3D arrangement match a specified query. To perform a query one must first create a set of pharmacophore groups and specify the distances between them. Each pharmacophore group is represented by a PharmacophoreAtom and the distances between them are represented by a PharmacophoreBond. These are collected in a QueryAtomContainer. Given the query pharmacophore one can use this class to check with it occurs in a specified molecule. Note that for full generality pharmacophore searches are performed using conformations of molecules. This can easily be accomplished using this class together with the ConformerContainer class. See the example below. Currently this class will allow you to perform pharmacophore searches using triads, quads or any number of pharmacophore groups. However, only distances and angles between pharmacophore groups are considered, so alternative constraints such as torsions and so on cannot be considered at this point. After a query has been performed one can retrieve the matching groups (as opposed to the matching atoms of the target molecule). However since a pharmacophore group (which is an object of class PharmacophoreAtom) allows you to access the indices of the corresponding atoms in the target molecule, this is not very difficult. Example usage:
     QueryAtomContainer query = new QueryAtomContainer();
     
     PharmacophoreQueryAtom o = new PharmacophoreQueryAtom("D", "[OX1]");
     PharmacophoreQueryAtom n1 = new PharmacophoreQueryAtom("A", "[N]");
     PharmacophoreQueryAtom n2 = new PharmacophoreQueryAtom("A", "[N]");
     
     query.addAtom(o);
     query.addAtom(n1);
     query.addAtom(n2);
     
     PharmacophoreQueryBond b1 = new PharmacophoreQueryBond(o, n1, 4.0, 4.5);
     PharmacophoreQueryBond b2 = new PharmacophoreQueryBond(o, n2, 4.0, 5.0);
     PharmacophoreQueryBond b3 = new PharmacophoreQueryBond(n1, n2, 5.4, 5.8);
     
     query.addBond(b1);
     query.addBond(b2);
     query.addBond(b3);
     
     String filename = "/Users/rguha/pcore1.sdf";
     IteratingMDLConformerReader reader = new IteratingMDLConformerReader(
          new FileReader(new File(filename)), DefaultChemObjectBuilder.getInstance());
     
     ConformerContainer conformers;
     if (reader.hasNext()) conformers = (ConformerContainer) reader.next();
     
     boolean firstTime = true;
     for (IAtomContainer conf : conformers) {
       boolean status;
       if (firstTime) {
         status = matcher.matches(conf, true);
         firstTime = false;
       } else status = matcher.matches(conf, false);
       if (status) {
         // OK, matched. Do something
       }
     }
     
    Extensions to SMARTS
    The pharmacophore supports some extentions to the SMARTS language that lead to flexible pharmacophore definitions Note that these extensions are specific to pharmacophore usage and are not generally provided by the SMARTS parser itself.

    • | - this allows one to perform a logical OR between two or more SMARTS patterns. An example might be a pharmacophore group that is meant to match a 5 membered ring or a 6 membered ring. This cannot be written in a single ordinary SMARTS pattern. However using this one extension one can write
      A1AAAA1|A1AAAAA1
    Author:
    Rajarshi Guha
    See Also:
    PharmacophoreAtom, PharmacophoreBond, PharmacophoreQueryAtom, PharmacophoreQueryBond
    Source code:
    main
    Belongs to CDK module:
    pcore
    Keywords:
    pharmacophore, 3D isomorphism
    • Constructor Detail

      • PharmacophoreMatcher

        public PharmacophoreMatcher()
        An empty constructor. You should set the query before performing a match
    • Method Detail

      • matches

        public boolean matches​(IAtomContainer atomContainer)
                        throws CDKException
        Performs the pharmacophore matching. This method will analyze the specified target molecule to identify pharmacophore groups. If dealing with conformer data it is probably more efficient to use the other form of this method which allows one to skip the pharmacophore group identification step after the first conformer.
        Parameters:
        atomContainer - The target molecule. Must have 3D coordinates
        Returns:
        true is the target molecule contains the query pharmacophore
        Throws:
        CDKException - if the query pharmacophore was not set or the query is invalid or if the molecule does not have 3D coordinates
        See Also:
        matches(org.openscience.cdk.interfaces.IAtomContainer, boolean)
      • matches

        public boolean matches​(IAtomContainer atomContainer,
                               boolean initializeTarget)
                        throws CDKException
        Performs the pharmacophore matching.
        Parameters:
        atomContainer - The target molecule. Must have 3D coordinates
        initializeTarget - If true, the target molecule specified in the first argument will be analyzed to identify matching pharmacophore groups. If false this is not performed. The latter case is only useful when dealing with conformers since for a given molecule, all conformers will have the same pharmacophore groups and only the constraints will change from one conformer to another.
        Returns:
        true is the target molecule contains the query pharmacophore
        Throws:
        CDKException - if the query pharmacophore was not set or the query is invalid or if the molecule does not have 3D coordinates
      • getMatchingPharmacophoreBonds

        public List<List<IBond>> getMatchingPharmacophoreBonds()
        Get the matching pharmacophore constraints. 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 constraints in the target molecule that matched the query. Since constraints are conceptually modeled on bonds the result is a list of list of IBond. You should coerce these to the appropriate pharmacophore bond to get at the underlying grops.
        Returns:
        a List of a List of pharmacophore constraints in the target molecule that match the query
        See Also:
        PharmacophoreBond, PharmacophoreAngleBond
      • getTargetQueryBondMappings

        public List<HashMap<IBond,​IBond>> getTargetQueryBondMappings()
        Return a list of HashMap's that allows one to get the query constraint for a given pharmacophore bond. If the matching is successful, the return value is a List of HashMaps, each HashMap corresponding to a separate match. Each HashMap is keyed on the PharmacophoreBond in the target molecule that matched a constraint (PharmacophoreQueryBond or PharmacophoreQueryAngleBond. The value is the corresponding query bond.
        Returns:
        A List of HashMaps, identifying the query constraint corresponding to a matched constraint in the target molecule.
      • getMatchingPharmacophoreAtoms

        public List<List<PharmacophoreAtom>> getMatchingPharmacophoreAtoms()
        Get the 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.
        Returns:
        a List of a List of pharmacophore groups in the target molecule that match the query
        See Also:
        PharmacophoreAtom
      • getUniqueMatchingPharmacophoreAtoms

        public List<List<PharmacophoreAtom>> getUniqueMatchingPharmacophoreAtoms()
        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.
        Returns:
        a List of a List of pharmacophore groups in the target molecule that match the query
        See Also:
        PharmacophoreAtom
      • getPharmacophoreQuery

        public PharmacophoreQuery getPharmacophoreQuery()
        Get the query pharmacophore.
        Returns:
        The query
      • setPharmacophoreQuery

        public void setPharmacophoreQuery​(PharmacophoreQuery query)
        Set a pharmacophore query.
        Parameters:
        query - The query