Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pycgtool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Graham
pycgtool
Commits
b19c5324
Commit
b19c5324
authored
4 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
style: resolve a couple of linting complaints
parent
0dbce7d5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pycgtool/__main__.py
+13
-13
13 additions, 13 deletions
pycgtool/__main__.py
with
13 additions
and
13 deletions
pycgtool/__main__.py
+
13
−
13
View file @
b19c5324
...
...
@@ -45,7 +45,7 @@ class PyCGTOOL:
frame_number
=
0
)
if
self
.
out_frame
.
n_frames
>
1
:
self
.
train_backmapper
(
self
.
in_frame
,
self
.
out_frame
)
self
.
train_backmapper
()
self
.
bondset
=
None
if
self
.
config
.
bondset
:
...
...
@@ -93,7 +93,8 @@ class PyCGTOOL:
self
.
config
.
out_dir
)
logger
.
info
(
'
Finished writing bond measurements to file
'
)
def
get_coords
(
self
,
frame
:
Frame
,
resname
:
str
)
->
np
.
ndarray
:
@staticmethod
def
get_coords
(
frame
:
Frame
,
resname
:
str
)
->
np
.
ndarray
:
return
np
.
concatenate
([
frame
.
_trajectory
.
atom_slice
(
[
atom
.
index
for
atom
in
residue
.
atoms
]).
xyz
...
...
@@ -101,15 +102,16 @@ class PyCGTOOL:
if
residue
.
name
==
resname
])
def
train_backmapper
(
self
,
aa_frame
:
Frame
,
cg_frame
:
Frame
):
def
train_backmapper
(
self
):
# resname = 'POPC'
# aa_coords = get_coords(aa_frame, resname)
# cg_coords = get_coords(cg_frame, resname)
sel
=
'
resid 0
'
cg
_subset_traj
=
cg
_frame
.
_trajectory
.
atom_slice
(
cg
_frame
.
_trajectory
.
topology
.
select
(
'
resid 0
'
))
aa
_subset_traj
=
aa
_frame
.
_trajectory
.
atom_slice
(
aa
_frame
.
_trajectory
.
topology
.
select
(
'
resid 0
'
))
aa
_subset_traj
=
self
.
in
_frame
.
_trajectory
.
atom_slice
(
self
.
in
_frame
.
_trajectory
.
topology
.
select
(
sel
))
cg
_subset_traj
=
self
.
out
_frame
.
_trajectory
.
atom_slice
(
self
.
out
_frame
.
_trajectory
.
topology
.
select
(
sel
))
cg_subset_traj
.
save
(
'
cg_test.gro
'
)
aa_subset_traj
.
save
(
'
aa_test.gro
'
)
...
...
@@ -143,13 +145,12 @@ class BooleanAction(argparse.Action):
def
parse_arguments
(
arg_list
):
# yapf: disable
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
,
description
=
"
Generate coarse-grained molecular dynamics models from atomistic trajectories.
"
description
=
"
Generate coarse-grained molecular dynamics models from atomistic trajectories.
"
)
# yapf: disable
# Input files
input_files
=
parser
.
add_argument_group
(
"
input files
"
)
...
...
@@ -298,9 +299,8 @@ def main():
pycgtool
=
PyCGTOOL
(
args
)
elapsed_time
=
time
.
time
()
-
start_time
logger
.
info
(
f
'
Processed
{
pycgtool
.
out_frame
.
n_frames
}
frames in
{
elapsed_time
:
.
2
f
}
s
'
)
logger
.
info
(
'
Processed %d frames in %.2f s
'
,
pycgtool
.
out_frame
.
n_frames
,
elapsed_time
)
logger
.
info
(
'
Finished processing - goodbye!
'
)
except
Exception
as
exc
:
...
...
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