From c62ac059d34de6fb551569c5074290f87959a149 Mon Sep 17 00:00:00 2001 From: Chris Maffeo <cmaffeo2@illinois.edu> Date: Fri, 4 Oct 2024 14:51:15 -0500 Subject: [PATCH] Add explicitly_unstacked argument to oxDNA reader to ensure we get terminal_crossover connections --- mrdna/readers/segmentmodel_from_lists.py | 9 +++++++++ mrdna/readers/segmentmodel_from_oxdna.py | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mrdna/readers/segmentmodel_from_lists.py b/mrdna/readers/segmentmodel_from_lists.py index ef184a0..c07306c 100644 --- a/mrdna/readers/segmentmodel_from_lists.py +++ b/mrdna/readers/segmentmodel_from_lists.py @@ -253,6 +253,15 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime, basepaired / stacked / phosphodiester-bonded nucleotide. If there is no such nucleotide, the value should be -1. + By default, where there is a 3'-to-5' connection between + double-straned helices, they will be connected by an intrahelical + connection that makes the helical domain continue across the + connection, even if they do not stack in the stacking + array. Instead, a "terminal_crossover" representing a relatively + free (e.g. kinked) junction can be placed by including the index + of one of the participating bases in the optional + :explicitly_unstacked: tuple. + Args: basepair: List of each nucleotide's basepair's index stack: List containing index of the nucleotide stacked on the 3' of each nucleotide diff --git a/mrdna/readers/segmentmodel_from_oxdna.py b/mrdna/readers/segmentmodel_from_oxdna.py index e6ded48..d85002e 100644 --- a/mrdna/readers/segmentmodel_from_oxdna.py +++ b/mrdna/readers/segmentmodel_from_oxdna.py @@ -143,7 +143,7 @@ def mrdna_model_from_oxdna(coordinate_file, topology_file,virt2nuc=None,get_nt_p orientation = [np.array(o).T.dot(_yrot) for o in zip(perp_dir,-base_dir,-normal_dir)] seq=nt_prop["seq"] bp=nt_prop["bp"] - stack=nt_prop["stack"] + stack=np.array((list(nt_prop["stack"]))) three_prime=nt_prop["threeprime"] nt_prop["orientation"]=orientation nt_prop["r"]=list(r) @@ -205,8 +205,9 @@ def mrdna_model_from_oxdna(coordinate_file, topology_file,virt2nuc=None,get_nt_p ## _debug_write_bonds() logger.info(f'mrdna_model_from_oxdna: num_bp, num_ss_nt, num_stacked: {np.sum(bp>=0)//2} {np.sum(bp<0)} {np.sum(stack >= 0)}') - - model = model_from_basepair_stack_3prime( r, bp, stack, three_prime, seq, orientation, **model_parameters ) + model = model_from_basepair_stack_3prime( r, bp, stack, three_prime, seq, orientation, + explicitly_unstacked = np.argwhere(stack == -1), + **model_parameters ) """ model.DEBUG = True -- GitLab