Class McsSearchOptions.Builder

java.lang.Object
com.chemaxon.search.MatchingOptions.Builder
com.chemaxon.search.mcs.McsSearchOptions.Builder
Enclosing class:
McsSearchOptions

public static final class McsSearchOptions.Builder extends MatchingOptions.Builder
Builder class for creating immutable instances of the enclosing McsSearchOptions class.
  • Constructor Details

    • Builder

      public Builder()
      Creates a Builder object with the default settings.
    • Builder

      public Builder(McsSearchOptions opts)
      Creates a Builder object containing the settings of the given search options object. Useful if only a few options need to be changed, compared to an existing search options object.
      Parameters:
      opts - the default values
  • Method Details

    • atomTypeMatching

      public McsSearchOptions.Builder atomTypeMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether atom types should be considered in search. By default, the atom types are checked, i.e., a carbon atom does not match to an oxygen atom.
      Specified by:
      atomTypeMatching in class MatchingOptions.Builder
      Parameters:
      value - specifies whether atom types are checked (true) or ignored (false)
      Returns:
      this builder
    • bondTypeMatching

      public McsSearchOptions.Builder bondTypeMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether bond types should be considered in search. By default, the bond types are checked, i.e., "CC" does not match to "C=C".
      Specified by:
      bondTypeMatching in class MatchingOptions.Builder
      Parameters:
      value - specifies whether bond types are checked (true) or ignored (false)
      Returns:
      this builder
    • chargeMatching

      public McsSearchOptions.Builder chargeMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether formal charges of atoms should be considered in search. By default, charges are ignored.
      Specified by:
      chargeMatching in class MatchingOptions.Builder
      Parameters:
      value - specifies whether charges are checked (true) or ignored (false)
      Returns:
      this builder
    • isotopeMatching

      public McsSearchOptions.Builder isotopeMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether isotopes of atoms should be considered in search. By default, mass numbers are ignored, so isotopes of the same element match each other.

      If atom type matching is disabled, isotopes are also ignored, irrespective of this search option.

      Specified by:
      isotopeMatching in class MatchingOptions.Builder
      Parameters:
      value - specifies whether mass numbers are checked (true) or ignored (false)
      Returns:
      this builder
    • radicalMatching

      public McsSearchOptions.Builder radicalMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether the radical information of atoms should be considered in search. By default, radicals are ignored.
      Specified by:
      radicalMatching in class MatchingOptions.Builder
      Parameters:
      value - specifies whether radicals are checked (true) or ignored (false)
      Returns:
      this builder
    • atomMapMatching

      public McsSearchOptions.Builder atomMapMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether atom map numbers should be considered in search. If set to true, two atoms with different map numbers do not match each other. By default, it is set to false.
      Specified by:
      atomMapMatching in class MatchingOptions.Builder
      Parameters:
      value - specifies whether atom map numbers are checked (true) or ignored (false)
      Returns:
      this builder
    • exactQueryAtomMatching

      public McsSearchOptions.Builder exactQueryAtomMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether generic query atoms should be matched only to atoms of exactly the same type. If set to true, generic atoms are not considered as query features. For example, an "any" atom matches only to another "any" atom. By default, it is set to false.
      Specified by:
      exactQueryAtomMatching in class MatchingOptions.Builder
      Parameters:
      value - true if generic query atoms should match only atoms of exactly the same type
      Returns:
      this builder
    • exactQueryBondMatching

      public McsSearchOptions.Builder exactQueryBondMatching(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether generic query bonds should be matched only to bonds of exactly the same type. If set to true, generic bonds are not considered as query features. For example, an "any" bond matches only to another "any" bond. By default, it is set to false.
      Specified by:
      exactQueryBondMatching in class MatchingOptions.Builder
      Parameters:
      value - true if generic query bonds should match only bonds of exactly the same type
      Returns:
      this builder
    • ringHandlingMode

      public McsSearchOptions.Builder ringHandlingMode(RingHandlingMode value)
      Sets how rings should be handled during the search. See RingHandlingMode for more information.
      Parameters:
      value - ring handling mode (not null)
      Returns:
      this builder
      See Also:
    • maxConsideredRingSize

      public McsSearchOptions.Builder maxConsideredRingSize(int value)
      Sets the maximum size of rings considered for ring matching purposes. The default value is 8. (A ring of 9 or more atoms is considered a macrocycle.)
      Parameters:
      value - the maximum considered ring size
      Returns:
      this builder
      See Also:
    • connectedMode

      public McsSearchOptions.Builder connectedMode(boolean connected)
      Sets whether the common substructures should be connected or they can consist of multiple fragments.
      Parameters:
      connected - specifies if connected common substructures should be found (true) or disconnected substructures are also allowed (false)
      Returns:
      this builder
      See Also:
    • minFragmentSize

      public McsSearchOptions.Builder minFragmentSize(int bondCount)
      Sets the minimum required size of the fragments of MCS. Fragments having less bonds than this limit are ignored, except for one largest fragment found. The default value is 1 (that is, all fragments are kept).
      Parameters:
      bondCount - minimum required bond count in additional fragments (except for the largest one)
      Returns:
      this builder
      See Also:
    • orderSensitive

      public McsSearchOptions.Builder orderSensitive(boolean value)
      Description copied from class: MatchingOptions.Builder
      Sets whether search is sensitive to the order of the matched atoms and bonds when searching for multiple results.

      By default, this option is set to false. It means that two search results are considered to be different only when they cover different atoms or bonds of the query or the target. In contrast, order sensitive search differentiates two results with the same set of mapped atoms and bonds in both molecules if the actual mappings are different.

      For example, if the query molecule is "CNC" and target molecule is "CNCNC", then order sensitive search provides four different mappings of the query to the target, while order insensitive (default) search provides only two of these hits (that cover different parts of the target molecule).

      Warning: Order sensitive search may produce orders of magnitude more hits as it also deals with the internal symmetry of the molecules.

      Specified by:
      orderSensitive in class MatchingOptions.Builder
      Parameters:
      value - true if the search should be order sensitive
      Returns:
      this builder
    • customMatching

      public McsSearchOptions.Builder customMatching(CustomMatcherFactory matcherFactory)
      Description copied from class: MatchingOptions.Builder
      Sets the factory to be used to create a custom matcher. During search, two atom or bonds may be matched only if they are accepted by the corresponding method of the CustomMatcher created by the given factory (in addition to the criteria specified by other search options).
      Specified by:
      customMatching in class MatchingOptions.Builder
      Parameters:
      matcherFactory - the factory for creating the custom matcher to be used
      Returns:
      this builder
    • build

      public McsSearchOptions build()
      Description copied from class: MatchingOptions.Builder
      Creates a search options object with the settings specified by this builder instance.
      Specified by:
      build in class MatchingOptions.Builder
      Returns:
      the search options object