Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Can't convert Amber's trajectories with MDAnalysis #64

Open
vsheg opened this issue Jan 14, 2022 · 2 comments
Open

[QUESTION] Can't convert Amber's trajectories with MDAnalysis #64

vsheg opened this issue Jan 14, 2022 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@vsheg
Copy link

vsheg commented Jan 14, 2022

Hello, I've installed taurenmd via pip and I've tried to convert .nc trajectory to the .dcd format. I know, that MDAnalysis is capable of doing it natively, but when I try to do this with taurenmd:

$ taurenmd trajedit top.prmtop traj.nc -d traj.dcd

I see

ModuleNotFoundError: No module named 'mdtraj'

and then, after installation of mdtraj:

ModuleNotFoundError: No module named 'simtk.openmm'

How I can use taurenmd to convert trajectory without mdtraj, simtk.openmm , etc., using only MDAnalysis? Thanks for your attention

@vsheg vsheg added the question Further information is requested label Jan 14, 2022
@joaomcteixeira
Copy link
Owner

Hi @vsheg , Thanks for using taurenmd!

If you installed taurenmd from pip both MDAnalysis v2 and mdtraj should be installed.
taurenmd tries to load the topology and the trajectory first with mdanalysis and only if it can't, taurenmd attempts reading the topology with openmm and passing it to mdanalysis universe creation. The conversion itself by trajedit will always use mdanalysis. If you say the mdanalysis reads Amber files by default, we may need to investigate the error further. If you can give me some dummy Amber topology and traj that I can test locally would be great.

Otherwise, for now, you can try to install all dependencies using Anaconda and installing on top just the taurenmd python code:

git clone https://github.com/joaomcteixeira/taurenmd
cd taurenmd
conda create -n taurenmd python=3.8
conda env update -n taurenmd --file requirements-dev.yml
python setup.py develop --no-deps

This should work. Otherwise, let me know. Many improvements will be done after #60. Looking forward to merging that pull request in the following days. After that PR, I will also review/update the installation instructions.

If you want to look further into the code to try to solve the problem yourself and make a PRs the function that reads the trajectories is here:

def load_universe(

@vsheg
Copy link
Author

vsheg commented Jan 15, 2022

Thanks for your reply. I don't think I'm able to look at the PR or code in a meaningful way. I just write an instruction on how to reproduce this behavior. I hope it will be useful. This archive taurenmd-test.zip contains all needed files.


I tried to create a new Python environment with Poetry (it's just a wrapper for pip)

$ poetry init # init Poetry environment
<...>

$ poetry env use 3.9 # specify Python version to use
$ poetry add taurenmd # MDAnalysis won't be installed
$ poetry add MDAnalysis # add it explicitly
$ poetry update # update environment (not necessary, I guess)
$ poetry shell # activate the environment 

# try to convert 
$ taurenmd trajedit trpzip2.ff10.mbondi.parm7 trpzip2.gb.nc -d traj.dcd
<...>
ModuleNotFoundError: No module named 'mdtraj'

To install this environment, just unpack the attached archive and then

$ cd taurenmd-test
$ poetry install # install environment and dependencies 
$ poetry shell # activate environment

(Poetry can be installed with pip3 install poetry)


In the archive :

  • pyproject.toml and poetry.lock are generated by Poetry
  • trpzip2.ff10.mbondi.parm7 and trpzip2.gb.nc are taken from the Amber documentation
  • mda.py is a Python script that converts .nc to .dcd using pure MDAnalysis
  • pure-mda.dcd is a result of
$ python3 mda.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants