Package chemaxon.pharmacophore
Class PMap
- java.lang.Object
-
- chemaxon.pharmacophore.PMap
-
@PublicAPI public class PMap extends Object
Class representing the pharmacophore properties found for the atoms of a target molecule.- Since:
- JChem 2.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Sets every feature for every atom tofalse
void
clearFeatures(int atomIndex)
Clears all features corresponding to the given atom index.Object
clone()
Clones this PMap object.static PMap
create(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 totrue
.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.
-
-
-
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 moleculenfeatures
- is the number of pharmacophore features
-
PMap
public PMap(int natoms, BitSet[] features)
Constructor. Sets the features array.- Parameters:
natoms
- is the number of atoms in the target moleculefeatures
- is the features array
-
-
Method Detail
-
clone
public Object clone()
Clones this PMap object. Copies the feature array and the number of atoms.
-
clear
public void clear()
Sets every feature for every atom tofalse
-
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 totrue
.- Parameters:
atomIndex
- the index of the atomfeatureIndex
- 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 atomfeatureIndex
- 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 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 indexatomIndices
- is the preallocated array that will contain the return value- Returns:
- the number of atom indices set in the 'atomIndices' array.
- Throws:
ArrayIndexOutOfBoundsException
- if the preallocated array is not big enough to hold the atom indices
-
toString
public 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(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
-
-