Skip to content
GitLab
Menu
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
5bd0d211
Commit
5bd0d211
authored
Jul 29, 2019
by
cmaffeo2
Browse files
Added 'fix_linking_number' option to mrdna script; fixed bug in --debug option
parent
42f941f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/mrdna
View file @
5bd0d211
...
...
@@ -32,6 +32,8 @@ parser.add_argument('--output-period', type=float, default=1e4,
#
help
=
'Simulation steps between DCD frames'
)
parser
.
add_argument
(
'--coarse-local-twist'
,
action
=
'store_true'
,
help
=
'Use local twist for coarsest representation?'
)
parser
.
add_argument
(
'--fix-linking-number'
,
action
=
'store_true'
,
help
=
'Fix the linking number so that it cannot change once local twist is introduced?'
)
parser
.
add_argument
(
'--coarse-steps'
,
type
=
float
,
default
=
1e7
,
help
=
'Simulation steps for coarse model (200 fs/step)'
)
parser
.
add_argument
(
'--fine-steps'
,
type
=
float
,
default
=
1e7
,
...
...
@@ -81,7 +83,6 @@ def main():
from
mrdna
.
readers
import
read_atomic_pdb
as
read_model
else
:
raise
Exception
(
"Unrecognized input file '{}'"
.
format
(
infile
))
model
=
read_model
(
str
(
infile
),
debye_length
=
args
.
debye_length
)
if
args
.
output_prefix
is
not
None
:
...
...
@@ -120,6 +121,7 @@ def main():
gpu
=
args
.
gpu
,
minimization_output_period
=
int
(
args
.
output_period
),
coarse_local_twist
=
args
.
coarse_local_twist
,
fix_linking_number
=
args
.
fix_linking_number
,
coarse_output_period
=
int
(
args
.
output_period
),
fine_output_period
=
int
(
args
.
output_period
),
minimization_steps
=
0
,
#
int
(
args
.
minimization_steps
),
...
...
@@ -148,7 +150,7 @@ if __name__ == '__main__':
while
True
:
try
:
#
pdb
.
_runscript
(
mainpyfile
)
self
.
_user_requested_quit
=
False
pdb
.
_user_requested_quit
=
False
pdb
.
runcall
(
main
)
if
pdb
.
_user_requested_quit
:
break
...
...
mrdna/simulate.py
View file @
5bd0d211
...
...
@@ -58,6 +58,7 @@ def multiresolution_simulation( model, output_name,
coarse_output_period
=
1e5
,
fine_output_period
=
1e5
,
coarse_local_twist
=
False
,
fix_linking_number
=
False
,
remove_long_bonds
=
False
,
backbone_scale
=
1.0
,
oxdna_steps
=
None
,
...
...
@@ -114,7 +115,7 @@ def multiresolution_simulation( model, output_name,
coarse_model_args
=
dict
(
max_basepairs_per_bead
=
5
,
max_nucleotides_per_bead
=
5
,
local_twist
=
coarse_local_twist
,
escapable_twist
=
True
)
escapable_twist
=
fix_linking_number
)
# TODO: add the output directory in to the readArbdCoords functions or make it an attribute of the model object
...
...
@@ -132,7 +133,7 @@ def multiresolution_simulation( model, output_name,
model
.
generate_bead_model
(
**
coarse_model_args
)
""" Coarse simulation """
simargs
=
dict
(
timestep
=
200e-6
,
output_period
=
coarse_output_period
,
gpu
=
gpu
)
simargs
=
dict
(
timestep
=
150e-6
if
coarse_local_twist
else
200e-6
,
output_period
=
coarse_output_period
,
gpu
=
gpu
)
if
remove_long_bonds
:
run_step
(
num_steps
=
0.05
*
coarse_steps
,
simargs
=
simargs
)
model
.
clear_beads
()
...
...
@@ -143,9 +144,10 @@ def multiresolution_simulation( model, output_name,
""" Fine simulation """
simargs
=
dict
(
timestep
=
40e-6
,
output_period
=
fine_output_period
,
gpu
=
gpu
)
model
.
clear_beads
()
model
.
generate_bead_model
(
1
,
1
,
local_twist
=
True
,
escapable_twist
=
True
)
run_step
(
num_steps
=
fine_steps
,
simargs
=
simargs
,
do_coordinate_average
=
(
fine_steps
>
2
*
fine_output_period
+
1
))
if
not
fix_linking_number
:
model
.
clear_beads
()
model
.
generate_bead_model
(
1
,
1
,
local_twist
=
True
,
escapable_twist
=
True
)
run_step
(
num_steps
=
fine_steps
,
simargs
=
simargs
,
do_coordinate_average
=
(
fine_steps
>
2
*
fine_output_period
+
1
))
""" Freeze twist """
model
.
clear_beads
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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