mod/butadien/butadienCycleExclusion.py aktualisiert
This commit is contained in:
@@ -110,16 +110,17 @@ dielsalder = Rule.fromGMLString(
|
|||||||
]"""
|
]"""
|
||||||
)
|
)
|
||||||
|
|
||||||
#MCB? horton vs DePina, einfach Depth first ob nach vier cyclus
|
|
||||||
def cyclesizes(g):
|
def cyclesizes(g):
|
||||||
nxGraph = GraphObj(g).nx_graph
|
nxGraph = GraphObj(g).nx_graph
|
||||||
|
|
||||||
|
#Chein restrictions: (No steric reason)
|
||||||
|
paths = sorted(list(nx.all_simple_paths(nxGraph)))
|
||||||
|
if max(paths > 12):
|
||||||
|
return True
|
||||||
|
|
||||||
|
#Cycle restrictions:
|
||||||
cycles = sorted(list(nx.chordless_cycles(nxGraph)))
|
cycles = sorted(list(nx.chordless_cycles(nxGraph)))
|
||||||
cycle_lengths = [len(x) for x in cycles]
|
cycle_lengths = [len(x) for x in cycles]
|
||||||
#Find all cycles and list their sizes
|
|
||||||
#Only for C
|
|
||||||
#Chordless, elemenatary
|
|
||||||
#Is there a inbuild way to ignore all H?
|
|
||||||
#
|
|
||||||
if cycles == []:
|
if cycles == []:
|
||||||
return False
|
return False
|
||||||
#One Atom can't be in four different cycles
|
#One Atom can't be in four different cycles
|
||||||
|
|||||||
Reference in New Issue
Block a user