diff --git a/src/molutils.jl b/src/molutils.jl index 37de009..18c57ea 100644 --- a/src/molutils.jl +++ b/src/molutils.jl @@ -138,4 +138,10 @@ function save_trajectory(filename, coords::AbstractMatrix; top::String) xyz = reshape(coords, 3, :, size(coords, 2)) traj.xyz = PyReverseDims(xyz) traj.save(filename) +end + +function atom_indices(filename::String, selector::String) + mdtraj = pyimport_conda("mdtraj", "mdtraj", "conda-forge") + traj = mdtraj.load(filename, stride=-1) + inds = traj.top.select(selector) .+ 1 end \ No newline at end of file