Cycles

Cycle detection and enumeration is handled by the excellent library RingDecomposerLib, which avoids exponential space requirements in heavily fused ring systems using Unique Ring Families.

class scine_molassembler.Cycles

Information about molecular graph cycles.

>>> # Simple molecule for which relevant cycles and cycle families are the same
>>> spiro = io.experimental.from_smiles("C12(CCC1)CCC2")
>>> cycles = spiro.graph.cycles
>>> cycles.num_cycle_families()
2
>>> cycles.num_cycle_families(0) # The spiroatom belongs to both families
2
>>> cycles.num_cycle_families(1) # Other cycle atoms only belong to one
1
>>> cycles.num_cycle_families() == cycles.num_relevant_cycles()
True
>>> cycles.num_cycle_families(1) == cycles.num_relevant_cycles(1)
True
num_cycle_families(*args, **kwargs)

Overloaded function.

  1. num_cycle_families(self: scine_molassembler.Cycles) -> int

Returns the number of cycle families present in the graph

  1. num_cycle_families(self: scine_molassembler.Cycles, constituting_index: int) -> int

Returns the number of cycle families an atom belongs to

  1. num_cycle_families(self: scine_molassembler.Cycles, constituting_index: scine_molassembler.BondIndex) -> int

Returns the number of cycle families a bond belongs to

num_relevant_cycles(*args, **kwargs)

Overloaded function.

  1. num_relevant_cycles(self: scine_molassembler.Cycles) -> int

Returns the number of relevant cycles present in the graph

  1. num_relevant_cycles(self: scine_molassembler.Cycles, constituting_index: int) -> int

Returns the number of relevant cycles an atom belongs to

  1. num_relevant_cycles(self: scine_molassembler.Cycles, constituting_index: scine_molassembler.BondIndex) -> int

Returns the number of relevant cycles a bond belongs to