From 07f7c4bb46a4fc5fdde770043de4f5a109bf4590 Mon Sep 17 00:00:00 2001 From: DanielHader Date: Tue, 15 Oct 2024 11:42:22 -0500 Subject: [PATCH 1/4] closes #309: account for Helix Group rotation properly in oxdna/oxview export --- scadnano/scadnano.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scadnano/scadnano.py b/scadnano/scadnano.py index 4ffe57e..e30bddf 100644 --- a/scadnano/scadnano.py +++ b/scadnano/scadnano.py @@ -8983,7 +8983,10 @@ def _oxdna_get_helix_vectors(design: Design, helix: Helix) -> Tuple[_OxdnaVector roll_axis = roll_axis.rotate(design.pitch_of_helix(helix), pitch_axis) # then the roll rotation - yaw_axis = yaw_axis.rotate(-design.roll_of_helix(helix), roll_axis) + # uses group.roll instead of design.roll_of_helix(helix) because latter adds local roll to global roll + # but these are defined with different coordinate systems in mind + yaw_axis = yaw_axis.rotate(-group.roll, roll_axis) + pitch_axis = pitch_axis.rotate(-group.roll, roll_axis) # by chosen convension, forward is the same as the roll axis # and normal is the negated yaw axis @@ -8999,9 +9002,13 @@ def _oxdna_get_helix_vectors(design: Design, helix: Helix) -> Tuple[_OxdnaVector raise AssertionError('helix.grid_position should be assigned if grid is not Grid.none') position = grid_position_to_position(helix.grid_position, grid, geometry) - position = position + group.position + # position of helix within its group, rotated by the groups yaw, pitch, roll + local_position = (pitch_axis * position.x) + (yaw_axis * position.y) + (roll_axis * position.z) - origin_ = _OxdnaVector(position.x, position.y, position.z) * NM_TO_OX_UNITS + # position of group's origin with respect to global coordinate system + group_position = _OxdnaVector(group.position.x, group.position.y, group.position.z) + + origin_ = (local_position + group_position) * NM_TO_OX_UNITS return origin_, forward, normal From ddb2c88eef82ab05f9a876ec0817e354c4556947 Mon Sep 17 00:00:00 2001 From: David Doty Date: Mon, 21 Oct 2024 12:55:00 -0700 Subject: [PATCH 2/4] removed 3.7 and 3.8 from unit testing --- .github/workflows/run_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 3e86097..e6ec131 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ] + python-version: [ 3.9, "3.10", "3.11" ] steps: - uses: actions/checkout@v2 From 20226d372871388b81c94e332fbfed20c0fa5b52 Mon Sep 17 00:00:00 2001 From: David Doty Date: Mon, 21 Oct 2024 12:56:32 -0700 Subject: [PATCH 3/4] Update run_unit_tests.yml --- .github/workflows/run_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index e6ec131..e2cc669 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.9, "3.10", "3.11" ] + python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ] steps: - uses: actions/checkout@v2 From 77130cadd55be6b51a67f595e52f601530db42fa Mon Sep 17 00:00:00 2001 From: David Doty Date: Mon, 21 Oct 2024 12:57:28 -0700 Subject: [PATCH 4/4] Update run_unit_tests.yml --- .github/workflows/run_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index eb9ff79..82e2836 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ] + python-version: [ 3.9, "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v2