chemaxon.pharmacophore
Class PMap

java.lang.Object
  extended by chemaxon.pharmacophore.PMap

public class PMap
extends java.lang.Object

Class representing the pharmacophore properties found for the atoms of a target molecule.

Since:
JChem 2.0
Author:
Nora Mate

Constructor Summary
PMap(int natoms, java.util.BitSet[] features)
          Constructor.
PMap(int natoms, int nfeatures)
          Constructor.
 
Method Summary
 void clear()
          Sets every feature for every atom to false
 void clearFeatures(int atomIndex)
          Clears all features corresponding to the given atom index.
 java.lang.Object clone()
          Clones this PMap object.
static PMap create(java.lang.String plist, PSymbols symbols)
          Creates a PMap object from a pharmacophore point list string.
 int getAtomCount()
          Returns the number of atoms.
 int[] getAtoms(int featureIndex)
          Returns the atom indices of the atoms having the given feature.
 int getAtoms(int featureIndex, int[] atomIndices)
          Returns the atom indices of the atoms having the given feature.
 int getFeatureCount()
          Returns the number of features.
 int getFeatureCount(int atomIndex)
          Returns the number of features corresponding to the given atom index.
 int[] getFeatures(int atomIndex)
          Returns the feature indices corresponding to the given atom index.
 boolean hasFeature(int atomIndex)
          Tells weather a given atom has any pharmacophore property.
 boolean hasFeature(int atomIndex, int featureIndex)
          Tells weather a given atom has a given pharmacophore property.
 void setFeature(int atomIndex, int featureIndex)
          Sets a given feature of a given atom to true.
 java.lang.String toString(PSymbols symbols)
          Returns the string representation of the feature map: for each atom the symbols representing the features of the atom are separated by '/' characters and these feature strings are separated by ';' characters.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMap

public PMap(int natoms,
            int nfeatures)
Constructor. Creates an empty pharmacophore map.

Parameters:
natoms - is the number of atoms in the target molecule
nfeatures - is the number of pharmacophore features

PMap

public PMap(int natoms,
            java.util.BitSet[] features)
Constructor. Sets the features array.

Parameters:
natoms - is the number of atoms in the target molecule
features - is the features array
Method Detail

clone

public java.lang.Object clone()
Clones this PMap object. Copies the feature array and the number of atoms.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this object

clear

public void clear()
Sets every feature for every atom to false


getAtomCount

public int getAtomCount()
Returns the number of atoms.

Returns:
the number of atoms

getFeatureCount

public int getFeatureCount()
Returns the number of features.

Returns:
the number of features

setFeature

public void setFeature(int atomIndex,
                       int featureIndex)
Sets a given feature of a given atom to true.

Parameters:
atomIndex - the index of the atom
featureIndex - the index of the feature

hasFeature

public boolean hasFeature(int atomIndex,
                          int featureIndex)
Tells weather a given atom has a given pharmacophore property.

Parameters:
atomIndex - the index of the atom
featureIndex - the index of the feature
Returns:
true if the feature is true for the atom

hasFeature

public boolean hasFeature(int atomIndex)
Tells weather a given atom has any pharmacophore property.

Parameters:
atomIndex - the index of the atom
Returns:
true if at least one feature is true for the atom

getFeatureCount

public int getFeatureCount(int atomIndex)
Returns the number of features corresponding to the given atom index.

Parameters:
atomIndex - is the atom index
Returns:
the number of features corresponding to the given atom index

getFeatures

public int[] getFeatures(int atomIndex)
Returns the feature indices corresponding to the given atom index.

Parameters:
atomIndex - is the atom index
Returns:
the feature indices corresponding to the given atom index

clearFeatures

public void clearFeatures(int atomIndex)
Clears all features corresponding to the given atom index.

Parameters:
atomIndex - is the atom index

getAtoms

public int[] getAtoms(int featureIndex)
Returns the atom indices of the atoms having the given feature.

Parameters:
featureIndex - is the feature index
Returns:
the atom indices of the atoms having the given feature

getAtoms

public int getAtoms(int featureIndex,
                    int[] atomIndices)
             throws java.lang.ArrayIndexOutOfBoundsException
Returns the atom indices of the atoms having the given feature. The array holding the return values is preallocated and given as parameter for efficiency. Returns the number of atom indices set in the array.

Parameters:
featureIndex - is the feature index
atomIndices - is the preallocated array that will contain the return value
Returns:
the number of atom indices set in the 'atomIndices' array.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the preallocated array is not big enough to hold the atom indices

toString

public java.lang.String toString(PSymbols symbols)
Returns the string representation of the feature map: for each atom the symbols representing the features of the atom are separated by '/' characters and these feature strings are separated by ';' characters. The number of symbols in the given symbols object is supposed to be greater than or equal to the number of features in this PMap object.

Parameters:
symbols - is the object storing the feature symbols
Returns:
a string representation of the pharmacophore features

create

public static PMap create(java.lang.String plist,
                          PSymbols symbols)
Creates a PMap object from a pharmacophore point list string.

Parameters:
plist - is the pharmacophore point list string (e.g. "a;b;d/d;;")
symbols - is the object storing the feature symbols
Returns:
the PMap object representing the point list string