org.openscience.cdk.pharmacophore
Class PharmacophoreUtils

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

@TestClass(value="org.openscience.cdk.pharmacophore.PharmacophoreUtilityTest")
public class PharmacophoreUtils
extends Object

Provides some utility methods for pharmacophore handling.

Author:
Rajarshi Guha
Keywords:
pharmacophore, 3D isomorphism
Required library to be able to run this class:
xom-1.1.jar
Required library to be able to compile this class:
xom-1.1.jar
Belongs to CDK module:
pcore
Source code:
cdk-1.4.x

Constructor Summary
PharmacophoreUtils()
           
 
Method Summary
static List<PharmacophoreQuery> readPharmacophoreDefinitions(InputStream ins)
          Read in a set of pharmacophore definitions to create pharmacophore queries.
static List<PharmacophoreQuery> readPharmacophoreDefinitions(String filename)
          Read in a set of pharmacophore definitions to create pharmacophore queries.
static void writePharmacophoreDefinition(List<PharmacophoreQuery> queries, OutputStream out)
          Write out one or more pharmacophore queries in the CDK XML format.
static void writePharmacophoreDefinition(PharmacophoreQuery[] queries, OutputStream out)
          Write out one or more pharmacophore queries in the CDK XML format.
static void writePharmacophoreDefinition(PharmacophoreQuery query, OutputStream out)
          Write out one or more pharmacophore queries in the CDK XML format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PharmacophoreUtils

public PharmacophoreUtils()
Method Detail

readPharmacophoreDefinitions

@TestMethod(value="testReadPcoreDef, testInvalidPcoreXML")
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 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:
PharmacophoreQueryAtom, PharmacophoreQueryBond, PharmacophoreQuery, PharmacophoreMatcher

readPharmacophoreDefinitions

@TestMethod(value="testReadPcoreDef, testReadPcoreAngleDef, testInvalidPcoreXML")
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 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:
PharmacophoreQueryAtom, PharmacophoreQueryBond, PharmacophoreMatcher, PharmacophoreQuery

writePharmacophoreDefinition

@TestMethod(value="testPCoreWrite")
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

@TestMethod(value="testPCoreWrite")
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

@TestMethod(value="testPCoreWrite")
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