public class Substructure extends BaseMapping
org.openscience.cdk.smsd.algorithm.vflib.substructure
class as it only
reports first match and backtracks.
This class should only be used to report if a query graph is a substructure
of the target graph.
An example for Substructure search:
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer query = sp.parseSmiles("CC"); IAtomContainer target = sp.parseSmiles("C1CCC12CCCC2"); Substructure smsd = new Substructure(query, target, true, false, true, true); Assert.assertTrue(smsd.isSubgraph()); Assert.assertEquals(18, smsd.getAllAtomMapping().size()); IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query); smsd = new Substructure(queryContainer, target, true); Assert.assertTrue(smsd.isSubgraph());
Constructor and Description |
---|
Substructure(org.openscience.cdk.interfaces.IAtomContainer query,
org.openscience.cdk.interfaces.IAtomContainer target,
boolean shouldMatchBonds,
boolean matchRings,
boolean matchAtomType,
boolean findAllSubgraph)
Constructor for VF Substructure Algorithm
|
Substructure(org.openscience.cdk.isomorphism.matchers.IQueryAtomContainer query,
org.openscience.cdk.interfaces.IAtomContainer target,
boolean findAllSubgraph)
Constructor for VF Substructure Algorithm
|
clearMaps, getAllAtomMapping, getAllBondMaps, getEnergyScore, getEuclideanDistance, getFirstAtomMapping, getFragmentSize, getMappingCount, getStereoScore, getTanimotoSimilarity, isMatchAtomType, isMatchBonds, isMatchRings, isStereoMisMatch, isSubgraph, makeBondMapsOfAtomMaps, setChemFilters
getMCSList, getSortedEnergy, getSortedFragment, getStereoMatches, sortResultsByEnergies, sortResultsByFragments, sortResultsByStereoAndBondMatch
getQuery, getTarget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public Substructure(org.openscience.cdk.interfaces.IAtomContainer query, org.openscience.cdk.interfaces.IAtomContainer target, boolean shouldMatchBonds, boolean matchRings, boolean matchAtomType, boolean findAllSubgraph) throws org.openscience.cdk.exception.CDKException
query
- target
- shouldMatchBonds
- Match bond types (i.e. double to double etc)matchRings
- Match ring atoms and ring sizefindAllSubgraph
- report all subgraphsmatchAtomType
- org.openscience.cdk.exception.CDKException
public Substructure(org.openscience.cdk.isomorphism.matchers.IQueryAtomContainer query, org.openscience.cdk.interfaces.IAtomContainer target, boolean findAllSubgraph) throws org.openscience.cdk.exception.CDKException
query
- target
- findAllSubgraph
- report all subgraphsorg.openscience.cdk.exception.CDKException