chemaxon.reaction
Class ExhaustiveFragmenter

java.lang.Object
  extended by chemaxon.reaction.Fragmenter
      extended by chemaxon.reaction.ExhaustiveFragmenter
All Implemented Interfaces:
chemaxon.license.Licensable

public class ExhaustiveFragmenter
extends Fragmenter

Molecule fragmenter: exhaustive algorithm. Returns all possible fragment sets.

An example usage of the API:

 // create fragmenter with configuration file "fragment.xml"
 ExhaustiveFragmenter fragmenter = new ExhaustiveFragmenter(new File("fragment.xml"));

 // load the input molecule from "fragment.mol"
 MolImporter importer = new MolImporter("fragment.mol");
 Molecule mol = importer.read();
 importer.close();

 // fragment the input molecule, collect fragments in a Vector
 Vector fragments = new Vector();
 fragmenter.fragment(fragments, mol);

 // write the fragments in SDF format to "fragment.sdf"
 OutputStream os = new BufferedOutputStream(new FileOutputStream("fragment.sdf"));
 MolExporter exporter = new MolExporter(os, "sdf");
 int size = fragments.size();
 for (int i=0; i < size; ++i) {
     Molecule frag = (Molecule) fragments.get(i);
     exporter.write(frag);
 }
 exporter.close();
 

Since:
JChem 2.0
Author:
Nora Mate

Field Summary
 
Fields inherited from class chemaxon.reaction.Fragmenter
cbs, classifier, licenseEnvironment, maxfragmentcount, reviser
 
Constructor Summary
ExhaustiveFragmenter(java.io.File file)
          Constructor with reviser.
ExhaustiveFragmenter(java.io.InputStream is)
          Constructor with reviser.
ExhaustiveFragmenter(RxnMolecule[] reactions, Standardizer standardizer)
          Constructor with no reviser (accepts all cut-bonds).
ExhaustiveFragmenter(RxnMolecule[] reactions, Standardizer standardizer, CutBondReviser reviser)
          Constructor.
ExhaustiveFragmenter(java.lang.String xmlstr)
          Constructor with reviser.
 
Method Summary
 void create(java.util.List coll)
          Creates the molecule fragments by removing the previously found cut-bonds and fragmenting the input molecule.
protected  void find()
          Finds all possible cut-bond sets.
 void setExtensive(boolean extensive)
          Sets the 'extensive' property: true if extendable cut sets should be included.
 void setFragmentSetsTag(java.lang.String fragmentsetsTag)
          Sets the SDF tag name storing the fragment set indices.
 void setMaxSetCount(int maxsetcount)
          Sets the maximum number of fragment sets per molecule.
protected  void setTags(Molecule frag)
          Increases the fragment count tag, sets the fragment set tag.
 
Methods inherited from class chemaxon.reaction.Fragmenter
clearCutBond, clearCutBonds, collect, collect, find, fragment, getClassifier, getCutBond, getData, init, isCutBond, isLicensed, main, setCountTag, setCutBond, setCutBond, setLicenseEnvironment, setMaxFragmentCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExhaustiveFragmenter

public ExhaustiveFragmenter(java.io.File file)
                     throws chemaxon.sss.search.SearchException
Constructor with reviser. Sets cleavage reactions from XML configuration.

Parameters:
file - is the configuration XML file
Throws:
chemaxon.sss.search.SearchException - if reaction check fails (e.g. inconsistent atom maps or multiple reactants)

ExhaustiveFragmenter

public ExhaustiveFragmenter(java.lang.String xmlstr)
                     throws chemaxon.sss.search.SearchException
Constructor with reviser. Sets cleavage reactions from XML configuration.

Parameters:
xmlstr - is the configuration XML string
Throws:
chemaxon.sss.search.SearchException - if reaction check fails (e.g. inconsistent atom maps or multiple reactants)

ExhaustiveFragmenter

public ExhaustiveFragmenter(java.io.InputStream is)
                     throws chemaxon.sss.search.SearchException
Constructor with reviser. Sets cleavage reactions from XML configuration.

Parameters:
is - is the configuration XML input stream
Throws:
chemaxon.sss.search.SearchException - if reaction check fails (e.g. inconsistent atom maps or multiple reactants)

ExhaustiveFragmenter

public ExhaustiveFragmenter(RxnMolecule[] reactions,
                            Standardizer standardizer)
                     throws chemaxon.sss.search.SearchException
Constructor with no reviser (accepts all cut-bonds). Sets the CutBondSearch objects according to the given reactions. Allocates arrays with default sizes.

Parameters:
reactions - is the reaction molecule array
standardizer - is the standardizer object
Throws:
chemaxon.sss.search.SearchException - if reaction check fails (e.g. inconsistent atom maps or multiple reactants)

ExhaustiveFragmenter

public ExhaustiveFragmenter(RxnMolecule[] reactions,
                            Standardizer standardizer,
                            CutBondReviser reviser)
                     throws chemaxon.sss.search.SearchException
Constructor. Sets the CutBondSearch objects according to the given reactions. Sets the CutBondReviser object. Allocates arrays with default sizes.

Parameters:
reactions - is the reaction molecule array
standardizer - is the standardizer object
reviser - is the cut-bond reviser object
Throws:
chemaxon.sss.search.SearchException - if reaction check fails (e.g. inconsistent atom maps or multiple reactants)
Method Detail

setFragmentSetsTag

public void setFragmentSetsTag(java.lang.String fragmentsetsTag)
Sets the SDF tag name storing the fragment set indices.

Parameters:
fragmentsetsTag - is the SDF tag name storing the fragment set indices

setMaxSetCount

public void setMaxSetCount(int maxsetcount)
Sets the maximum number of fragment sets per molecule.

Parameters:
maxsetcount - is the maximum number of fragment sets per molecule

setExtensive

public void setExtensive(boolean extensive)
Sets the 'extensive' property: true if extendable cut sets should be included. Default: false.

Parameters:
extensive - is true if extendable cut sets should be included

find

protected void find()
             throws chemaxon.sss.search.SearchException
Finds all possible cut-bond sets.

Specified by:
find in class Fragmenter
Throws:
chemaxon.sss.search.SearchException - on search error

create

public void create(java.util.List coll)
Creates the molecule fragments by removing the previously found cut-bonds and fragmenting the input molecule. Call Fragmenter.find(Molecule) beforehand to set the cut-bonds!

Overrides:
create in class Fragmenter
Parameters:
coll - is the list which the fragments will be added to

setTags

protected void setTags(Molecule frag)
Increases the fragment count tag, sets the fragment set tag.

Overrides:
setTags in class Fragmenter
Parameters:
frag - is the fragment