Class NameToStructureConfig

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class NameToStructureConfig
    extends java.lang.Object
    implements java.lang.Cloneable
    Allows OPSIN to be configured e.g. enable processing of radicals Example usage: NameToStructureConfig n2sConfig = new NameToStructureConfig(); n2sconfig.setAllowRadicals(true); nts.parseChemicalName(chemicalName, n2sConfig) where nts is an instance of NameToStructure
    Author:
    dl387
    • Constructor Summary

      Constructors 
      Constructor Description
      NameToStructureConfig()
      Constructs a NameToStructureConfig with default settings: allowRadicals = false outputRadicalsAsWildCardAtoms = false detailedFailureAnalysis = false interpretAcidsWithoutTheWordAcid = false warnRatherThanFailOnUninterpretableStereochemistry = false
    • Constructor Detail

      • NameToStructureConfig

        public NameToStructureConfig()
        Constructs a NameToStructureConfig with default settings: allowRadicals = false outputRadicalsAsWildCardAtoms = false detailedFailureAnalysis = false interpretAcidsWithoutTheWordAcid = false warnRatherThanFailOnUninterpretableStereochemistry = false
    • Method Detail

      • isAllowRadicals

        public boolean isAllowRadicals()
        Are radicals allowed? e.g. should fragments such as phenyl be interpretable
        Returns:
        whether radicals are allowed
      • setAllowRadicals

        public void setAllowRadicals​(boolean allowRadicals)
        Sets whether radicals allowed? e.g. should fragments such as phenyl be interpretable
      • isOutputRadicalsAsWildCardAtoms

        public boolean isOutputRadicalsAsWildCardAtoms()
        Are radicals output as wildcard atoms e.g. [*]CC for ethyl
        Returns:
        whether radicals are output using explicit wildcard atoms
      • setOutputRadicalsAsWildCardAtoms

        public void setOutputRadicalsAsWildCardAtoms​(boolean outputRadicalsAsWildCardAtoms)
        Should radicals be output as wildcard atoms e.g. [*]CC for ethyl (as opposed to [CH2]C)
        Note that if this is set to true InChIs cannot be generated
        Parameters:
        outputRadicalsAsWildCardAtoms -
      • isDetailedFailureAnalysis

        public boolean isDetailedFailureAnalysis()
        Should OPSIN attempt reverse parsing to more accurately determine why parsing failed
        Returns:
        whether a more precise cause of failure should be determined if parsing fails
      • setDetailedFailureAnalysis

        public void setDetailedFailureAnalysis​(boolean detailedFailureAnalysis)
        Sets whether OPSIN should attempt reverse parsing to more accurately determine why parsing failed
      • allowInterpretationOfAcidsWithoutTheWordAcid

        public boolean allowInterpretationOfAcidsWithoutTheWordAcid()
        Are acids without the word "acid" interpretable e.g. should "acetic" be interpretable
        Returns:
        whether acids without the word "acid" should be interpretable
      • setInterpretAcidsWithoutTheWordAcid

        public void setInterpretAcidsWithoutTheWordAcid​(boolean interpretAcidsWithoutTheWordAcid)
        Sets whether acids without the word "acid" interpretable e.g. should "acetic" be interpretable
        Parameters:
        interpretAcidsWithoutTheWordAcid -
      • warnRatherThanFailOnUninterpretableStereochemistry

        public boolean warnRatherThanFailOnUninterpretableStereochemistry()
        If OPSIN cannot understand the stereochemistry in a name should OPSIN's result be a warning and structure with incomplete stereochemistry, or should failure be returned (Default)
        Returns:
        whether ignored stereochemistry is a warning (rather than a failure)
      • setWarnRatherThanFailOnUninterpretableStereochemistry

        public void setWarnRatherThanFailOnUninterpretableStereochemistry​(boolean warnRatherThanFailOnUninterpretableStereochemistry)
        Sets whether if OPSIN cannot understand the stereochemistry in a name whether OPSIN's result should be a warning and structure with incomplete stereochemistry, or should failure be returned (Default)
        Parameters:
        warnRatherThanFailOnUninterpretableStereochemistry -
      • getDefaultConfigInstance

        public static NameToStructureConfig getDefaultConfigInstance()
        Constructs a NameToStructureConfig with default settings: allowRadicals = false outputRadicalsAsWildCardAtoms = false detailedFailureAnalysis = false interpretAcidsWithoutTheWordAcid = false warnRatherThanFailOnUninterpretableStereochemistry = false