def add_delaunay_triangulation_(self):
"""
Computes the Delaunay triangulation of the protein structure.
This has been used in prior work. References:
- Harrison, R. W., Yu, X. & Weber, I. T. Using triangulation to include
target structure improves drug resistance prediction accuracy. in 1–1
(IEEE, 2013). doi:10.1109/ICCABS.2013.6629236
- Yu, X., Weber, I. T. & Harrison, R. W. Prediction of HIV drug
resistance from genotype with encoded three-dimensional protein
structure. BMC Genomics 15 Suppl 5, S1 (2014).
Notes:
1. We do not use the add_interacting_resis function, because this
interaction is computed on the CA atoms. Therefore, there is code
duplication. For now, I have chosen to leave this code duplication
in.
"""
ca_coords = self.dataframe[self.dataframe['atom'] == 'CA']
tri = Delaunay(ca_coords[['x', 'y', 'z']]) # this is the triangulation
for simplex in tri.simplices:
nodes = ca_coords.reset_index().ix[simplex]['node_id']
for n1, n2 in combinations(nodes, 2):
if self.has_edge(n1, n2):
self.edge[n1][n2]['kind'].add('delaunay')
else:
self.add_edge(n1, n2, kind={'delaunay'})
评论列表
文章目录