Class MDSimilarityResultWriter

java.lang.Object
chemaxon.descriptors.MDSimilarityResultWriter

@PublicAPI public abstract class MDSimilarityResultWriter extends Object
Base class for prointing results produced by MDSimilarity.
Since:
JChem 2.0
  • Field Details

    • similarity

      protected MDSimilarity similarity
      the similarity object which the MDSimilarityResultWriter belongs to
    • output

      protected PrintStream output
      the output stream where results are written to
    • queryNames

      protected List<String> queryNames
    • verbose

      protected boolean verbose
      verbose mode
    • writesMolecules

      protected boolean writesMolecules
      indicates if the result writer is able to output molecular structures
    • mol

      protected Molecule mol
      the molecular structure
    • labels

      protected List<String> labels
      labels are either SDfile tagnames or table column headers depending on outut
  • Constructor Details

    • MDSimilarityResultWriter

      protected MDSimilarityResultWriter()
      Creates a MDSimilarityResultWriter 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 each verboseFreq line processed, a status report is printed
    • setQueryName

      public void setQueryName(int queryIndex, String queryName)
      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 molecule
      queryName - name of the query molecule
    • writesMolecules

      public boolean writesMolecules()
      Gets if the object is a sort that prints Molecules or not.
      Returns:
      true if the writer prints Molecules
    • getQueryName

      public String getQueryName(int queryIndex)
      Gets the name of the specified query.
      Parameters:
      queryIndex - index of the query molecule in interest
      Returns:
      name of the query molecule
    • open

      public void open(MDSimilarity similarity)
      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

      public void setMolecule(Molecule m) throws RuntimeException
      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

      public abstract void write(MDSet descr, boolean passed)
      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 the MDSimilarity object
      passed - 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

      protected void verboseMsg(String msg)
      Prints the given message if verbosity is on.
      Parameters:
      msg - arbitrary message to be printed
    • createLabels

      protected void createLabels(MDSet cds)
      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 sample MDSet to provide descriptor types