Class SmartsAtomQuerifier

java.lang.Object
chemaxon.marvin.io.formats.smiles.SmartsAtomQuerifier
All Implemented Interfaces:
chemaxon.marvin.modules.smarts.SmartsAtomTreeParserTreeConstants

@PublicAPI public class SmartsAtomQuerifier extends Object implements chemaxon.marvin.modules.smarts.SmartsAtomTreeParserTreeConstants
Class for partial interpretation of smarts atoms.

In MolAtom, queryString may contain a smarts query expression. This class parses the expression and decorates the MolAtom with those query properties and other features which can be put on the atom itself.

Since:
Marvin 3.4
  • Field Summary

    Fields inherited from interface chemaxon.marvin.modules.smarts.SmartsAtomTreeParserTreeConstants

    JJTANDEXPRESSION, JJTATOMSYMBOL, JJTCHIRAL, JJTEXPRESSIONLIST, JJTMAP, jjtNodeName, JJTNOT, JJTOREXPRESSION, JJTQUERY, JJTRECURSIVE, JJTVOID
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new SmartsAtomQuerifier object.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Tests whether it is a SMARTS query atom.
    static boolean
    Tests whether it is a SMARTS query atom.
    boolean
    Marvin compatibility mode.
    void
    setMarvinCompMode(boolean marvinCompMode)
    Marvin compatibility mode.
    static void
    Assigns the query properties string to this atom while setting all necessary atom and query properties.
    static void
    setQuerystr(MolAtom atom, String s, int options)
    Assigns the query properties string to this atom while setting all necessary atom and query properties.
    static void
    Sets SMARTS query string data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SmartsAtomQuerifier

      public SmartsAtomQuerifier()
      Creates a new SmartsAtomQuerifier object.
  • Method Details

    • isMarvinCompMode

      public boolean isMarvinCompMode()
      Marvin compatibility mode. If true(default), parsing corresponds marvin versions before 3.5: [!H!#6] is imported as heteroatom and [!H!#7!#8] as atom list. Otherwise, H means H count 1.
      Returns:
      the above marvin compatibility mode.
    • hasSMARTSPropsExcluding

      public static boolean hasSMARTSPropsExcluding(MolAtom atom, String exclude)
      Tests whether it is a SMARTS query atom.
      Parameters:
      exclude - list of SMARTS properties to exclude
      Returns:
      true if it has SMARTS properties, false otherwise
      Since:
      Marvin 3.1.2
    • hasSMARTSProps

      public static boolean hasSMARTSProps(MolAtom atom)
      Tests whether it is a SMARTS query atom.
      Returns:
      true if it has SMARTS properties, false otherwise
    • setSMARTS

      public static void setSMARTS(MolAtom atom, String s) throws SecurityException
      Sets SMARTS query string data.
      Parameters:
      s - the SMARTS string
      Throws:
      SecurityException - the SmilesImport cannot be loaded, possibly because of a misconfigured firewall
    • setMarvinCompMode

      public void setMarvinCompMode(boolean marvinCompMode)
      Marvin compatibility mode. If true(default), parsing corresponds marvin versions before 3.5: [!H!#6] is imported as heteroatom and [!H!#7!#8] as atom list. Otherwise, H means H count 1.
      Parameters:
      marvinCompMode - marvin compatibility mode to set.
    • setQuerystr

      public static void setQuerystr(MolAtom atom, String s, int options)
      Assigns the query properties string to this atom while setting all necessary atom and query properties. This is done through SmartsAtomQuerifier which parses the query string. For this reason this operation may be relatively costly. The remaining part of the query string (which could not be represented/assigned) is set to queryStr.

      In daylight smarts H is only considered as H atom when the atom expression has the syntax [<mass>H<charge><map>] (mass, charge and map are optional). If options is SMARTS_H_MARVIN_COMP_MODE and "H" is not in the form [<mass>H<charge><map>] then it may be interpreted as Hydrogen atom, not total H count! It is neccesary for backward compatibility.

      Parameters:
      s - the query string
      options - Possible values: SMARTS_H_MARVIN_COMP_MODE or SMARTS_H_DAYLIGHT_COMP_MODE. Instead of using this option, we recommend using unambiguous smarts queries: #1 for H atom and H1 for H count 1.
      Since:
      Marvin 3.5
      See Also:
    • setQuerystr

      public static void setQuerystr(MolAtom atom, String s)
      Assigns the query properties string to this atom while setting all necessary atom and query properties. This is done through SmartsAtomQuerifier which parses the query string. For this reason this operation may be relatively costly. The remaining part of the query string (which could not be represented/assigned) is set to queryStr.
      Parameters:
      s - the query string