Skip to content

Commit

Permalink
Duplex angle plotter now works with ANY nucleotide id in the duplex, …
Browse files Browse the repository at this point in the history
…not just start/end. Bumped version number.
  • Loading branch information
ErikPoppleton committed Mar 18, 2024
1 parent 392035a commit eb17a42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion analysis/src/oxDNA_analysis_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.3.1'
__version__ = '2.3.2'
15 changes: 10 additions & 5 deletions analysis/src/oxDNA_analysis_tools/duplex_angle_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def get_angle_between(files:List[str], p1s:List[List[int]], p2s:List[List[int]],

global_count = 0

#For each input triplet
# For each angle file...
for i, (anglefile, search1, search2) in enumerate(zip(files, p1s, p2s)):

steps = 0 #counts the number of configurations in the file
steps = 0 # counts the number of configurations in the file
last_step = 0
count = 0 # counts the number of search terms found in each step
all_angles[i] = [[] for _ in p1s[i]]
Expand All @@ -78,6 +78,7 @@ def get_angle_between(files:List[str], p1s:List[List[int]], p2s:List[List[int]],
# 8: Z-component of the axis vector
# 9: Helix position

# Search the angle file for the search ids...
with open(anglefile) as file:
all_search = search1.copy()
all_search.extend(search2)
Expand Down Expand Up @@ -116,12 +117,16 @@ def get_angle_between(files:List[str], p1s:List[List[int]], p2s:List[List[int]],

#look for the nucleotide IDs.
for s in all_search:
idx = l.index(s, 2, 6) if s in l[2:6] else None
if idx:
l1 = int(l[2])
u1 = int(l[3])
l2 = int(l[4])
u2 = int(l[5])
si = int(s)
if (si >= l1 and si <= u1) or (si >= l2 and si <= u2):
d[s] = np.array([float(l[6]), float(l[7]), float(l[8])])
count += 1

#once all are found, add them to angle list
#once all are found, can skip the rest of this timestep
if count == len(d):
found = True

Expand Down

0 comments on commit eb17a42

Please sign in to comment.