Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tbgl
tools
mrdna
Commits
9c8f8c76
Commit
9c8f8c76
authored
Apr 04, 2018
by
cmaffeo2
Browse files
Cleaned up a few bugs
parent
d12589d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
segmentmodel.py
View file @
9c8f8c76
...
...
@@ -685,7 +685,8 @@ class DoubleStrandedSegment(Segment):
segment_model
=
None
,
local_twist
=
False
,
num_turns
=
None
,
start_orientation
=
None
):
start_orientation
=
None
,
twist_persistence_length
=
90
):
self
.
helical_rise
=
10.44
self
.
distance_per_nt
=
3.4
...
...
@@ -702,6 +703,7 @@ class DoubleStrandedSegment(Segment):
if
start_orientation
is
None
:
start_orientation
=
np
.
eye
(
3
)
# np.array(((1,0,0),(0,1,0),(0,0,1)))
self
.
start_orientation
=
start_orientation
self
.
twist_persistence_length
=
twist_persistence_length
self
.
nicks
=
[]
...
...
@@ -1572,11 +1574,11 @@ class SegmentModel(ArbdModel):
new_cl
.
append
(
cl
)
lastParticle
=
A
.
particle
crossovers
=
new_cl
for
i
in
range
(
len
(
crossovers
)
-
1
):
for
i
in
range
(
len
(
crossovers
)
-
2
):
c1
,
A1
,
B1
,
dir1
=
crossovers
[
i
]
c2
,
A2
,
B2
,
dir2
=
crossovers
[
j
]
c2
,
A2
,
B2
,
dir2
=
crossovers
[
i
+
1
]
s1
,
s2
=
[
l
.
container
for
l
in
(
A1
,
A2
)]
sep
=
A1
.
get_nt_position
(
s1
)
-
A2
.
get_nt_position
(
s2
)
sep
=
A1
.
particle
.
get_nt_position
(
s1
)
-
A2
.
particle
.
get_nt_position
(
s2
)
sep
=
np
.
abs
(
sep
)
n1
,
n2
,
n3
,
n4
=
(
B1
.
particle
,
A1
.
particle
,
A2
.
particle
,
B2
.
particle
)
...
...
@@ -1589,28 +1591,28 @@ class SegmentModel(ArbdModel):
## From http://www.annualreviews.org/doi/pdf/10.1146/annurev.bb.17.060188.001405
## units "3e-19 erg cm/ 295 k K" "nm" =~ 73
Lp
=
s1
.
twist
P
ersistence
L
ength
/
0.34
# set semi-arbitrarily as there is a large spread in literature
Lp
=
s1
.
twist
_p
ersistence
_l
ength
/
0.34
# set semi-arbitrarily as there is a large spread in literature
fitFun
=
lambda
x
:
np
.
real
(
erf
(
(
4
*
np
.
pi
*
x
+
1j
)
/
(
2
*
np
.
sqrt
(
x
))
))
*
np
.
exp
(
-
1
/
(
4
*
x
))
/
erf
(
2
*
np
.
sqrt
(
x
)
*
np
.
pi
)
-
exp
(
-
sep
/
Lp
)
k
=
opt
.
leastsq
(
fitFun
,
x0
=
exp
(
-
sep
/
Lp
)
)
fitFun
=
lambda
x
:
np
.
real
(
erf
(
(
4
*
np
.
pi
*
x
+
1j
)
/
(
2
*
np
.
sqrt
(
x
))
))
*
np
.
exp
(
-
1
/
(
4
*
x
))
/
erf
(
2
*
np
.
sqrt
(
x
)
*
np
.
pi
)
-
np
.
exp
(
-
sep
/
Lp
)
k
=
opt
.
leastsq
(
fitFun
,
x0
=
np
.
exp
(
-
sep
/
Lp
)
)
k
=
k
[
0
][
0
]
*
2
*
kT
*
0.00030461742
t0
=
sep
*
(
360.0
/
s1
.
twist_per_nt
)
# pdb.set_trace()
if
c
1
.
on_fwd_strand
:
t0
-=
120
if
A
1
.
on_fwd_strand
:
t0
-=
120
if
dir1
!=
dir2
:
c
2_on_fwd
=
not
c
2
.
on_fwd_strand
A
2_on_fwd
=
not
A
2
.
on_fwd_strand
else
:
c
2_on_fwd
=
c
2
.
on_fwd_strand
if
c
2_on_fwd
:
t0
+=
120
A
2_on_fwd
=
A
2
.
on_fwd_strand
if
A
2_on_fwd
:
t0
+=
120
# t0 = (t0 % 360
# if n2.idx == 0:
# print( n1.idx,n2.idx,n3.idx,n4.idx,k,t0,sep )
pot
=
self
.
get_dihedral_potential
(
k
,
t0
)
dihedral
s
.
add
(
n1
,
n2
,
n3
,
n4
,
pot
)
self
.
add_
dihedral
(
n1
,
n2
,
n3
,
n4
,
pot
)
def
walk_through_helices
(
segment
,
direction
=
1
,
processed_segments
=
None
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment