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", 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]))