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
32ce45a6
Commit
32ce45a6
authored
Dec 03, 2020
by
cmaffeo2
Browse files
Added option to exclude interhelical bonds from atomic ENM
parent
97f92674
Changes
1
Hide whitespace changes
Inline
Side-by-side
mrdna/segmentmodel.py
View file @
32ce45a6
...
...
@@ -3449,7 +3449,7 @@ class SegmentModel(ArbdModel):
j
=
nt2
.
_get_atomic_index
(
name
=
n2
)
fh
.
write
(
"bond %d %d %f %.2f
\n
"
%
(
i
,
j
,
spring_constant
,
2.8
))
def
write_atomic_ENM
(
self
,
output_name
,
lattice_type
=
None
):
def
write_atomic_ENM
(
self
,
output_name
,
lattice_type
=
None
,
interhelical_bonds
=
True
):
## TODO: ensure atomic model was generated already
if
lattice_type
is
None
:
try
:
...
...
@@ -3600,20 +3600,20 @@ class SegmentModel(ArbdModel):
...
# print("PUSH BONDS:", len(push_bonds))
if
not
self
.
useTclForces
:
with
open
(
"%s.exb"
%
output_name
,
'a'
)
as
fh
:
for
i
,
j
in
push_bonds
:
fh
.
write
(
"bond %d %d %f %.2f
\n
"
%
(
i
,
j
,
1.0
,
31
))
else
:
flat_push_bonds
=
list
(
sum
(
push_bonds
))
atomList
=
list
(
set
(
flat_push_bonds
))
with
open
(
"%s.forces.tcl"
%
output_name
,
'w'
)
as
fh
:
fh
.
write
(
"set atomList {%s}
\n\n
"
%
" "
.
join
([
str
(
x
-
1
)
for
x
in
atomList
])
)
fh
.
write
(
"set bonds {%s}
\n
"
%
" "
.
join
([
str
(
x
-
1
)
for
x
in
flat_push_bonds
])
)
fh
.
write
(
"""
if
interhelical_bonds
:
if
not
self
.
useTclForces
:
with
open
(
"%s.exb"
%
output_name
,
'a'
)
as
fh
:
for
i
,
j
in
push_bonds
:
fh
.
write
(
"bond %d %d %f %.2f
\n
"
%
(
i
,
j
,
1.0
,
31
))
else
:
flat_push_bonds
=
list
(
sum
(
push_bonds
))
atomList
=
list
(
set
(
flat_push_bonds
))
with
open
(
"%s.forces.tcl"
%
output_name
,
'w'
)
as
fh
:
fh
.
write
(
"set atomList {%s}
\n\n
"
%
" "
.
join
([
str
(
x
-
1
)
for
x
in
atomList
])
)
fh
.
write
(
"set bonds {%s}
\n
"
%
" "
.
join
([
str
(
x
-
1
)
for
x
in
flat_push_bonds
])
)
fh
.
write
(
"""
foreach atom $atomList {
addatom $atom
}
...
...
Write
Preview
Markdown
is supported
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