$darkmode
DENOPTIM
denoptim.fragmenter.FragmenterTools Class Reference

Static Public Member Functions

static void checkElementalAnalysisAgainstFormula (File input, File output, Logger logger) throws DENOPTIMException, IOException
 Processes all molecules analyzing the composition of the structure in the chemical representation as compared to the molecular formula declared in the DENOPTIMConstants#FORMULASTR property, and extracts those molecules where the declared formula matches the composition of the chemical representation. More...
 
static boolean prepareMolToFragmentation (IAtomContainer mol, FragmenterParameters settings, int index)
 Do any pre-processing on a IAtomContainer meant to be fragmented. More...
 
static void filterStrucutresBySMARTS (File input, Set< String > smarts, File output, Logger logger) throws DENOPTIMException, IOException
 Removes from the structures anyone that matches any of the given SMARTS queries. More...
 
static boolean fragmentation (File input, FragmenterParameters settings, File output, Logger logger) throws CDKException, IOException, DENOPTIMException, IllegalArgumentException, UndetectedFileFormatException
 Performs fragmentation according to the given cutting rules. More...
 
static List< Vertexfragmentation (IAtomContainer mol, List< CuttingRule > rules, Logger logger) throws DENOPTIMException
 Chops one chemical structure by applying the given cutting rules. More...
 
static void manageFragmentCollection (File input, FragmenterParameters settings, File output, Logger logger) throws DENOPTIMException, IOException, IllegalArgumentException, UndetectedFileFormatException
 Management of fragments: includes application of fragment filters, rejection rules, and collection rules (also of isomorphic fragments, thus management of duplicates) to manipulate collection of fragments. More...
 
static void manageFragmentCollection (Vertex frag, int fragCounter, FragmenterParameters settings, List< Vertex > collector, Logger logger) throws DENOPTIMException, IllegalArgumentException, UndetectedFileFormatException, IOException
 Management of fragments: includes application of fragment filters, rejection rules, and collection rules (also of isomorphic fragments, thus management of duplicates) to manipulate collection of fragments. More...
 
static boolean filterFragment (Fragment frag, FragmenterParameters settings)
 Filter fragments according to the criteria defined in the settings. More...
 
static boolean filterFragment (Fragment frag, FragmenterParameters settings, Logger logger)
 Filter fragments according to the criteria defined in the settings. More...
 
static String getMWSlotIdentifier (Vertex frag, int slotSize)
 Determines the name of the MW slot to use when comparing the given fragment with previously stored fragments. More...
 
static Vertex getRCPForAP (AttachmentPoint ap, APClass rcvApClass) throws DENOPTIMException
 

Static Package Functions

static Set< IAtom > exploreHapticity (IAtom seed, IAtom centralAtom, ArrayList< IAtom > candidates, IAtomContainer mol)
 Identifies non-central atoms involved in the same n-hapto ligand as the seed atom. More...
 
static Set< IAtom > exploreConnectivity (IAtom seed, IAtomContainer mol)
 Explores the connectivity annotating which atoms have been visited. More...
 
static Map< String, List< MatchedBond > > getMatchingBondsAllInOne (IAtomContainer mol, List< CuttingRule > rules, Logger logger)
 Identification of the bonds matching a list of SMARTS queries. More...
 

Detailed Description

Definition at line 52 of file FragmenterTools.java.

Member Function Documentation

◆ checkElementalAnalysisAgainstFormula()

static void denoptim.fragmenter.FragmenterTools.checkElementalAnalysisAgainstFormula ( File  input,
File  output,
Logger  logger 
) throws DENOPTIMException, IOException
static

Processes all molecules analyzing the composition of the structure in the chemical representation as compared to the molecular formula declared in the DENOPTIMConstants#FORMULASTR property, and extracts those molecules where the declared formula matches the composition of the chemical representation.

Parameters
inputthe source of chemical structures.
outputthe file where to write extracted structures.
loggera task-dedicated logger where we print messages for the user.
Exceptions
DENOPTIMException
IOException

Definition at line 71 of file FragmenterTools.java.

References denoptim.utils.FormulaUtils.compareFormulaAndElementalAnalysis(), denoptim.constants.DENOPTIMConstants.FORMULASTR, and denoptim.io.DenoptimIO.writeSDFFile().

Referenced by denoptim.fragmenter.FragmenterTask.call().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exploreConnectivity()

static Set< IAtom > denoptim.fragmenter.FragmenterTools.exploreConnectivity ( IAtom  seed,
IAtomContainer  mol 
)
staticpackage

Explores the connectivity annotating which atoms have been visited.

Parameters
seedatom acting as starting point.
molthe atom container that own all the atoms we work with.
Returns
list of atoms that is confirmed to belong the continuously connected system of the seed atom.

Definition at line 660 of file FragmenterTools.java.

Referenced by denoptim.fragmenter.FragmenterTools.fragmentation(), and denoptim.fragmenter.FragmenterToolsTest.testExploreConnectivity().

Here is the caller graph for this function:

◆ exploreHapticity()

static Set< IAtom > denoptim.fragmenter.FragmenterTools.exploreHapticity ( IAtom  seed,
IAtom  centralAtom,
ArrayList< IAtom >  candidates,
IAtomContainer  mol 
)
staticpackage

Identifies non-central atoms involved in the same n-hapto ligand as the seed atom.

Parameters
seedatom acting as starting point.
centralAtomthe central atom (typically the metal) to which the seed is bonded as part of the multihapto system.
candidatesatoms that may belong to the multihapto ligand (i.e., atoms that have matches the cutting rule).
molthe atom container that own all the atoms we work with.
Returns
list of atoms that is confirmed to belong the multihapto system.

Definition at line 620 of file FragmenterTools.java.

Referenced by denoptim.fragmenter.FragmenterTools.fragmentation(), and denoptim.fragmenter.FragmenterToolsTest.testExploreHapticity().

Here is the caller graph for this function:

◆ filterFragment() [1/2]

static boolean denoptim.fragmenter.FragmenterTools.filterFragment ( Fragment  frag,
FragmenterParameters  settings 
)
static

Filter fragments according to the criteria defined in the settings.

Log is sent to logger in the FragmenterParameters argument.

Parameters
fragthe fragment to analyze.
settingscollection of settings including filtering criteria.
Returns
true if the fragment should be kept, or false if any of the filtering criteria is offended and, therefore, the fragment should be rejected.

Definition at line 979 of file FragmenterTools.java.

References denoptim.fragmenter.FragmenterTools.filterFragment(), and denoptim.programs.RunTimeParameters.getLogger().

Referenced by denoptim.fragmenter.FragmenterTools.filterFragment(), denoptim.fragmenter.FragmenterTools.manageFragmentCollection(), and denoptim.fragmenter.FragmenterToolsTest.testFilterFragment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filterFragment() [2/2]

static boolean denoptim.fragmenter.FragmenterTools.filterFragment ( Fragment  frag,
FragmenterParameters  settings,
Logger  logger 
)
static

Filter fragments according to the criteria defined in the settings.

Parameters
fragthe fragment to analyze.
settingscollection of settings including filtering criteria.
loggerwhere to direct log messages. This is typically different from the logger registered in the FragmenterParameters, which is the master logger, as we want thread-specific logging.
Returns
true if the fragment should be kept, or false if any of the filtering criteria is offended and, therefore, the fragment should be rejected.

Definition at line 998 of file FragmenterTools.java.

References denoptim.graph.Fragment.atoms(), denoptim.programs.fragmenter.FragmenterParameters.doRejectWeirdIsotopes, denoptim.constants.DENOPTIMConstants.DUMMYATMSYMBOL, denoptim.graph.Vertex.getAllAPClasses(), denoptim.graph.Fragment.getAttachmentPoints(), denoptim.utils.FormulaUtils.getElementalanalysis(), denoptim.programs.fragmenter.FragmenterParameters.getFragRejectionSMARTS(), denoptim.programs.fragmenter.FragmenterParameters.getFragRetentionSMARTS(), denoptim.graph.Fragment.getIAtomContainer(), denoptim.programs.fragmenter.FragmenterParameters.getMaxFragHeavyAtomCount(), denoptim.utils.ManySMARTSQuery.getMessage(), denoptim.programs.fragmenter.FragmenterParameters.getMinFragHeavyAtomCount(), denoptim.utils.ManySMARTSQuery.getNumMatchesOfQuery(), denoptim.utils.MoleculeUtils.getPoint3d(), denoptim.programs.fragmenter.FragmenterParameters.getRejectedAPClassCombinations(), denoptim.programs.fragmenter.FragmenterParameters.getRejectedAPClasses(), denoptim.programs.fragmenter.FragmenterParameters.getRejectedElements(), denoptim.programs.fragmenter.FragmenterParameters.getRejectedFormulaLessThan(), denoptim.programs.fragmenter.FragmenterParameters.getRejectedFormulaMoreThan(), denoptim.utils.MoleculeUtils.getSymbolOrLabel(), denoptim.utils.ManySMARTSQuery.hasProblems(), denoptim.utils.MoleculeUtils.isElement(), and denoptim.programs.fragmenter.FragmenterParameters.isWorkingIn3D().

