def daisy_chains(self, kih, max_path_length=None):
""" Generator for daisy chains (complementary kihs) associated with a knob.
Notes
-----
Daisy chain graph is the directed graph with edges from knob residue to each hole residue for each KnobIntoHole
in self.
Given a KnobIntoHole, the daisy chains are non-trivial paths in this graph (walks along the directed edges)
that begin and end at the knob.
These paths must be of length <= max_path_length
Parameters
----------
kih : KnobIntoHole interaction.
max_path_length : int or None
Maximum length of a daisy chain.
Defaults to number of chains in self.ampal_parent.
This is the maximum sensible value. Larger values than this will cause slow running of this function.
"""
if max_path_length is None:
max_path_length = len(self.ampal_parent)
g = self.daisy_chain_graph
paths = networkx.all_simple_paths(g, source=kih.knob, target=kih.knob, cutoff=max_path_length)
return paths
评论列表
文章目录