public final class Cycles extends Object
IRing
s. A
brief description of each cycle set is given below - for a more comprehensive
review please see - (Berger, F. et. al.. J. Chem. Inf. Comput. Sci.. 2004. 44).
all()
- all simple cycles in the graph, the number of
cycles generated may be very large and may not be feasible for some
molecules, such as, fullerene.mcb()
(aka. SSSR) - minimum
cycle basis (MCB) of a graph, these cycles are linearly independent and can
be used to generate all of cycles in the graph. It is important to note the
MCB is not unique and a that there may be multiple equally valid MCBs. The
smallest set of smallest rings (SSSR) is often used to refer to the MCB but
originally SSSR was defined as a strictly fundamental cycle basis (Berger, F. et. al.. J. Chem. Inf. Comput. Sci.. 2004. 44). Not every graph has a strictly fundamental cycle basis the
definition has come to mean the MCB. Due to the non-uniqueness of the
MCB/SSSR its use is discouraged.relevant()
- relevant
cycles of a graph, the smallest set of uniquely defined short cycles. If a
graph has a single MCB then the relevant cycles and MCB are the same. If the
graph has multiple MCB then the relevant cycles is the union of all MCBs. The
number of relevant cycles may be exponential but it is possible to determine
how many relevant cycles there are in polynomial time without generating
them. For chemical graphs the number of relevant cycles is usually within
manageable bounds. essential()
- essential cycles of a
graph. Similar to the relevant cycles the set is unique for a graph. If a
graph has a single MCB then the essential cycles and MCB are the same. If the
graph has multiple MCB then the essential cycles is the intersect of all
MCBs. That is the cycles which appear in every MCB. This means that is is
possible to have no essential cycles in a molecule which clearly has cycles
(e.g. bridged system like bicyclo[2.2.2]octane). tripletShort()
- the triple short cycles are the shortest cycle through
each triple of vertices. This allows one to generate the envelope rings of
some molecules (e.g. naphthalene) without generating all cycles. The cycles
are primarily useful for the CACTVS Substructure Keys (PubChem fingerprint).
vertexShort()
- the shortest cycles through each vertex.
Unlike the MCB, linear independence is not checked and it may not be possible
to generate all other cycles from this set. In practice the vertex/edge short
cycles are similar to MCB. edgeShort()
- the shortest
cycles through each edge. Unlike the MCB, linear independence is not checked
and it may not be possible to generate all other cycles from this set. In
practice the vertex/edge short cycles are similar to MCB. Modifier and Type | Method and Description |
---|---|
static CycleFinder |
all()
Create a cycle finder which will compute all simple cycles in a molecule.
|
static Cycles |
all(IAtomContainer container)
Find all simple cycles in a molecule.
|
static Cycles |
all(IAtomContainer container,
int length)
All cycles of smaller than or equal to the specified length.
|
static CycleFinder |
all(int length)
All cycles of smaller than or equal to the specified length.
|
static CycleFinder |
allOrVertexShort()
Deprecated.
use
or(org.openscience.cdk.graph.CycleFinder, org.openscience.cdk.graph.CycleFinder) to define a custom fall-back |
static CycleFinder |
cdkAromaticSet()
Create a cycle finder which will compute a set of cycles traditionally
used by the CDK to test for aromaticity.
|
static CycleFinder |
edgeShort()
Create a cycle finder which will compute the shortest cycles of each
vertex in a molecule.
|
static Cycles |
edgeShort(IAtomContainer container)
Find the edge short cycles of a molecule.
|
static CycleFinder |
essential()
Create a cycle finder which will compute the essential cycles of a
molecule.
|
static Cycles |
essential(IAtomContainer container)
Find the essential cycles of a molecule.
|
static int |
markRingAtomsAndBonds(IAtomContainer mol)
Find and mark all cyclic atoms and bonds in the provided molecule.
|
static int |
markRingAtomsAndBonds(IAtomContainer mol,
int[][] adjList,
GraphUtil.EdgeToBondMap bondMap)
Find and mark all cyclic atoms and bonds in the provided molecule.
|
static CycleFinder |
mcb()
Create a cycle finder which will compute the minimum cycle basis (MCB) of
a molecule.
|
static Cycles |
mcb(IAtomContainer container)
Find the minimum cycle basis (MCB) of a molecule.
|
int |
numberOfCycles()
How many cycles are stored.
|
static CycleFinder |
or(CycleFinder primary,
CycleFinder auxiliary)
Use an auxiliary cycle finder if the primary method was intractable.
|
int[][] |
paths() |
static CycleFinder |
relevant()
Create a cycle finder which will compute the relevant cycle basis (RC) of
a molecule.
|
static Cycles |
relevant(IAtomContainer container)
Find the relevant cycles of a molecule.
|
static Cycles |
sssr(IAtomContainer container)
Find the smallest set of smallest rings (SSSR) - aka minimum cycle basis
(MCB) of a molecule.
|
IRingSet |
toRingSet()
|
static CycleFinder |
tripletShort()
Create a cycle finder which will compute the triplet short cycles of a
molecule.
|
static Cycles |
tripletShort(IAtomContainer container)
Find the triplet short cycles of a molecule.
|
static CycleFinder |
unchorded(CycleFinder original)
Derive a new cycle finder that only provides cycles without a chord.
|
static CycleFinder |
vertexShort()
Create a cycle finder which will compute the shortest cycles of each
vertex in a molecule.
|
static Cycles |
vertexShort(IAtomContainer container)
Find the vertex short cycles of a molecule.
|
public int numberOfCycles()
public int[][] paths()
public IRingSet toRingSet()
public static CycleFinder all()
AllCycles
or AllRingsFinder
. All cycles is every
possible simple cycle (i.e. non-repeating vertices) in the chemical
graph. As an example - all simple cycles of anthracene includes, 3 cycles
of length 6, 2 of length 10 and 1 of length 14.
CycleFinder cf = Cycles.all(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // handle error - note it is common that finding all simple // cycles in chemical graphs is intractable } }
all(org.openscience.cdk.interfaces.IAtomContainer)
,
AllCycles
,
AllRingsFinder
public static CycleFinder all(int length)
CycleFinder.find(IAtomContainer, int)
the
minimum of the two limits is used.length
- maximum size or cycle to findpublic static CycleFinder mcb()
CycleFinder cf = Cycles.mcb(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - MCB should never be intractable } }
mcb(org.openscience.cdk.interfaces.IAtomContainer)
,
MinimumCycleBasis
public static CycleFinder relevant()
CycleFinder cf = Cycles.relevant(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - there may be an exponential number of cycles // but this is not currently checked } }
relevant(org.openscience.cdk.interfaces.IAtomContainer)
,
RelevantCycles
public static CycleFinder essential()
CycleFinder cf = Cycles.essential(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - essential cycles do not check tractability } }
relevant(org.openscience.cdk.interfaces.IAtomContainer)
,
RelevantCycles
public static CycleFinder tripletShort()
TripletShortCycles
.
CycleFinder cf = Cycles.tripletShort(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - triple short cycles do not check tractability } }
tripletShort(org.openscience.cdk.interfaces.IAtomContainer)
,
TripletShortCycles
public static CycleFinder vertexShort()
CycleFinder cf = Cycles.vertexShort(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - vertex short cycles do not check tractability } }
vertexShort(org.openscience.cdk.interfaces.IAtomContainer)
public static CycleFinder edgeShort()
CycleFinder cf = Cycles.edgeShort(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - edge short cycles do not check tractability } }
edgeShort(org.openscience.cdk.interfaces.IAtomContainer)
public static CycleFinder cdkAromaticSet()
all()
cycles for fused systems with 3 or less rings.
This allows on to test aromaticity of envelope rings in compounds such as
azulene without generating an huge number of cycles for large fused
systems (e.g. fullerenes). The use case was that computation of all
cycles previously took a long time and ring systems with more than 2
rings were too difficult. However it is now more efficient to simply
check all cycles/rings without using the MCB/SSSR. This computation will
fail for complex fused systems but the failure is fast and one can easily
'fall back' to a smaller set of cycles after catching the exception.
CycleFinder cf = Cycles.cdkAromaticSet(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - edge short cycles do not check tractability } }
edgeShort(org.openscience.cdk.interfaces.IAtomContainer)
@Deprecated public static CycleFinder allOrVertexShort()
or(org.openscience.cdk.graph.CycleFinder, org.openscience.cdk.graph.CycleFinder)
to define a custom fall-backCycleFinder cf = Cycles.allOrVertexShort(); for (IAtomContainer m : ms) { try { Cycles cycles = cf.find(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // ignore error - edge short cycles do not check tractability } }
public static int markRingAtomsAndBonds(IAtomContainer mol)
mol
- moleculeIBond.isInRing()
,
IAtom.isInRing()
,
Circuit Rankpublic static int markRingAtomsAndBonds(IAtomContainer mol, int[][] adjList, GraphUtil.EdgeToBondMap bondMap)
mol
- moleculeIBond.isInRing()
,
IAtom.isInRing()
,
Circuit Rankpublic static CycleFinder or(CycleFinder primary, CycleFinder auxiliary)
It is possible to nest multiple levels.// all cycles or all cycles size <= 6 CycleFinder cf = Cycles.or(Cycles.all(), Cycles.all(6));
// all cycles or relevant or essential CycleFinder cf = Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(), Cycles.essential()));
primary
- primary cycle finding methodauxiliary
- auxiliary cycle finding method if the primary failedpublic static Cycles all(IAtomContainer container) throws Intractable
AllCycles
or AllRingsFinder
.
All cycles is every possible simple cycle (i.e. non-repeating vertices)
in the chemical graph. As an example - all simple cycles of anthracene
includes, 3 cycles of length 6, 2 of length 10 and 1 of length 14.
for (IAtomContainer m : ms) { try { Cycles cycles = Cycles.all(m); IRingSet rings = cycles.toRingSet(); } catch (Intractable e) { // handle error - note it is common that finding all simple // cycles in chemical graphs is intractable } }
Intractable
- the algorithm reached a limit which caused it to
abort in reasonable timeall()
,
AllCycles
,
AllRingsFinder
public static Cycles all(IAtomContainer container, int length) throws Intractable
container
- input containerlength
- maximum size or cycle to findIntractable
- computation was not feasiblepublic static Cycles mcb(IAtomContainer container)
for (IAtomContainer m : ms) { Cycles cycles = Cycles.mcb(m); IRingSet rings = cycles.toRingSet(); }
mcb()
,
MinimumCycleBasis
public static Cycles sssr(IAtomContainer container)
for (IAtomContainer m : ms) { Cycles cycles = Cycles.sssr(m); IRingSet rings = cycles.toRingSet(); }
mcb()
,
mcb(org.openscience.cdk.interfaces.IAtomContainer)
,
MinimumCycleBasis
public static Cycles relevant(IAtomContainer container)
for (IAtomContainer m : ms) { Cycles cycles = Cycles.relevant(m); IRingSet rings = cycles.toRingSet(); }
relevant()
,
RelevantCycles
public static Cycles essential(IAtomContainer container)
for (IAtomContainer m : ms) { Cycles cycles = Cycles.essential(m); IRingSet rings = cycles.toRingSet(); }
relevant()
,
RelevantCycles
public static Cycles tripletShort(IAtomContainer container)
for (IAtomContainer m : ms) { Cycles cycles = Cycles.tripletShort(m); IRingSet rings = cycles.toRingSet(); }
tripletShort()
,
TripletShortCycles
public static Cycles vertexShort(IAtomContainer container)
for (IAtomContainer m : ms) { Cycles cycles = Cycles.vertexShort(m); IRingSet rings = cycles.toRingSet(); }
vertexShort()
,
VertexShortCycles
public static Cycles edgeShort(IAtomContainer container)
for (IAtomContainer m : ms) { Cycles cycles = Cycles.edgeShort(m); IRingSet rings = cycles.toRingSet(); }
edgeShort()
,
EdgeShortCycles
public static CycleFinder unchorded(CycleFinder original)
original
- find the initial cycles before filteringCopyright © 2022. All rights reserved.