Here is the call graph for this function:

◆ filterStrucutresBySMARTS()

static void denoptim.fragmenter.FragmenterTools.filterStrucutresBySMARTS ( File  input,
Set< String >  smarts,
File  output,
Logger  logger 
) throws DENOPTIMException, IOException
static

Removes from the structures anyone that matches any of the given SMARTS queries.

Parameters
inputthe source of chemical structures.
smartsthe queries leading to rejection.
outputthe file where to write extracted structures.
loggera task-dedicated logger where we print messages for the user.
Exceptions
DENOPTIMException
IOException

Definition at line 219 of file FragmenterTools.java.

References denoptim.utils.ManySMARTSQuery.getAllMatches(), denoptim.utils.ManySMARTSQuery.getMessage(), denoptim.utils.ManySMARTSQuery.getProblem(), denoptim.utils.ManySMARTSQuery.hasProblems(), and denoptim.io.DenoptimIO.writeSDFFile().

Referenced by denoptim.fragmenter.FragmenterTask.call().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fragmentation() [1/2]

static boolean denoptim.fragmenter.FragmenterTools.fragmentation ( File  input,
FragmenterParameters  settings,
File  output,
Logger  logger 
) throws CDKException, IOException, DENOPTIMException, IllegalArgumentException, UndetectedFileFormatException
static

Performs fragmentation according to the given cutting rules.

Parameters
inputthe source of chemical structures.
settingsconfigurations including cutting rules and filtration criteria.
outputthe file where to write extracted structures.
loggerwhere to direct log messages. This is typically different from the logger registered in the FragmenterParameters, which is the master logger, as we want thread-specific logging.
Exceptions
DENOPTIMException
IOException
UndetectedFileFormatException
IllegalArgumentException
CDKException
Returns
true if the fragmentation produced at least one fragment that survived post filtering, i.e., the output file does contain something.

Definition at line 312 of file FragmenterTools.java.

References denoptim.io.IteratingAtomContainerReader.close(), denoptim.fragmenter.FragmenterTools.fragmentation(), denoptim.io.IteratingAtomContainerReader.hasNext(), denoptim.fragmenter.FragmenterTools.manageFragmentCollection(), denoptim.io.IteratingAtomContainerReader.next(), denoptim.files.FileFormat.VRTXSDF, and denoptim.io.DenoptimIO.writeVertexesToFile().

Referenced by denoptim.fragmenter.FragmenterTask.call(), denoptim.fragmenter.FragmenterTools.fragmentation(), denoptim.gui.GUIVertexInspector.initialize(), and denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fragmentation() [2/2]

static List< Vertex > denoptim.fragmenter.FragmenterTools.fragmentation ( IAtomContainer  mol,
List< CuttingRule rules,
Logger  logger 
) throws DENOPTIMException
static

◆ getMatchingBondsAllInOne()

static Map< String, List< MatchedBond > > denoptim.fragmenter.FragmenterTools.getMatchingBondsAllInOne ( IAtomContainer  mol,
List< CuttingRule rules,
Logger  logger 
)
staticpackage

Identification of the bonds matching a list of SMARTS queries.

Parameters
molchemical system to be analyzed
rulespriority-sorted list of cutting rules.
logger
Returns
the list of matches.

Definition at line 695 of file FragmenterTools.java.

References denoptim.programs.fragmenter.MatchedBond.satisfiesRuleOptions.

Referenced by denoptim.fragmenter.FragmenterTools.fragmentation(), and denoptim.fragmenter.FragmenterToolsTest.testGetMatchingBonds().

Here is the caller graph for this function:

◆ getMWSlotIdentifier()

static String denoptim.fragmenter.FragmenterTools.getMWSlotIdentifier ( Vertex  frag,
int  slotSize 
)
static

Determines the name of the MW slot to use when comparing the given fragment with previously stored fragments.

Parameters
fragthe fragment for which we want the MW slot identifier.
slotSizethe size of the MW slot.
Returns
the MW slot identifier.

Definition at line 1283 of file FragmenterTools.java.

References denoptim.graph.Vertex.getIAtomContainer().

Referenced by denoptim.fragmenter.ConformerExtractorTask.ConformerExtractorTask(), denoptim.fragmenter.FragmenterTools.manageFragmentCollection(), and denoptim.fragmenter.FragmenterToolsTest.testGetMWSlotIdentifier().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRCPForAP()

static Vertex denoptim.fragmenter.FragmenterTools.getRCPForAP ( AttachmentPoint  ap,
APClass  rcvApClass 
) throws DENOPTIMException
static

