Package chemaxon.descriptors
Class MDSimilarityResultWriter
java.lang.Object
chemaxon.descriptors.MDSimilarityResultWriter
Base class for prointing results produced by
MDSimilarity
.- Since:
- JChem 2.0
-
Field Summary
Modifier and TypeFieldDescriptionlabels are either SDfile tagnames or table column headers depending on oututprotected Molecule
the molecular structureprotected PrintStream
the output stream where results are written toprotected MDSimilarity
the similarity object which the MDSimilarityResultWriter belongs toprotected boolean
verbose modeprotected boolean
indicates if the result writer is able to output molecular structures -
Constructor Summary
ModifierConstructorDescriptionprotected
Creates aMDSimilarityResultWriter
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes output.protected void
count()
Increments the counter of the results processed.protected void
createLabels
(MDSet cds) Creates labels.getQueryName
(int queryIndex) Gets the name of the specified query.void
open
(MDSimilarity similarity) Initializes the object.void
Sets the molecular structure to be written into the output stream.void
setQueryName
(int queryIndex, String queryName) Sets the name of the specified query compound.void
setVerboseFrequency
(int verboseFreq) Specifies how frequently the status report is printed.void
setVerbosity
(boolean verbose) Sets or clears verbose mode.protected void
verboseMsg
(String msg) Prints the given message if verbosity is on.abstract void
Processes results of the similarity search.boolean
Gets if the object is a sort that printsMolecule
s or not.
-
Field Details
-
similarity
the similarity object which the MDSimilarityResultWriter belongs to -
output
the output stream where results are written to -
queryNames
-
verbose
protected boolean verboseverbose mode -
writesMolecules
protected boolean writesMoleculesindicates if the result writer is able to output molecular structures -
mol
the molecular structure -
labels
labels are either SDfile tagnames or table column headers depending on outut
-
-
Constructor Details
-
MDSimilarityResultWriter
protected MDSimilarityResultWriter()Creates aMDSimilarityResultWriter
object.
-
-
Method Details
-
setVerbosity
public void setVerbosity(boolean verbose) Sets or clears verbose mode.- Parameters:
verbose
- indicates if status report messages are printed or not
-
setVerboseFrequency
public void setVerboseFrequency(int verboseFreq) Specifies how frequently the status report is printed.- Parameters:
verboseFreq
- after eachverboseFreq
line processed, a status report is printed
-
setQueryName
Sets the name of the specified query compound. This name is printed as label to mark the query molecule in ouputs (for instance in table headers).- Parameters:
queryIndex
- index of the query moleculequeryName
- name of the query molecule
-
writesMolecules
public boolean writesMolecules()Gets if the object is a sort that printsMolecule
s or not.- Returns:
- true if the writer prints
Molecule
s
-
getQueryName
Gets the name of the specified query.- Parameters:
queryIndex
- index of the query molecule in interest- Returns:
- name of the query molecule
-
open
Initializes the object. This can be used in derived classes to open output files, write headers etc.- Parameters:
similarity
- object performing the similarity comparisons
-
setMolecule
Sets the molecular structure to be written into the output stream. Calling this function will not change the output.- Parameters:
m
- the molecular structure to be written into the SDfile- Throws:
RuntimeException
- if writer is not capable of writing molecules into its output
-
write
Processes results of the similarity search. Writes into a table, file, calculates statistics, performs further processing of filtered descriptors etc. depending on the sub-class.- Parameters:
descr
- descriptor processed by theMDSimilarity
objectpassed
- flag telling whether the descriptor is filetered out or not
-
close
public void close()Closes output. This can be overriden when footer lines have to be written too. -
count
protected void count()Increments the counter of the results processed. If the verbosity frequency limit is reached, a predefined status line is written. -
verboseMsg
Prints the given message if verbosity is on.- Parameters:
msg
- arbitrary message to be printed
-
createLabels
Creates labels. A label consists of three part: the name of the query molecule, the name of the descriptor, the name of the metric applied. These three fields are joined with an underscore character.- Parameters:
cds
- a sampleMDSet
to provide descriptor types
-