Class RFParameters

java.lang.Object
chemaxon.descriptors.MDParameters
chemaxon.descriptors.RFParameters

@PublicAPI public class RFParameters extends MDParameters
Manages reaction fingerprint parameters. This class reads, stores and provides parameters for ReactionFingerprint class. These parameters together are called the reaction fingerprint configuration. The native format of such configuration is XML.
Since:
JChem 3.2
  • Field Details

  • Constructor Details

    • RFParameters

      public RFParameters()
      Creates an empty object. Initializes parameters to default values.
    • RFParameters

      public RFParameters(File configFile) throws MDParametersException
      Creates a new object based on a given configuration file.
      Parameters:
      configFile - XML configuration file
      Throws:
      MDParametersException - missing or bad XML configuration
    • RFParameters

      public RFParameters(String XMLconfig) throws MDParametersException
      Creates a new object based on a given configuration string.
      Parameters:
      XMLconfig - XML configuration string
      Throws:
      MDParametersException - missing or bad XML configuration
  • Method Details

    • fromString

      public void fromString(String parameterString) throws MDParametersException
      Sets parameters from a string representation. This method processes an XML format, but derived classes may overload this and define their own format.
      Overrides:
      fromString in class MDParameters
      Parameters:
      parameterString - parameters in string
      Throws:
      MDParametersException - when the parameter string is not well-formed
    • fromFile

      public void fromFile(File parameterFile) throws MDParametersException
      Sets parameters from an XML file. Derived classes may overload this and define their own format (even other than XML).
      Overrides:
      fromFile in class MDParameters
      Parameters:
      parameterFile - initialized parameter file
      Throws:
      MDParametersException - failed to process parameter file
    • setLength

      public void setLength(int length) throws MDParametersException
      Sets the length (number of bits) of the reaction fingerprint.
      Overrides:
      setLength in class MDParameters
      Parameters:
      length - number of bits
      Throws:
      MDParametersException - if argument is not multiple of 32
    • setBondCount

      public void setBondCount(int bondCount)
      Sets the path length (number of adjacent bonds) parameter.
      Parameters:
      bondCount - the bond count parameter
    • setBitCount

      public void setBitCount(int bitCount)
      Sets the bit count (number of fingerprint bits to be set to 1) parameter.
      Parameters:
      bitCount - the bit count parameter
    • initGenerator

      protected void initGenerator() throws MDParametersException
      Initializes the reaction fingerprint generator.
      Throws:
      MDParametersException
    • init

      protected void init()
      This method is called by the constructors before processing the XML configuration. It creates a ReactionFingerprint object stored in MDParameters.md.
    • initParameters

      protected void initParameters()
      Initializes those data members that depend on the XML configuration but are not directly taken from it.
      Overrides:
      initParameters in class MDParameters
    • generate

      protected String[] generate(Molecule m, MolecularDescriptor md) throws MDGeneratorException
      Calls RFGenerator and generates the descriptor for the given molecule.
      Parameters:
      m - a molecular structure
      md - the molecular descriptor generated for the given molecule, an output parameter
      Returns:
      names of Molecule Property-s (SDfile tags) set by the generator
      Throws:
      MDGeneratorException - when failed to generate descriptor
    • getBondCount

      public int getBondCount()
      Gets the preset path length (number of adjacent bonds) parameter.
      Returns:
      the bond count parameter
    • getBitCount

      public int getBitCount()
      Gets the preset bit count (number of fingerprint bits to be set to 1) parameter.
      Returns:
      the bit count parameter
    • getNumberOfWeights

      protected int getNumberOfWeights(int parametrizedMetricIndex) throws IllegalArgumentException
      Gets the number of weight factors used by the specified metric. This method can be applied to the dissimilarity metrics provided by the MolecularDescriptor class or its derived classes, but not to parametrized metric.
      Overrides:
      getNumberOfWeights in class MDParameters
      Parameters:
      parametrizedMetricIndex - parametrized metric index
      Returns:
      number of weights the metric uses
      Throws:
      IllegalArgumentException - if the given parameter is not a valid metric index
    • getDefaultDocumentFrame

      public String getDefaultDocumentFrame()
      Get the default XML configuration string. This is needed when the optional ReactionFingerprint XML configuration is not specified.
      Overrides:
      getDefaultDocumentFrame in class MDParameters
      Returns:
      default XML configuration string of the RFParameters class
    • processDocument

      protected void processDocument(boolean all) throws MDParametersException
      Processes pars of the XML configuration specific to ReactionFingerprint. Find the node in the DOM tree and leaves the rest of the work to the parent class.
      Overrides:
      processDocument in class MDParameters
      Parameters:
      all - indicates if the entire document has to be processed in which case the existing configuration is overwritten
      Throws:
      MDParametersException
    • readValues

      protected void readValues(boolean all) throws MDParametersException
      Picks parameters values from the DOM tree.
      Overrides:
      readValues in class MDParameters
      Parameters:
      all - indicates if the entire document has to be processed in which case the existing configuration is overwritten
      Throws:
      MDParametersException
    • setEnableStandardization

      public void setEnableStandardization(boolean useStandardization)
      Sets if standardization is applied. As default it is. Disable it in case the standardization/aromatization is already done beforehand.
    • getEnableStandardization

      public boolean getEnableStandardization()
      Shows if standardization should be applied of not. See setEnableStandardization(boolean).