From 78f507a2d831865b1f3ead7dc5870013c60edf2f Mon Sep 17 00:00:00 2001 From: Timothy Click Date: Mon, 8 Jul 2019 14:44:49 +0800 Subject: [PATCH 1/2] Fix output of ATOM section. Signed-off-by: Timothy Click --- src/fluctmatch/topology/RTF.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fluctmatch/topology/RTF.py b/src/fluctmatch/topology/RTF.py index 6a6fc4c..941ae64 100755 --- a/src/fluctmatch/topology/RTF.py +++ b/src/fluctmatch/topology/RTF.py @@ -116,7 +116,7 @@ def _write_residues(self, residue): key = "ATOM" atoms = residue.atoms lines = ((atoms.names, atoms.types, atoms.charges) - if not np.issubdtype(atoms.types.dtype, np.signedinteger) else + if np.issubdtype(atoms.types.dtype, np.signedinteger) else (atoms.names, atoms.names, atoms.charges)) lines = pd.concat([pd.Series(_) for _ in lines], axis=1) np.savetxt(self.rtffile, lines, fmt=native_str(self.fmt[key])) From 3f94583ff9863c5e6939a040cc5cfa926a4cf7b2 Mon Sep 17 00:00:00 2001 From: Timothy Click Date: Mon, 8 Jul 2019 14:46:08 +0800 Subject: [PATCH 2/2] Correct DCD start time and add subcommand for splitting Gromacs trajectories. Signed-off-by: Timothy Click --- src/fluctmatch/fluctmatch/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fluctmatch/fluctmatch/utils.py b/src/fluctmatch/fluctmatch/utils.py index 1c61511..d00fd4d 100644 --- a/src/fluctmatch/fluctmatch/utils.py +++ b/src/fluctmatch/fluctmatch/utils.py @@ -23,7 +23,6 @@ from future.builtins import (dict, super) from future.utils import (PY2, native_str) -import copy import logging import os import subprocess @@ -36,7 +35,6 @@ import pandas as pd import MDAnalysis as mda import MDAnalysis.analysis.base as analysis -from MDAnalysis.coordinates import memory from MDAnalysis.lib import util as mdutil from fluctmatch.fluctmatch.data import charmm_split @@ -237,16 +235,16 @@ def write_charmm_files(universe, # Write the new trajectory in Gromacs XTC format. if write_traj: + universe.trajectory.rewind() with mda.Writer( native_str(filenames["traj_file"]), universe.atoms.n_atoms, - istart=None, + istart=universe.trajectory.time, remarks="Written by fluctmatch.") as trj: logger.info("Writing the trajectory {}...".format( filenames["traj_file"])) logger.warning("This may take a while depending upon the size and " "length of the trajectory.") - universe.trajectory.rewind() with click.progressbar(universe.trajectory) as bar: for ts in bar: trj.write(ts) @@ -336,6 +334,7 @@ def split_gmx(info, data_dir=path.join(os.getcwd(), "data"), **kwargs): if index is not None: command = [ "gmx", + "trjconv", "-s", topology, "-f",