Commit e138ec52 authored by cmaffeo2's avatar cmaffeo2
Browse files

Fixed issue with PSF writer; fixed issue with orientation when no spline exists

parent ac887d18
......@@ -464,7 +464,7 @@ class PdbModel(Transformable, Parent):
## TODOTODO test
if np.log10(idx) >= 5:
idx = "******"
idx = " *****"
else:
idx = "{:>6d}".format(idx)
......
......@@ -418,15 +418,15 @@ class Segment(ConnectableElement, Group):
axis = axis / np.linalg.norm(axis)
rotAxis = np.cross(axis,np.array((0,0,1)))
rotAxisL = np.linalg.norm(rotAxis)
zAxis = np.array((0,0,1))
if rotAxisL > 0.001:
theta = np.arcsin(rotAxisL)
orientation0 = rotationAboutAxis( rotAxis/rotAxisL, theta*180/np.pi, normalizeAxis=False )
theta = np.arcsin(rotAxisL) * 180/np.pi
if axis.dot(zAxis) < 0: theta = 180-theta
orientation0 = rotationAboutAxis( rotAxis/rotAxisL, theta, normalizeAxis=False ).T
else:
if axis.dot(np.array((0,0,1))) > 0:
orientation0 = np.eye(3)
else:
orientation0 = rotationAboutAxis( np.array((1,0,0)), 180, normalizeAxis=False )
orientation0 = np.eye(3) if axis.dot(zAxis) > 0 else \
rotationAboutAxis( np.array((1,0,0)), 180, normalizeAxis=False )
orientation = rotationAboutAxis( axis, self.twist_per_nt*self.contour_to_nt_pos(s), normalizeAxis=False )
orientation = orientation.dot(orientation0)
else:
......@@ -2318,10 +2318,10 @@ class SegmentModel(ArbdModel):
elif dot1 < -0.5 and dot2 < -0.5:
## TODO, reverse
...
print("Warning: {} and {} are on antiparallel helices (not yet implemented)... skipping".format(A,B))
print("Warning: {} and {} are on antiparallel helices (not yet implemented)... skipping".format(A1,B1))
continue
else:
print("Warning: {} and {} are on helices that do not point in similar direction... skipping".format(A,B))
print("Warning: {} and {} are on helices that do not point in similar direction... skipping".format(A1,B1))
continue
## Go through each nucleotide between the two
......
Markdown is supported
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