diff --git a/examples/gromacs/repo_files/client.py b/examples/gromacs/repo_files/client.py index 9078bd3..bd9da52 100644 --- a/examples/gromacs/repo_files/client.py +++ b/examples/gromacs/repo_files/client.py @@ -1,7 +1,7 @@ from imdclient.IMD import IMDReader import MDAnalysis as mda import logging -from imdclient.tests.datafiles import NAMD_TOPOL +from imdclient.tests.datafiles import GROMACS_TOP logger = logging.getLogger("imdclient.IMDClient") file_handler = logging.FileHandler("imdreader.log") @@ -13,7 +13,7 @@ logger.setLevel(logging.INFO) i = 0 -u = mda.Universe(NAMD_TOPOL, "imd://localhost:8888") +u = mda.Universe(GROMACS_TOP, "imd://localhost:8888") for ts in u.trajectory: i += 1 diff --git a/examples/gromacs/slurm/client.py b/examples/gromacs/slurm/client.py index e36d26e..8b3dc26 100644 --- a/examples/gromacs/slurm/client.py +++ b/examples/gromacs/slurm/client.py @@ -2,6 +2,7 @@ from imdclient.IMD import IMDReader import MDAnalysis as mda import logging +from imdclient.tests.datafiles import GROMACS_TOP logger = logging.getLogger("imdclient.IMDClient") file_handler = logging.FileHandler("imdreader.log") @@ -13,7 +14,7 @@ logger.setLevel(logging.INFO) i = 0 -u = mda.Universe("md.tpr", "imd://localhost:8888") +u = mda.Universe(GROMACS_TOP, "imd://localhost:8888") for ts in u.trajectory: i += 1 diff --git a/examples/gromacs/slurm/md.cpt b/examples/gromacs/slurm/md.cpt deleted file mode 100644 index c241b37..0000000 Binary files a/examples/gromacs/slurm/md.cpt and /dev/null differ diff --git a/examples/gromacs/slurm/md.edr b/examples/gromacs/slurm/md.edr deleted file mode 100644 index 8529ea8..0000000 Binary files a/examples/gromacs/slurm/md.edr and /dev/null differ diff --git a/examples/gromacs/slurm/md.tpr b/examples/gromacs/slurm/md.tpr deleted file mode 100644 index fdb3f15..0000000 Binary files a/examples/gromacs/slurm/md.tpr and /dev/null differ diff --git a/examples/gromacs/slurm/md.trr b/examples/gromacs/slurm/md.trr deleted file mode 100644 index 41de280..0000000 Binary files a/examples/gromacs/slurm/md.trr and /dev/null differ diff --git a/examples/gromacs/slurm/md.xvg b/examples/gromacs/slurm/md.xvg deleted file mode 100644 index 1be828e..0000000 --- a/examples/gromacs/slurm/md.xvg +++ /dev/null @@ -1,23 +0,0 @@ -# Note that you can select an IMD index group in the .mdp file if a subset of the atoms suffices. -# This file was created Sat Jun 8 18:48:17 2024 -# Created by: -# :-) GROMACS - gmx mdrun, 2023.3 (-: -# -# Executable: /nfs/packages/opt/Linux_x86_64/gromacs/2023.3/cuda12.3/gnu-11.4.0/avx2/bare/bin/gmx -# Data prefix: /nfs/packages/opt/Linux_x86_64/gromacs/2023.3/cuda12.3/gnu-11.4.0/avx2/bare -# Working dir: /nfs/homes3/ljwoods2/workspace/imdreader -# Command line: -# gmx mdrun -s example/slurm_example/md.tpr -deffnm example/slurm_example/md -nt 16 -imdwait -maxh 0.03 -# gmx mdrun is part of G R O M A C S: -# -# Green Red Orange Magenta Azure Cyan Skyblue -# -@ title "IMD Pull Forces" -@ xaxis label "Time (ps)" -@ yaxis label "# of Forces / Atom IDs / Forces (kJ/mol)" -# Can display and manipulate 146237 (of a total of 146237) atoms via IMD. -# column 1 : time (ps) -# column 2 : total number of atoms feeling an IMD pulling force at that time -# cols. 3.-6 : global atom number of pulled atom, x-force, y-force, z-force (kJ/mol) -# then follow : atom-ID, f[x], f[y], f[z] for more atoms in case the force on multiple atoms is changed simultaneously. -# Note that the force on any atom is always equal to the last value for that atom-ID found in the data. diff --git a/examples/gromacs/slurm/mdout.mdp b/examples/gromacs/slurm/mdout.mdp deleted file mode 100644 index 743d60d..0000000 --- a/examples/gromacs/slurm/mdout.mdp +++ /dev/null @@ -1,321 +0,0 @@ -; -; File 'mdout.mdp' was generated -; By user: ljwoods2 (1004) -; On host: mashteryoda -; At date: Sat Jun 8 18:23:47 2024 -; -; Created by: -; :-) GROMACS - gmx grompp, 2023.4-conda_forge (-: -; -; Executable: /nfs/homes3/ljwoods2/.conda/envs/streamreader/bin.AVX_256/gmx -; Data prefix: /nfs/homes3/ljwoods2/.conda/envs/streamreader -; Working dir: /nfs/homes3/ljwoods2/workspace/imdreader/example/slurm_example -; Command line: -; gmx grompp -f md.mdp -c s4_slotted_removed_cl.gro -n index.ndx -maxwarn 1 -o md.tpr - -; VARIOUS PREPROCESSING OPTIONS -; Preprocessor information: use cpp syntax. -; e.g.: -I/home/joe/doe -I/home/mary/roe -include = -; e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive) -define = - -; RUN CONTROL PARAMETERS -integrator = md -; Start time and timestep in ps -tinit = 0 -dt = 0.002 -nsteps = 25000000 -; For exact run continuation or redoing part of a run -init-step = 0 -; Part index is updated automatically on checkpointing (keeps files separate) -simulation-part = 1 -; Multiple time-stepping -mts = no -; mode for center of mass motion removal -comm_mode = linear -; number of steps for center of mass motion removal -nstcomm = 100 -; group(s) for center of mass motion removal -comm_grps = PROT MEMB SOL_ION - -; LANGEVIN DYNAMICS OPTIONS -; Friction coefficient (amu/ps) and random seed -bd-fric = 0 -ld-seed = -1 - -; ENERGY MINIMIZATION OPTIONS -; Force tolerance and initial step-size -emtol = 10 -emstep = 0.01 -; Max number of iterations in relax-shells -niter = 20 -; Step size (ps^2) for minimization of flexible constraints -fcstep = 0 -; Frequency of steepest descents steps when doing CG -nstcgsteep = 1000 -nbfgscorr = 10 - -; TEST PARTICLE INSERTION OPTIONS -rtpi = 0.05 - -; OUTPUT CONTROL OPTIONS -; Output frequency for coords (x), velocities (v) and forces (f) -nstxout = 50000 -nstvout = 50000 -nstfout = 0 -; Output frequency for energies to log file and energy file -nstlog = 500 -nstcalcenergy = 100 -nstenergy = 300 -; Output frequency and precision for .xtc file -nstxout-compressed = 0 -compressed-x-precision = 1000 -; This selects the subset of atoms for the compressed -; trajectory file. You can select multiple groups. By -; default, all atoms will be written. -compressed-x-grps = -; Selection of energy groups -energygrps = - -; NEIGHBORSEARCHING PARAMETERS -; cut-off scheme (Verlet: particle based cut-offs) -cutoff-scheme = Verlet -; nblist update frequency -nstlist = 20 -; Periodic boundary conditions: xyz, no, xy -pbc = xyz -periodic-molecules = no -; Allowed energy error due to the Verlet buffer in kJ/mol/ps per atom, -; a value of -1 means: use rlist -verlet-buffer-tolerance = 0.005 -; nblist cut-off -rlist = 1.2 -; long-range cut-off for switched potentials - -; OPTIONS FOR ELECTROSTATICS AND VDW -; Method for doing electrostatics -coulombtype = pme -coulomb-modifier = Potential-shift-Verlet -rcoulomb-switch = 0 -rcoulomb = 1.2 -; Relative dielectric constant for the medium and the reaction field -epsilon-r = 1 -epsilon-rf = 0 -; Method for doing Van der Waals -vdwtype = Cut-off -vdw-modifier = Force-switch -; cut-off lengths -rvdw_switch = 1.0 -rvdw = 1.2 -; Apply long range dispersion corrections for Energy and Pressure -DispCorr = No -; Extension of the potential lookup tables beyond the cut-off -table-extension = 1 -; Separate tables between energy group pairs -energygrp-table = -; Spacing for the PME/PPPM FFT grid -fourierspacing = 0.12 -; FFT grid size, when a value is 0 fourierspacing will be used -fourier-nx = 0 -fourier-ny = 0 -fourier-nz = 0 -; EWALD/PME/PPPM parameters -pme-order = 4 -ewald-rtol = 1e-05 -ewald-rtol-lj = 0.001 -lj-pme-comb-rule = Geometric -ewald-geometry = 3d -epsilon-surface = 0 -implicit-solvent = no - -; OPTIONS FOR WEAK COUPLING ALGORITHMS -ensemble-temperature-setting = auto -ensemble-temperature = -1 -; Temperature coupling -tcoupl = v-rescale -nsttcouple = -1 -nh-chain-length = 10 -print-nose-hoover-chain-variables = no -; Groups to couple separately -tc_grps = PROT MEMB SOL_ION -; Time constant (ps) and reference temperature (K) -tau_t = 1.0 1.0 1.0 -ref_t = 310 310 310 -; pressure coupling -pcoupl = Parrinello-Rahman -pcoupltype = semiisotropic -nstpcouple = -1 -; Time constant (ps), compressibility (1/bar) and reference P (bar) -tau_p = 5.0 -compressibility = 4.5e-5 4.5e-5 -ref_p = 1.0 1.0 -; Scaling of reference coordinates, No, All or COM -refcoord_scaling = com - -; OPTIONS FOR QMMM calculations -QMMM = no -; Groups treated with MiMiC -QMMM-grps = - -; SIMULATED ANNEALING -; Type of annealing for each temperature group (no/single/periodic) -annealing = -; Number of time points to use for specifying annealing in each group -annealing-npoints = -; List of times at the annealing points for each group -annealing-time = -; Temp. at each annealing point, for each group. -annealing-temp = - -; GENERATE VELOCITIES FOR STARTUP RUN -gen-vel = no -gen-temp = 300 -gen-seed = -1212174366 - -; OPTIONS FOR BONDS -constraints = h-bonds -; Type of constraint algorithm -constraint_algorithm = LINCS -; Do not constrain the start configuration -continuation = yes -; Use successive overrelaxation to reduce the number of shake iterations -Shake-SOR = no -; Relative tolerance of shake -shake-tol = 0.0001 -; Highest order in the expansion of the constraint coupling matrix -lincs-order = 4 -; Number of iterations in the final step of LINCS. 1 is fine for -; normal simulations, but use 2 to conserve energy in NVE runs. -; For energy minimization with constraints it should be 4 to 8. -lincs-iter = 1 -; Lincs will write a warning to the stderr if in one step a bond -; rotates over more degrees than -lincs-warnangle = 30 -; Convert harmonic bonds to morse potentials -morse = no - -; ENERGY GROUP EXCLUSIONS -; Pairs of energy groups for which all non-bonded interactions are excluded -energygrp-excl = - -; WALLS -; Number of walls, type, atom types, densities and box-z scale factor for Ewald -nwall = 0 -wall-type = 9-3 -wall-r-linpot = -1 -wall-atomtype = -wall-density = -wall-ewald-zfac = 3 - -; COM PULLING -pull = no - -; AWH biasing -awh = no - -; ENFORCED ROTATION -; Enforced rotation: No or Yes -rotation = no - -; Group to display and/or manipulate in interactive MD session -IMD-group = System - -; NMR refinement stuff -; Distance restraints type: No, Simple or Ensemble -disre = No -; Force weighting of pairs in one distance restraint: Conservative or Equal -disre-weighting = Conservative -; Use sqrt of the time averaged times the instantaneous violation -disre-mixed = no -disre-fc = 1000 -disre-tau = 0 -; Output frequency for pair distances to energy file -nstdisreout = 100 -; Orientation restraints: No or Yes -orire = no -; Orientation restraints force constant and tau for time averaging -orire-fc = 0 -orire-tau = 0 -orire-fitgrp = -; Output frequency for trace(SD) and S to energy file -nstorireout = 100 - -; Free energy variables -free-energy = no -couple-moltype = -couple-lambda0 = vdw-q -couple-lambda1 = vdw-q -couple-intramol = no -init-lambda = -1 -init-lambda-state = -1 -delta-lambda = 0 -nstdhdl = 50 -fep-lambdas = -mass-lambdas = -coul-lambdas = -vdw-lambdas = -bonded-lambdas = -restraint-lambdas = -temperature-lambdas = -calc-lambda-neighbors = 1 -init-lambda-weights = -dhdl-print-energy = no -sc-function = beutler -sc-alpha = 0 -sc-power = 1 -sc-r-power = 6 -sc-sigma = 0.3 -sc-coul = no -sc-gapsys-scale-linpoint-lj = 0.85 -sc-gapsys-scale-linpoint-q = 0.3 -sc-gapsys-sigma-lj = 0.3 -separate-dhdl-file = yes -dhdl-derivatives = yes -dh_hist_size = 0 -dh_hist_spacing = 0.1 - -; Non-equilibrium MD stuff -acc-grps = -accelerate = -freezegrps = -freezedim = -cos-acceleration = 0 -deform = - -; simulated tempering variables -simulated-tempering = no -simulated-tempering-scaling = geometric -sim-temp-low = 300 -sim-temp-high = 300 - -; Ion/water position swapping for computational electrophysiology setups -; Swap positions along direction: no, X, Y, Z -swapcoords = no -adress = no - -; User defined thingies -user1-grps = -user2-grps = -userint1 = 0 -userint2 = 0 -userint3 = 0 -userint4 = 0 -userreal1 = 0 -userreal2 = 0 -userreal3 = 0 -userreal4 = 0 -; Electric fields -; Format for electric-field-x, etc. is: four real variables: -; amplitude (V/nm), frequency omega (1/ps), time for the pulse peak (ps), -; and sigma (ps) width of the pulse. Omega = 0 means static field, -; sigma = 0 means no pulse, leaving the field to be a cosine function. -electric-field-x = 0 0 0 0 -electric-field-y = 0 0 0 0 -electric-field-z = 0 0 0 0 - -; Density guided simulation -density-guided-simulation-active = false - -; QM/MM with CP2K -qmmm-cp2k-active = false diff --git a/examples/lammps/repo_files/client.py b/examples/lammps/repo_files/client.py new file mode 100644 index 0000000..dae8f8e --- /dev/null +++ b/examples/lammps/repo_files/client.py @@ -0,0 +1,20 @@ +from imdclient.IMD import IMDReader +import MDAnalysis as mda +import logging +from imdclient.tests.datafiles import LAMMPS_TOPOL + +logger = logging.getLogger("imdclient.IMDClient") +file_handler = logging.FileHandler("imdreader.log") +formatter = logging.Formatter( + "%(asctime)s - %(name)s - %(levelname)s - %(message)s" +) +file_handler.setFormatter(formatter) +logger.addHandler(file_handler) +logger.setLevel(logging.INFO) + +i = 0 +u = mda.Universe(LAMMPS_TOPOL, "imd://localhost:8888") +for ts in u.trajectory: + i += 1 + +logger.info(f"Parsed {i} frames") diff --git a/examples/namd/repo_files/client.py b/examples/namd/repo_files/client.py index 2d6ac20..9078bd3 100644 --- a/examples/namd/repo_files/client.py +++ b/examples/namd/repo_files/client.py @@ -13,7 +13,7 @@ logger.setLevel(logging.INFO) i = 0 -u = mda.Universe(NAMD_TOPOL, "localhost:8888") +u = mda.Universe(NAMD_TOPOL, "imd://localhost:8888") for ts in u.trajectory: i += 1 diff --git a/imdclient/tests/datafiles.py b/imdclient/tests/datafiles.py index 6a1df38..830a043 100644 --- a/imdclient/tests/datafiles.py +++ b/imdclient/tests/datafiles.py @@ -14,7 +14,7 @@ "LAMMPS_IN_NST_8", "GROMACS_TRAJ", "GROMACS_MDP", - "GROMACS_TOP" "LAMMPS_IN_NST_1", + "GROMACS_TOP", "GROMACS_GRO", "GROMACS_MDP_NST_1", "GROMACS_MDP_NST_8",