1
RNA structures (DSSR) / Re: Circular DNA parameters
« on: April 14, 2021, 06:23:14 am »
Dear Xiang-Jun,
That looks very pretty!!! Thank you very much for the follow-up!
Some while ago I managed to cook-up a "solution" using python by adjusting some of the elegant x3DNA parameters.
Sorry for not sharing my solution any sooner!
My approach assumed that every 10 basepairs one should adjust the roll angle to obtain a circle.
However, for sequences that have a length that is not a 10 fold I ran into issues, creating super helices...
So I randomly distributed the "remaining" basepairs among chunks of 10bp and adjusted the twist angle accordingly.
In the future I might work on building super coils!
Although, I have not had the time nor leads on how to do it
So if anybody has some suggestions or ideas, I would be more than happy to hear them!
Here a snippet of python (v3) code to determine the new roll and twist parameters...
That looks very pretty!!! Thank you very much for the follow-up!
Some while ago I managed to cook-up a "solution" using python by adjusting some of the elegant x3DNA parameters.
Sorry for not sharing my solution any sooner!
My approach assumed that every 10 basepairs one should adjust the roll angle to obtain a circle.
However, for sequences that have a length that is not a 10 fold I ran into issues, creating super helices...
So I randomly distributed the "remaining" basepairs among chunks of 10bp and adjusted the twist angle accordingly.
In the future I might work on building super coils!
Although, I have not had the time nor leads on how to do it
So if anybody has some suggestions or ideas, I would be more than happy to hear them!
Here a snippet of python (v3) code to determine the new roll and twist parameters...
Code: [Select]
import random
import numpy as np
n_bp = len(sequence)
remainder = (n_bp % 10)
if remainder != 0:
raw_turns = n_bp / 10
turns = int((n_bp-remainder) / 10)
turn_angle = 360/turns
bp_angle = 360/n_bp
turn_indices = list(np.arange(0,n_bp,10))
selection = sorted(random.sample(turn_indices[1:], remainder))
count = 0
new_turn_indices = []
for index in turn_indices:
if index in selection:
count +=1
new_turn_indices.append(index+count)
else:
new_turn_indices.append(index+count)
differences = [new_turn_indices[n]-new_turn_indices[n-1] for n in range(1,len(new_turn_indices))]
turn_angles = [diff*bp_angle for diff in differences]
count = 0
roll_angles = []
for i in range(0,n_bp):
if i in new_turn_indices:
roll_angles.append(turn_angles[count])
count+=1
else:
roll_angles.append(0)
new_twist = 360/11
twist = 360/10
twists = []
for diff in differences:
if diff == 10:
twists.extend([twist]*diff)
else:
twists.extend([new_twist]*diff)