chemaxon.pharmacophore
Class PMapper

java.lang.Object
  extended by chemaxon.pharmacophore.PMapper
All Implemented Interfaces:
chemaxon.license.Licensable

public class PMapper
extends java.lang.Object
implements chemaxon.license.Licensable

Class for searching for pharmacophore properties in a molecule.

An example for running PharmacophoreMapper:

 
 String pmConfigFileName; // path to the pharmacophore XML config file
 String stConfigFileName; // path to the molecule standardization config file
 ...
 Standardizer st = new Standardizer(new File(stConfigFileName));
 PMapper pm = new PMapper(new File(pmConfigFileName), st);
 PSymbols symbols = pm.getSymbols();
 ...
 while ( ...  there are more molecules ... ) {
     // getting the next molecule from file or database
     Molecule target = ... ;
     // get the feature ID -> atom index BitSet HashMap
     PMap pmap = pm.createFeatureMap(target);
     // get the feature symbol string
     String result = pmap.toString(symbols);
     System.out.println(result);
 }
 

Since:
JChem 2.0
Author:
Nora Mate

Field Summary
static java.lang.String DEFAULT_TAG_NAME
          Default SDFile tag to store the Pharmacophore Map.
 
Constructor Summary
PMapper(org.dom4j.Element config)
          Constructor.
PMapper(org.dom4j.Element config, org.dom4j.Element stconfig)
          Constructor.
PMapper(org.dom4j.Element config, org.dom4j.Element stconfig, java.lang.String dir)
          Constructor.
PMapper(org.dom4j.Element config, Standardizer standardizer)
          Constructor.
PMapper(org.dom4j.Element config, Standardizer standardizer, java.lang.String dir)
          Constructor.
PMapper(org.dom4j.Element config, java.lang.String dir)
          Constructor.
PMapper(java.io.File config)
          Constructor.
PMapper(java.io.File config, Standardizer standardizer)
          Constructor.
PMapper(java.lang.String config)
          Constructor.
PMapper(java.lang.String config, Standardizer standardizer)
          Constructor.
 
Method Summary
 PMap createFeatureMap(Molecule target)
          Creates the feature ID -> atom index BitSet HashMap for the given target molecule.
 java.lang.String getID(java.lang.String symbol)
          Returns the ID corresponding to the given symbol.
 Molecule getMolConstant(java.lang.String id)
          Returns the molecule constant corresponding to the given ID.
 PSymbols getSymbols()
          Returns the symbol storing object.
 boolean isLicensed()
           
static void main(java.lang.String[] args)
          The command line version entry point.
 void setLicenseEnvironment(java.lang.String env)
           
 void setVerbose(boolean verbose)
          Sets verbose output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TAG_NAME

public static final java.lang.String DEFAULT_TAG_NAME
Default SDFile tag to store the Pharmacophore Map.

See Also:
Constant Field Values
Constructor Detail

PMapper

public PMapper(java.io.File config)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException,
               StandardizerException
Constructor. Sets the pharmacophore configuration.

Parameters:
config - is the XML config file
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error
StandardizerException

PMapper

public PMapper(java.io.File config,
               Standardizer standardizer)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException,
               StandardizerException
Constructor. Sets the pharmacophore configuration and the standardizer object used to standardize the molecules before pharmacophore property search.

Parameters:
config - is the XML config file
standardizer - is the Standardizer object (may be null)
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error
StandardizerException - on standardizer configuration error

PMapper

public PMapper(java.lang.String config)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException,
               StandardizerException
Constructor. Sets the pharmacophore configuration.

Parameters:
config - is the XML config string
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error
StandardizerException - on standardizer configuration error

PMapper

public PMapper(java.lang.String config,
               Standardizer standardizer)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException,
               StandardizerException
Constructor. Sets the pharmacophore configuration and the standardizer object used to standardize the molecules before pharmacophore property search.

Parameters:
config - is the XML config string
standardizer - is the Standardizer object (may be null)
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error
StandardizerException - on standardizer configuration error

PMapper

public PMapper(org.dom4j.Element config,
               java.lang.String dir)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException
Constructor. Sets the pharmacophore configuration.

Parameters:
config - is the XML config root node
dir - is the root directory
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error

PMapper

public PMapper(org.dom4j.Element config)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException
Constructor. Sets the pharmacophore configuration.

Parameters:
config - is the XML config root node
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error

PMapper

public PMapper(org.dom4j.Element config,
               Standardizer standardizer,
               java.lang.String dir)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException
Constructor. Sets the pharmacophore configuration and the standardizer object used to standardize the molecules before pharmacophore property search.

Parameters:
config - is the XML config root node
standardizer - is the Standardizer object (may be null)
dir - is the root directory
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error

PMapper

public PMapper(org.dom4j.Element config,
               Standardizer standardizer)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException
Constructor. Sets the pharmacophore configuration and the standardizer object used to standardize the molecules before pharmacophore property search.

Parameters:
config - is the XML config root node
standardizer - is the Standardizer object (may be null)
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error

PMapper

public PMapper(org.dom4j.Element config,
               org.dom4j.Element stconfig,
               java.lang.String dir)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException,
               StandardizerException
Constructor. Sets the pharmacophore configuration and the standardizer object used to standardize the molecules before pharmacophore property search.

Parameters:
config - is the XML config root node
stconfig - is the standardizer config root node
dir - is the root directory
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error
StandardizerException - if the standardizer object creation fails

PMapper

public PMapper(org.dom4j.Element config,
               org.dom4j.Element stconfig)
        throws java.io.IOException,
               chemaxon.nfunk.jep.ParseException,
               StandardizerException
Constructor. Sets the pharmacophore configuration and the standardizer object used to standardize the molecules before pharmacophore property search.

Parameters:
config - is the XML config root node
stconfig - is the standardizer config root node
Throws:
java.io.IOException - on IO error in molecule input
chemaxon.nfunk.jep.ParseException - on DOM parse error or configuration error
StandardizerException - if the standardizer object creation fails
Method Detail

setVerbose

public void setVerbose(boolean verbose)
Sets verbose output.

Parameters:
verbose - is true if verbose output

getMolConstant

public Molecule getMolConstant(java.lang.String id)
Returns the molecule constant corresponding to the given ID.

Parameters:
id - is the molecule ID
Returns:
the molecule constant with the given ID or null if no such molecule

getSymbols

public PSymbols getSymbols()
Returns the symbol storing object.

Returns:
the symbol storing object

getID

public java.lang.String getID(java.lang.String symbol)
Returns the ID corresponding to the given symbol.

Parameters:
symbol - is the feature symbol
Returns:
the ID corresponding to the given symbol

createFeatureMap

public PMap createFeatureMap(Molecule target)
                      throws chemaxon.sss.search.SearchException,
                             chemaxon.nfunk.jep.ParseException,
                             chemaxon.license.LicenseException
Creates the feature ID -> atom index BitSet HashMap for the given target molecule. The i-th bit in the BitSet is 1 if the i-th atom has the feature, 0 otherwise.

Parameters:
target - is the target molecule
Returns:
the feature ID -> atom index BitSet HashMap
Throws:
chemaxon.sss.search.SearchException - if the standardization fails
chemaxon.nfunk.jep.ParseException - if the feature expression cannot be evaluated
chemaxon.license.LicenseException - if no license found

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable

isLicensed

public boolean isLicensed()
Specified by:
isLicensed in interface chemaxon.license.Licensable

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
The command line version entry point. Parameter parsing, initialization then start.

Parameters:
args - the command line parameters
Throws:
java.lang.Exception