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
3268d1e7
Commit
3268d1e7
authored
Aug 02, 2017
by
cmaffeo2
Browse files
Updated pdb writers so resid is left justified, system dimensions are 1000 AA
parent
0b4849e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
atomicModel.py
View file @
3268d1e7
...
...
@@ -914,7 +914,7 @@ class atomicModel():
open
(
"%s.psf"
%
prefix
,
'w'
)
as
psf
:
## Write headers
pdb
.
write
(
"CRYST1 1
.
000 1
.
000 1
.
000 90.00 90.00 90.00 P 1 1
\n
"
)
pdb
.
write
(
"CRYST1 1000
.
1000
.
1000
.
90.00 90.00 90.00 P 1 1
\n
"
)
psf
.
write
(
"PSF NAMD
\n\n
"
)
# create NAMD formatted psf
psf
.
write
(
"{:>8d} !NTITLE
\n\n
"
.
format
(
0
))
...
...
beadModel.py
View file @
3268d1e7
...
...
@@ -858,10 +858,10 @@ class beadModel():
def
writePdb
(
self
,
filename
):
with
open
(
filename
,
'w'
)
as
fh
:
## Write header
fh
.
write
(
"CRYST1 1
.
000 1
.
000 1
.
000 90.00 90.00 90.00 P 1 1
\n
"
)
fh
.
write
(
"CRYST1 1000
.
1000
.
1000
.
90.00 90.00 90.00 P 1 1
\n
"
)
## Write coordinates
formatString
=
"ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s}
{:>5s}
{:1s}
{:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}
\n
"
formatString
=
"ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s}{:>5s}
{:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}
\n
"
for
n
,
hid
,
zid
in
self
.
particles
:
## http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#ATOM
idx
=
n
.
idx
...
...
@@ -873,11 +873,11 @@ class beadModel():
beta
=
zid
x
,
y
,
z
=
[
x
for
x
in
n
.
position
]
assert
(
idx
<
1
00000
)
assert
(
idx
<
1
e5
)
resid
=
"{:<4d}"
.
format
(
idx
)
fh
.
write
(
formatString
.
format
(
idx
,
name
[:
1
],
""
,
resname
,
chain
,
resid
,
""
,
x
,
y
,
z
,
occ
,
beta
,
""
,
charge
))
idx
,
name
[:
1
],
""
,
resname
,
chain
,
resid
,
x
,
y
,
z
,
occ
,
beta
,
""
,
charge
))
return
def
writePsf
(
self
,
filename
):
...
...
beadModelTwist.py
View file @
3268d1e7
...
...
@@ -952,10 +952,10 @@ class beadModelTwist():
def
writePdb
(
self
,
filename
):
with
open
(
filename
,
'w'
)
as
fh
:
## Write header
fh
.
write
(
"CRYST1 1
.
000 1
.
000 1
.
000 90.00 90.00 90.00 P 1 1
\n
"
)
fh
.
write
(
"CRYST1 1000
.
1000
.
1000
.
90.00 90.00 90.00 P 1 1
\n
"
)
## Write coordinates
formatString
=
"ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s}
{:>5s}
{:1s}
{:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}
\n
"
formatString
=
"ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s}{:>5s}
{:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}
\n
"
for
n
,
hid
,
zid
in
self
.
particles
:
## http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#ATOM
idx
=
n
.
idx
...
...
@@ -967,11 +967,11 @@ class beadModelTwist():
beta
=
zid
x
,
y
,
z
=
[
x
for
x
in
n
.
position
]
assert
(
idx
<
1
00000
)
assert
(
idx
<
1
e5
)
resid
=
"{:<4d}"
.
format
(
idx
)
fh
.
write
(
formatString
.
format
(
idx
,
name
[:
1
],
""
,
resname
,
chain
,
resid
,
""
,
x
,
y
,
z
,
occ
,
beta
,
""
,
charge
))
idx
,
name
[:
1
],
""
,
resname
,
chain
,
resid
,
x
,
y
,
z
,
occ
,
beta
,
""
,
charge
))
return
def
writePsf
(
self
,
filename
):
...
...
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