Skip to content

Commit

Permalink
small modernization
Browse files Browse the repository at this point in the history
  • Loading branch information
agrossfield committed Jan 23, 2024
1 parent f8896f3 commit 6c3326c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Packages/PyLOOS/protein_tilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@
print(" points in the +z direction")
sys.exit()

#print len(sys.argv)
print("#", " ".join(sys.argv))
system_filename = sys.argv[1]
traj_filename = sys.argv[2]
selections = sys.argv[3:]


system = loos.createSystem(system_filename)
traj = loos.pyloos.Trajectory(traj_filename, system)

helices = []
for s in selections:
helices.append(loos.selectAtoms(system, s))

to_degrees = 180.0/math.pi

print("#Frame\tAngle\tCosine")

for frame in traj:
for _ in traj:

vec = loos.GCoord(0., 0., 0.)
vec = loos.GCoord(0.0, 0.0, 0.0)
for h in helices:
pca = h.principalAxes()
v = pca[0]
if v.z() < 0:
v *= -1.
v *= -1.0
vec += v

cosine = vec.z() / vec.length()

cosine = max(-1.0, cosine)
cosine = min(1.0, cosine)
ang = math.acos(cosine) * 180./math.pi
ang = math.acos(cosine) * to_degrees

print(traj.index(), ang, cosine)

0 comments on commit 6c3326c

Please sign in to comment.