@PublicAPI public abstract class MDSimilarityResultWriter extends java.lang.Object
MDSimilarity
.Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
labels
labels are either SDfile tagnames or table column headers depending on
outut
|
protected Molecule |
mol
the molecular structure
|
protected java.io.PrintStream |
output
the output stream where results are written to
|
protected java.util.List<java.lang.String> |
queryNames |
protected MDSimilarity |
similarity
the similarity object which the MDSimilarityResultWriter belongs to
|
protected boolean |
verbose
verbose mode
|
protected boolean |
writesMolecules
indicates if the result writer is able to output molecular structures
|
Constructor and Description |
---|
MDSimilarityResultWriter()
Creates a
MDSimilarityResultWriter object. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes output.
|
protected void |
count()
Increments the counter of the results processed.
|
protected void |
createLabels(MDSet cds)
Creates labels.
|
java.lang.String |
getQueryName(int queryIndex)
Gets the name of the specified query.
|
void |
open(MDSimilarity similarity)
Initializes the object.
|
void |
setMolecule(Molecule m)
Sets the molecular structure to be written into the output stream.
|
void |
setQueryName(int queryIndex,
java.lang.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(java.lang.String msg)
Prints the given message if verbosity is on.
|
abstract void |
write(MDSet descr,
boolean passed)
Processes results of the similarity search.
|
boolean |
writesMolecules()
Gets if the object is a sort that prints
Molecule s or not. |
protected MDSimilarity similarity
protected java.io.PrintStream output
protected java.util.List<java.lang.String> queryNames
protected boolean verbose
protected boolean writesMolecules
protected Molecule mol
protected java.util.List<java.lang.String> labels
public MDSimilarityResultWriter()
MDSimilarityResultWriter
object.public void setVerbosity(boolean verbose)
verbose
- indicates if status report messages are printed or notpublic void setVerboseFrequency(int verboseFreq)
verboseFreq
- after each verboseFreq
line processed,
a status report is printedpublic void setQueryName(int queryIndex, java.lang.String queryName)
queryIndex
- index of the query moleculequeryName
- name of the query moleculepublic boolean writesMolecules()
Molecule
s or not.Molecule
spublic java.lang.String getQueryName(int queryIndex)
queryIndex
- index of the query molecule in interestpublic void open(MDSimilarity similarity)
similarity
- object performing the similarity comparisonspublic void setMolecule(Molecule m) throws java.lang.RuntimeException
m
- the molecular structure to be written into the SDfilejava.lang.RuntimeException
- if writer is not capable of writing
molecules into its outputpublic abstract void write(MDSet descr, boolean passed)
descr
- descriptor processed by the MDSimilarity
objectpassed
- flag telling whether the descriptor is filetered out or notpublic void close()
protected void count()
protected void verboseMsg(java.lang.String msg)
msg
- arbitrary message to be printedprotected void createLabels(MDSet cds)
cds
- a sample MDSet
to provide descriptor types