Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mrdna
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tbgl
tools
mrdna
Commits
89de52da
Commit
89de52da
authored
6 years ago
by
dwinogra
Browse files
Options
Downloads
Patches
Plain Diff
added drawing cylinder option to mrdna
parent
671f1605
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/mrdna
+27
-14
27 additions, 14 deletions
bin/mrdna
mrdna/segmentmodel.py
+22
-0
22 additions, 0 deletions
mrdna/segmentmodel.py
with
49 additions
and
14 deletions
bin/mrdna
+
27
−
14
View file @
89de52da
...
...
@@ -24,6 +24,9 @@ parser.add_argument('--fine-steps', type=float, default=1e7,
parser
.
add_argument
(
'
--backbone-scale
'
,
type
=
float
,
default
=
1.0
,
help
=
'
Factor to scale DNA backbone in atomic model; try 0.25 to avoid clashes for atomistic simulations
'
)
parser
.
add_argument
(
'
--draw-cylinders
'
,
type
=
bool
,
default
=
False
,
help
=
'
whether or not to draw the cylinders
'
)
parser
.
add_argument
(
'
input_file
'
,
type
=
str
,
help
=
"""
Any of the following:
(1) a cadnano JSON file;
...
...
@@ -54,19 +57,29 @@ if __name__ == '__main__':
if
args
.
output_prefix
is
not
None
:
prefix
=
args
.
output_prefix
run_args
=
dict
(
model
=
model
,
output_name
=
prefix
,
job_id
=
"
job-
"
+
prefix
,
directory
=
args
.
directory
,
gpu
=
args
.
gpu
,
coarse_output_period
=
int
(
args
.
output_period
),
fine_output_period
=
int
(
args
.
output_period
),
coarse_steps
=
int
(
args
.
coarse_steps
),
fine_steps
=
int
(
args
.
fine_steps
),
backbone_scale
=
args
.
backbone_scale
)
if
args
.
draw_cylinders
is
not
False
:
model
=
model
model
.
vmd_cylinder_tcl
()
output_name
=
prefix
+
"
.cylinders.tcl
"
model
.
_clear_beads
()
model
.
_generate_atomic_model
(
scale
=
args
.
backbone_scale
)
model
.
write_atomic_ENM
(
prefix
)
model
.
atomic_simulate
(
output_name
=
prefix
)
else
:
run_args
=
dict
(
model
=
model
,
output_name
=
prefix
,
job_id
=
"
job-
"
+
prefix
,
directory
=
args
.
directory
,
gpu
=
args
.
gpu
,
coarse_output_period
=
int
(
args
.
output_period
),
fine_output_period
=
int
(
args
.
output_period
),
coarse_steps
=
int
(
args
.
coarse_steps
),
fine_steps
=
int
(
args
.
fine_steps
),
backbone_scale
=
args
.
backbone_scale
)
simulate
(
**
run_args
)
simulate
(
**
run_args
)
This diff is collapsed.
Click to expand it.
mrdna/segmentmodel.py
+
22
−
0
View file @
89de52da
...
...
@@ -2813,3 +2813,25 @@ proc calcforces {} {
raise
(
Exception
)
file_handle
.
write
(
""
)
def
vmd_cylinder_tcl
(
self
,
file_name
=
"
drawCylinders.tcl
"
):
#raise NotImplementedError
with
open
(
file_name
,
'
w
'
)
as
tclFile
:
tclFile
.
write
(
"
## beginning TCL script
\n
"
)
def
draw_cylinder
(
segment
,
radius_value
=
10
,
color
=
"
cyan
"
):
tclFile
.
write
(
"
## cylinder being drawn...
\n
"
)
r0
=
segment
.
contour_to_position
(
0
)
r1
=
segment
.
contour_to_position
(
1
)
x0
,
y0
,
z0
=
r0
x1
,
y1
,
z1
=
r1
radius_value
=
str
(
radius_value
)
color
=
str
(
color
)
tclFile
.
write
(
"
graphics top color {}
\n
"
.
format
(
color
))
tclFile
.
write
(
"
graphics top cylinder {{ {} {} {} }} {{ {} {} {} }} radius {} resolution 30 filled yes
\n
"
.
format
(
r0
[
0
],
r0
[
1
],
r0
[
2
],
r1
[
0
],
r1
[
1
],
r1
[
2
],
radius_value
))
## material
tclFile
.
write
(
"
graphics top materials on
\n
"
)
tclFile
.
write
(
"
graphics top material AOEdgy
\n
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment