chemaxon.sss.search
Class MarkushTagger

java.lang.Object
  extended by chemaxon.sss.search.MarkushTagger

public class MarkushTagger
extends java.lang.Object

Tags Markush structure by the coverage data of example structures. Structure searches are performed with the example structures as queries and statistics about the covered Markush features is stored.

Since:
5.4
Author:
Nora Mate, Ali Baharev

Field Summary
static int COLORING_GRADUAL
           
static int COLORING_NONE
           
static int COLORING_SOLID
           
 
Constructor Summary
MarkushTagger()
          Constructor.
 
Method Summary
 java.util.Hashtable<MarkushFeature,int[]> getFeatureCoverageTable()
          Returns the feature coverage table.
 java.util.Hashtable<MarkushFeature,int[]> getFeatureTable()
          Returns the Markush feature table of the Markush structure.
static java.util.logging.Level getLoggingLevel()
          Returns the logging level.
 Molecule getMarkush()
          Returns the Markush structure.
 MolSearchOptions getSearchOptions()
          Returns the search options.
static java.util.Hashtable<MarkushFeature,int[]> restore(java.lang.String tableString)
          Restores the feature table returned by getFeatureTable() or the feature coverage table returned by getFeatureCoverageTable() from its String representation.
 void setAllHits(boolean allHits)
          Sets all-hits mode: true if all hits to be processed, false if first hit only.
 void setColor(java.awt.Color color)
          Sets the color for hit coverage coloring on the Markush structure.
 void setColoringStyle(int coloringStyle)
          Sets the coloring style.
 void setExpandHomology(boolean expandHomology)
          Sets homology expansion mode: true if homology groups should be replaced by matching R-groups.
static void setLoggingLevel(java.util.logging.Level level)
          Sets the logging level.
 void setMarkush(Molecule markush)
          Sets the Markush structure.
 void setQueries(Molecule[] queries)
          Sets the query (example) molecules.
 void setSearchOptions(MolSearchOptions options)
          Sets the search options.
static java.lang.String store(java.util.Hashtable<MarkushFeature,int[]> table)
          Converts the feature table returned by getFeatureTable() or the feature coverage table returned by getFeatureCoverageTable() to String.
 void tag()
          Performs the searches, stores Markush feature coverage data, optionally colors the Markush structure according to hit coverage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLORING_NONE

public static final int COLORING_NONE
See Also:
Constant Field Values

COLORING_SOLID

public static final int COLORING_SOLID
See Also:
Constant Field Values

COLORING_GRADUAL

public static final int COLORING_GRADUAL
See Also:
Constant Field Values
Constructor Detail

MarkushTagger

public MarkushTagger()
Constructor.

Method Detail

setLoggingLevel

public static void setLoggingLevel(java.util.logging.Level level)
Sets the logging level.

Parameters:
level - the new level

getLoggingLevel

public static java.util.logging.Level getLoggingLevel()
Returns the logging level.

Returns:
the logging level

setMarkush

public void setMarkush(Molecule markush)
Sets the Markush structure.

Parameters:
markush - the Markush structure

setQueries

public void setQueries(Molecule[] queries)
Sets the query (example) molecules.

Parameters:
queries - the query molecules

setSearchOptions

public void setSearchOptions(MolSearchOptions options)
Sets the search options.

Parameters:
options - the search options

getSearchOptions

public MolSearchOptions getSearchOptions()
Returns the search options.

Returns:
the search options

setAllHits

public void setAllHits(boolean allHits)
Sets all-hits mode: true if all hits to be processed, false if first hit only. Default: false.

Parameters:
allHits - true if all hits to be processed

setExpandHomology

public void setExpandHomology(boolean expandHomology)
Sets homology expansion mode: true if homology groups should be replaced by matching R-groups. Default: true.

Parameters:
expandHomology - true if homology groups should be replaced by matching R-groups

setColoringStyle

public void setColoringStyle(int coloringStyle)
Sets the coloring style. This is the style of hit coverage coloring on the Markush structure. In homology expansion mode the extended Markush is colored, otherwise the original Markush is used.

Parameters:
coloringStyle - the coloring style, possible values:
See Also:
setExpandHomology(boolean), setColor(java.awt.Color)

setColor

public void setColor(java.awt.Color color)
Sets the color for hit coverage coloring on the Markush structure. In homology expansion mode the extended Markush is colored, otherwise the original Markush is used. This color is used if the coloring style is different from COLORING_NONE. Default: Color.RED

See Also:
setExpandHomology(boolean), setColoringStyle(int)

getMarkush

public Molecule getMarkush()
Returns the Markush structure. This is a clone of the original Markush structure. The Markush structure is extended by homology expansions in R-group definitions in homology expansion mode (see setExpandHomology(boolean)). The feature and feature coverage tables returned in getFeatureTable() and getFeatureCoverageTable() will refer to this Markush structure.


getFeatureTable

public java.util.Hashtable<MarkushFeature,int[]> getFeatureTable()
Returns the Markush feature table of the Markush structure. Available after calling tag(). The table maps Markush feature keys identifying the feature to an array of possible expansion values. If the queries match homology groups then the feature table refers to an extended Markush structure where homologies are replaced by R-groups with definitions generated from the matching parts of the queries. The extended Markush is returned by getMarkush(). The expansion values by feature type are:

Returns:
the Markush feature table
See Also:
tag(), getFeatureCoverageTable()

getFeatureCoverageTable

public java.util.Hashtable<MarkushFeature,int[]> getFeatureCoverageTable()
Returns the feature coverage table. The table maps Markush feature keys identifying the feature to an array of the occurrences found for each possible expansion value. This array refers to the expansion values in the feature table returned in getFeatureTable(). If the queries match homology groups then the feature coverage table refers to an extended Markush structure where homologies are replaced by R-groups with definitions generated from the matching parts of the queries. The extended Markush is returned by getMarkush().

Returns:
the feature coverage table
See Also:
tag(), getFeatureTable(), getMarkush()

store

public static java.lang.String store(java.util.Hashtable<MarkushFeature,int[]> table)
                              throws java.io.IOException
Converts the feature table returned by getFeatureTable() or the feature coverage table returned by getFeatureCoverageTable() to String. The string representation is the base64-encoded serialization of the table.

Parameters:
table - the feature table or the feature coverage table
Returns:
the base64-encoded serialization of the table
Throws:
java.io.IOException
See Also:
restore(java.lang.String), getFeatureTable(), getFeatureCoverageTable()

restore

public static java.util.Hashtable<MarkushFeature,int[]> restore(java.lang.String tableString)
                                                         throws java.io.IOException,
                                                                java.lang.ClassNotFoundException
Restores the feature table returned by getFeatureTable() or the feature coverage table returned by getFeatureCoverageTable() from its String representation. The string representation is the base64-encoded serialization of the table.

Parameters:
tableString - the base64-encoded serialization of the table
Returns:
the feature table or the feature coverage table
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
store(java.util.Hashtable), getFeatureTable(), getFeatureCoverageTable()

tag

public void tag()
         throws chemaxon.sss.search.SearchException,
                chemaxon.enumeration.supergraph.SupergraphException
Performs the searches, stores Markush feature coverage data, optionally colors the Markush structure according to hit coverage. The coverage data is a map from Markush feature keys identifying the features to an array of occurrence values referring to the number of expansions found with the available expansion values. The table of possible expansion values is returned in getFeatureTable(), the table of int[] elements representing the corresponding occurrences is returned in getFeatureCoverageTable().

Throws:
chemaxon.sss.search.SearchException - on search error
chemaxon.enumeration.supergraph.SupergraphException - on supergraph error
See Also:
getFeatureTable(), getFeatureCoverageTable()