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
FieldsModifier and TypeFieldDescriptionlabels are either SDfile tagnames or table column headers depending on oututprotected Moleculethe molecular structureprotected PrintStreamthe output stream where results are written toprotected MDSimilaritythe similarity object which the MDSimilarityResultWriter belongs toprotected booleanverbose modeprotected booleanindicates if the result writer is able to output molecular structures -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates aMDSimilarityResultWriterobject. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes output.protected voidcount()Increments the counter of the results processed.protected voidcreateLabels(MDSet cds) Creates labels.getQueryName(int queryIndex) Gets the name of the specified query.voidopen(MDSimilarity similarity) Initializes the object.voidSets the molecular structure to be written into the output stream.voidsetQueryName(int queryIndex, String queryName) Sets the name of the specified query compound.voidsetVerboseFrequency(int verboseFreq) Specifies how frequently the status report is printed.voidsetVerbosity(boolean verbose) Sets or clears verbose mode.protected voidverboseMsg(String msg) Prints the given message if verbosity is on.abstract voidProcesses results of the similarity search.booleanGets if the object is a sort that printsMolecules 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 aMDSimilarityResultWriterobject.
-
-
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 eachverboseFreqline 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 printsMolecules or not.- Returns:
- true if the writer prints
Molecules
-
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 theMDSimilarityobjectpassed- 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 sampleMDSetto provide descriptor types
-