Definition at line 1297 of file FragmenterTools.java.

References denoptim.graph.Fragment.addAP(), denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.utils.MoleculeUtils.getPoint3d(), and denoptim.graph.rings.RingClosingAttractor.RCALABELPERAPCLASS.

Referenced by denoptim.ga.EAUtils.appendVertexesToGraphFollowingEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ manageFragmentCollection() [1/2]

static void denoptim.fragmenter.FragmenterTools.manageFragmentCollection ( File  input,
FragmenterParameters  settings,
File  output,
Logger  logger 
) throws DENOPTIMException, IOException, IllegalArgumentException, UndetectedFileFormatException
static

Management of fragments: includes application of fragment filters, rejection rules, and collection rules (also of isomorphic fragments, thus management of duplicates) to manipulate collection of fragments.

Definition at line 766 of file FragmenterTools.java.

References denoptim.fragmenter.FragmenterTools.manageFragmentCollection(), denoptim.graph.Vertex.BBType.UNDEFINED, denoptim.files.FileFormat.VRTXSDF, and denoptim.io.DenoptimIO.writeVertexesToFile().

Referenced by denoptim.fragmenter.FragmenterTask.call(), denoptim.fragmenter.FragmenterTools.fragmentation(), and denoptim.fragmenter.FragmenterTools.manageFragmentCollection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ manageFragmentCollection() [2/2]

static void denoptim.fragmenter.FragmenterTools.manageFragmentCollection ( Vertex  frag,
int  fragCounter,
FragmenterParameters  settings,
List< Vertex collector,
Logger  logger 
) throws DENOPTIMException, IllegalArgumentException, UndetectedFileFormatException, IOException
static

Management of fragments: includes application of fragment filters, rejection rules, and collection rules (also of isomorphic fragments, thus management of duplicates) to manipulate collection of fragments.

Parameters
fragthe fragment to analyze now. This is a fragment that is candidates to enter the collection of fragments.
fragCounterfragment index. Used only for logging purposes.
settingsconfiguration of the filters and methods uses throughout the fragmentation and pre-/post-processing of fragments.
collectorwhere accepted fragments are collected. This is the collection of fragment where we want to put frag.
loggerwhere to direct all log.
Exceptions
DENOPTIMException
IllegalArgumentException
UndetectedFileFormatException
IOException

Definition at line 828 of file FragmenterTools.java.

References denoptim.utils.DummyAtomHandler.addDummiesOnLinearities(), denoptim.fragmenter.FragmenterTools.filterFragment(), denoptim.utils.MoleculeUtils.getDimensions(), denoptim.graph.Fragment.getIAtomContainer(), denoptim.fragmenter.FragmenterTools.getMWSlotIdentifier(), denoptim.graph.Vertex.getProperty(), denoptim.constants.DENOPTIMConstants.ISOMORPHICFAMILYID, denoptim.io.DenoptimIO.readVertexes(), denoptim.graph.Vertex.setProperty(), denoptim.graph.Vertex.BBType.UNDEFINED, denoptim.files.FileFormat.VRTXSDF, and denoptim.io.DenoptimIO.writeVertexToFile().

Here is the call graph for this function:

◆ prepareMolToFragmentation()

static boolean denoptim.fragmenter.FragmenterTools.prepareMolToFragmentation ( IAtomContainer  mol,
FragmenterParameters  settings,
int  index 
)
static

Do any pre-processing on a IAtomContainer meant to be fragmented.

These are DENOPTIM specific manipulations, in particular meant to comply to requirements to write SDF files: unset bond orders can only be used in query-type files. So types 4 and 8 are not expected to be found (but CSD uses them...). Also, it deals with implicit H formalism according to the given settings.

Parameters
molthe system that this method prepares to fragmentation.
settingsthe settings controlling how the molecule is prepared.
indexidentifies the given IAtomContainer in a collection of systems to work on. This is used only for logging.

Definition at line 151 of file FragmenterTools.java.

References denoptim.programs.fragmenter.FragmenterParameters.acceptUnsetToSingeBO(), denoptim.programs.fragmenter.FragmenterParameters.addExplicitH, denoptim.utils.MoleculeUtils.ensureNoUnsetBondOrders(), denoptim.utils.MoleculeUtils.explicitHydrogens(), denoptim.programs.RunTimeParameters.ParametersType.FRG_PARAMS, denoptim.programs.RunTimeParameters.getLogger(), and denoptim.utils.MoleculeUtils.setZeroImplicitHydrogensToAllAtoms().

Referenced by denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule(), and denoptim.fragmenter.ParallelFragmentationAlgorithm.splitInputForThreads().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: