Commit 49db14de authored by cmaffeo2's avatar cmaffeo2
Browse files

Improved bp detection in pdb model reader

parent 0ca4dc50
......@@ -149,16 +149,20 @@ def find_basepairs( u, centers, transforms, selection_text='all' ):
possible_resI = np.where( ids )[0]
possible_resJ = possible_basepairs[ ids ].astype(int)
resI,resJ = [[],[]]
for i,j,R1,c1,c2 in zip(possible_resI,possible_resJ,
for i,j,R1,R2,c1,c2 in zip(possible_resI,possible_resJ,
transforms[possible_resI],
transforms[possible_resJ],
centers[possible_resI],
centers[possible_resJ]):
c2_expected = c1 + ref_bp_position.dot(R1)
# fh.write("graphics top cylinder {{{}}} {{{}}} radius 0.2 resolution 30\n".format(printv(c1),printv(c2)))
if np.linalg.norm(c2_expected-c2) < 2:
resI.append(i)
resJ.append(j)
if np.linalg.norm(c2_expected-c2) < 3.5:
angle= R1.T.dot(np.array((0,0,1))).dot(R2.T.dot(np.array((0,0,1))))
if angle < -0.7:
resI.append(i)
resJ.append(j)
resI = np.array(resI, dtype=np.int)
resJ = np.array(resJ, dtype=np.int)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment