Class PharmacophoreUtils

java.lang.Object
org.openscience.cdk.pharmacophore.PharmacophoreUtils

public class PharmacophoreUtils extends Object
Provides some utility methods for pharmacophore handling.
Author:
Rajarshi Guha
Source code:
main
Belongs to CDK module:
pcore
Keywords:
pharmacophore, 3D isomorphism
  • Constructor Details

    • PharmacophoreUtils

      public PharmacophoreUtils()
  • Method Details

    • readPharmacophoreDefinitions

      public static List<PharmacophoreQuery> readPharmacophoreDefinitions(String filename) throws CDKException, IOException
      Read in a set of pharmacophore definitions to create pharmacophore queries. Pharmacophore queries can be saved in an XML format which is described XXX. The file can contain multiple definitions. This method will process all the definitions and return a list fo PharmacophoreQuery objects which can be used with the PharmacophoreMatcher class. The current schema for the document allows one to specify angle and distance constraints. Currently the CDK does not support angle constraints, so they are ignored. The schema also specifies a units attribute for a given constraint. The current reader ignores this and assumes that all distances are in Angstroms. Finally, if there is a description associated with a pharmacophore definition, it is available as the "description" property of the PharmacophoreQuery object. Example usage is
      
       List<PharmacophoreQuery> defs = readPharmacophoreDefinitions("mydefs.xml");
       System.out.println("Number of definitions = "+defs.size());
       for (int i = 0; i < defs.size(); i++) {
           System.out.println("Desc: "+defs.get(i).getProperty("description");
       }
       
      Parameters:
      filename - The file to read the definitions from
      Returns:
      A list of PharmacophoreQuery objects
      Throws:
      CDKException - if there is an error in the format
      IOException - if there is an error in opening the file
      See Also:
    • readPharmacophoreDefinitions

      public static List<PharmacophoreQuery> readPharmacophoreDefinitions(InputStream ins) throws IOException, CDKException
      Read in a set of pharmacophore definitions to create pharmacophore queries. Pharmacophore queries can be saved in an XML format which is described XXX. The file can contain multiple definitions. This method will process all the definitions and return a list of PharmacophoreQuery objects which can be used with the PharmacophoreMatcher class. The current schema for the document allows one to specify angle and distance constraints. The schema also specifies a units attribute for a given constraint. The current reader ignores this and assumes that all distances are in Angstroms and angles are in degrees. Finally, if there is a description associated with a pharmacophore definition, it is available as the "description" property of the PharmacophoreQuery object. Example usage is
      
       List<PharmacophoreQuery> defs = readPharmacophoreDefinitions"mydefs.xml");
       System.out.println("Number of definitions = "+defs.size());
       for (int i = 0; i < defs.size(); i++) {
           System.out.println("Desc: "+defs.get(i).getProperty("description");
       }
       
      Parameters:
      ins - The stream to read the definitions from
      Returns:
      A list of PharmacophoreQuery objects
      Throws:
      CDKException - if there is an error in the format
      IOException - if there is an error in opening the file
      See Also:
    • writePharmacophoreDefinition

      public static void writePharmacophoreDefinition(PharmacophoreQuery query, OutputStream out) throws IOException
      Write out one or more pharmacophore queries in the CDK XML format.
      Parameters:
      query - The pharmacophore queries
      out - The OutputStream to write to
      Throws:
      IOException - if there is a problem writing the XML document
    • writePharmacophoreDefinition

      public static void writePharmacophoreDefinition(List<PharmacophoreQuery> queries, OutputStream out) throws IOException
      Write out one or more pharmacophore queries in the CDK XML format.
      Parameters:
      queries - The pharmacophore queries
      out - The OutputStream to write to
      Throws:
      IOException - if there is a problem writing the XML document
    • writePharmacophoreDefinition

      public static void writePharmacophoreDefinition(PharmacophoreQuery[] queries, OutputStream out) throws IOException
      Write out one or more pharmacophore queries in the CDK XML format.
      Parameters:
      queries - The pharmacophore queries
      out - The OutputStream to write to
      Throws:
      IOException - if there is a problem writing the XML document