Skip to content

Commit a4a615c

Browse files
committed
allow configure cutoff bt eigen values
1 parent 0040b8a commit a4a615c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/graphpro/annotations.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,15 @@ class BTEigenCentrality(NodeAnnotation):
238238
""" Computes the residue energy contribution based on BT potential to the graph
239239
centrality.
240240
"""
241-
def __init__(self, attr_name: str = 'bt_eigen_centrality', chain: str = None):
241+
def __init__(self, attr_name: str = 'bt_eigen_centrality', chain: str = None, cutoff: int = 6):
242242
""" Attribute name
243243
"""
244244
self.attr_name = attr_name
245245
self.chain = chain
246+
self.cutoff = cutoff
246247

247248
def generate(self, G, atom_group):
248-
res_ids, eigen_potential = compute_eigen_centrality(atom_group, self.chain)
249+
res_ids, eigen_potential = compute_eigen_centrality(atom_group, self.chain, cutoff=self.cutoff)
249250
for i,resid in enumerate(res_ids):
250251
node_id = G.get_node_by_resid(resid)
251252
G.node_attr_add(node_id, self.attr_name, eigen_potential[i])

0 commit comments

Comments
 (0)