Class StructuralFrameworksPlugin

  • All Implemented Interfaces:
    chemaxon.license.Licensable

    @PublicAPI
    public class StructuralFrameworksPlugin
    extends CalculatorPlugin
    Plugin class to calculate Bemis-Murcko and other structural scaffolds of input molecules. The plugin inside executes a series of atomic (not in chemical sense) operations which are accessible to the user. The configuration which is set either by setParameters( Properties ) or by the individual setters. The operation chain is set up according to the actual configuration by getHost( boolean ).

    API usage example:

        // read input molecule
        MolImporter mi = new MolImporter("test.mol");
        Molecule mol = mi.read();
        mi.close();
    
        // create plugin
        StructuralFrameworksPlugin plugin = new StructuralFrameworksPlugin();
    
        // set framework type
        plugin.setType(StructuralFrameworksPlugin.FrameworkTypes.bemismurcko );
    
        // process only the largest fragment
        plugin.setLfin( true );
    
        // set target molecule
        plugin.setMolecule(mol);
    
        // run the calculation
        plugin.run();
    
        // get result
        Molecule result = plugin.getResultMolecule()
    
        // print result
        System.out.println("Bemis-Murcko framework in SMILES format: "+result.toFormat("smiles") );
     
    • Constructor Detail

      • StructuralFrameworksPlugin

        public StructuralFrameworksPlugin()
    • Method Detail

      • setVerbosePrinter

        public void setVerbosePrinter​(StructuralFrameworksPlugin.VerbosePrinter verb)
        Set or clear verbose printer Verbose messages will be sent to the verbose printer to ease debugging
        Parameters:
        verb - Verbose printer. Use null to clear verbose.
      • checkMolecule

        public void checkMolecule​(Molecule mol)
                           throws PluginException
        Checks the input molecule. Throws exception if the molecule is not accepted as input molecule, otherwise does nothing (simply returns). In addition to the default implementation (which refuses query molecules, molecules with SRU S-groups, molecules with multicenter S-groups and molecules with coordinate bonds) this method will check if Frameworks can be executed on the structure.

        Currently the following cases (in addition to the default behavior) fail:

        • mcs Framework calculation needs at least two disconnected fragments. If the molecule contains no atoms or consists of one connected fragment exception is thrown.
        Overrides:
        checkMolecule in class CalculatorPlugin
        Parameters:
        mol - is the input molecule
        Throws:
        PluginException - with error message for the user if the molecule is refused
      • canRepeat

        public boolean canRepeat()
        Description copied from class: CalculatorPlugin
        Returns true if repeatedly running the same plugin object while getting the results on the GUI is allowed, false otherwise. For internal use.
        Overrides:
        canRepeat in class CalculatorPlugin
        Returns:
        true if allowed, false otherwise
      • standardize

        public void standardize​(Molecule mol)
        Standardize input molecule
        Standardization currently ungroups SGroups
        Overrides:
        standardize in class CalculatorPlugin
        Parameters:
        mol - Input molecule to standardize
      • setKeepSingleAtom

        public void setKeepSingleAtom​(boolean b)
        Set behavior on acyclic input
        Parameters:
        b - If set true then a single atom will be assigned to acyclic fragments. If false then acyclic fragments will be projected to empty structures
      • setLfin

        public void setLfin​(boolean b)
        Set handling option for multi fragment (disconnected) inputs
        Parameters:
        b - If set true then the calculation will run only on the largest input fragment. Note that this necessarily yields the largest scaffold
      • setLfout

        public void setLfout​(boolean b)
        Set handling option for multi fragment (disconnected) results. Note that disconnected result can be caused by disconnected input or by further modifications of the scaffold generation algorithm
        Parameters:
        b - If set true then only the largest calculated scaffold will be returned. Note that the returned scaffold not necessarily calculated from the largest fragment.
      • setPruneIn

        public void setPruneIn​(boolean b)
        Set prunein parameter
        Parameters:
        b - If true then input will be generalizes
      • setPruneOut

        public void setPruneOut​(boolean b)
        Set pruneout parameter
        Parameters:
        b - If true then result will be generalized
      • setHydrogenize

        public void setHydrogenize​(boolean b)
        Set hydrogenize parameter
        Parameters:
        b - If true then input will be hydrogenized
      • setDehydrogenize

        public void setDehydrogenize​(boolean b)
        Set dehydrogenize parameter
        Parameters:
        b - If true then explicit hydrogens will be removed from the input
      • setOeqcheck

        public void setOeqcheck​(boolean b)
        Set oeqcheck parameter
        Parameters:
        b - If true then eqivalent result fragments will be filtered
      • setParameters

        public void setParameters​(Properties params)
                           throws PluginException
        Sets the input parameters for the plugin Accepted parameters:
        • type: [bmf|mcs|sssr|cssr|allringsystems|largestringsystem| largestring|keep] Framework calculation type
          • bmf: Bemis-Murcko framework
          • bmfl: Bemis-Murcko loose framework
          • mcs: Pairwise Maximum Common Substructure
          • sssr: SSSR
          • cssr: CSSR
          • allringsystems: all fused ring systems
          • largestringsystem: largest fused ring system
          • largestring: largest ring
          • keep: no framework reduction; useful for testing pre/post process
        • keepsingleatom: [true|false] If set true then a single atom will be assigned to acyclic fragments. If false then acyclic fragments will be projected to empty structures
        • lfin: [true|false] If set true then the calculation will run only on the largest input fragment. Note that this necessarily yields the largest scaffold
        • lfout: [true|false] If set true then only the largest calculated scaffold will be returned. Note that the returned scaffold not necessarily calculated from the largest fragment.
        • prunein: [true|false] Generalize input
        • pruneout: [true|false] Generalize output
        • hydrogenize: [true|false] Add explicit hydrogens
        • dehydrogenize: [true|false] Remove explicit hydrogens
        • oeqcheck: [true|false] Remove equivalent output fragments
        • format: format to use for string export
        Overrides:
        setParameters in class CalculatorPlugin
        Parameters:
        params - parameter table
        Throws:
        PluginException
      • getTypeString

        public String getTypeString​(Object type)
        Returns a string representation of the given type.
        Overrides:
        getTypeString in class CalculatorPlugin
        Parameters:
        type - is the type object
        Returns:
        the type string