Goodman-lab / DP5

Python workflow for DP5 and DP4 analysis of organic molecules
Other
173 stars 99 forks source link

Installing the DP4-AI GUI on Windows for a less-experienced user #19

Closed usmanhs closed 4 years ago

usmanhs commented 4 years ago

I would like to try out the DP4-AI on some Bruker NMR files using the GUI but I am unsure on how to correctly install it.

My programming/python skills are quite limited and I've started to follow the Anaconda instructions detailed in Issue #12 but I got stuck because I'm not sure where and how I can create an virtual environment, in particular how to 'launch' :

conda create --name dp4 for example

Any help with getting the GUI running would be great!

KristapsE commented 4 years ago

Hi, thank you for the interest in trying out DP4-AI!

What operating system are you running this on? If dp4 will be the only package that uses python and you have root privileges, virtual environment is not required. Once you have conda working (with or without virtual environment) you will need to install all the Python libraries noted in the github README page to run the workflow. I suggest looking for each of the packages in turn here: https://anaconda.org/ (search Anaconda cloud) and then copy/paste the suggested command to install the package. For example:

conda install -c bioconda nmrglue conda install -c rdkit rdkit

etc.

Also, to predict the NMR shifts, you will need a molecular mechanics software package (either TINKER or MacroModel) and a DFT package (Gaussian and NWChem are currently supported). TINKER and NWChem are both open source and can be downloaded online from their websites. Then you will need to make some minor modifications to the DP4-AI script to ensure that the script knows how to launch the molecular mechanics and DFT software to perform the NMR calculations.

To test that the workflow works, please make use of the raw NMR data and the computational data we used to develop the software - the full set has been released on Cambridge repository:

https://www.repository.cam.ac.uk/handle/1810/303161

Finally, to launch:

To call the script from the Graphical User Interface, the folder containing the input files must be opened in terminal and the correct python environment activated. The GUI is then simply called by:

python PyDP4_GUI.py

This will open the main DP4-AI GUI window, the user can then select the required input files and the settings for MM and DFT calculations. The expected structure file format is *.sdf

To call the script from terminal:

(With all diastereomer generation)

PyDP4.py Candidate CandidateNMR

where Candidate is the sdf file containing 3D coordinates of the candidate structure (without the extension).

DP4-AI will automatically detect whether an NMR description (see below) or raw NMR data has been provided by the user. If raw NMR data has been provided (currently in the Bruker file format), NMR-AI will automatically process the NMR spectra provided. In this case the NMR data should be organised into a single folder (passed to DP4-AI) containing one or two folders labelled Proton and (or) Carbon.

KristapsE commented 4 years ago

If you don't have root privileges or you have other packages that use Python, using conda environments is much preferred. The installation is pretty much the same, with a few extra steps.

To create empty environment: conda create --name dp4

then to make it the active python environment: conda activate dp4

Now only the python interpreter in dp4 environment will be called, and any packages installed will only affect this particular python environment. The environments are also usually in user space, so, there is no need for root/administrator privileges on the system, Install the required packages as above, launch DP4-AI as above.

After work, to return to the default system python environment, deactivate the environment by calling: conda deactivate

usmanhs commented 4 years ago

Thank for your quick response and support!

I have a windows 10 machine if that helps. I'll follow your link to search/ download the required packages, but one question: do I copy these commands into Anaconda Prompt or Anaconda Powershell Prompt or Jupiter Notebook/Spyder? Anaconda installed all these programs.

I don't have other packages running Python so yes maybe I don't need to use environments.

KristapsE commented 4 years ago

https://docs.anaconda.com/anaconda/install/verify-install/

This would seem to suggest Anaconda Prompt. If during the installation you opt to add conda to PATH (not recommended by the installer), then you can run it from the standard windows command prompt as well.

usmanhs commented 4 years ago

Thank you! I'll work through this and hopefully give an update on my progress installing DP4 soon!

usmanhs commented 4 years ago

So quick update: I've downloaded most of the packages via conda but I am having trouble with a few. NMRglue using the anaconda repository is not available for Windows 64 bit, and from the NMRglue website I can not find the 'binary installer'. Also I am not sure if I have correctly installed TINKER as I've downloaded the Tinker Executables from here but feel like I'm missing something. Any suggestions? Thanks!

KristapsE commented 4 years ago

You could try and install the nmr glue from the wheel file here: https://github.com/jjhelmus/nmrglue/releases

Download the whl file, get the conda prompt, then do pip install C:/some-dir/some-file.whl as described here: https://stackoverflow.com/questions/27885397/how-do-i-install-a-python-package-with-a-whl-file

For TINKER you will also need the force field parameter files and put them in the right directory. Try running TINKER conformational search via scan executable manually from command line to make sure that TINKER works correctly.

You will also need to replace the sdf2tinkerxyz Linux binary in your DP4-AI folder with the windows analog from here: http://sdf2xyz2sdf.sourceforge.net/?Downloads

usmanhs commented 4 years ago

I could install nmrglue from the method you've described - thank you!

I've also downloaded and installed the Tinker-FFE. I'm not sure which force field parameter files are required, there's quite a few listed on the Tinker website. Should I put these into the DP4-AI directory?

For NWChem, I found that it's not so simple to download and install and came across this Windows 10 guide. Do you think this way would work even though I am using Windows not ubuntu?

PS: I appreciate all of the help given! Installing this software seems harder than I thought!

KristapsE commented 4 years ago

Windows 10 does have a full Linux-subsystem available, if installed, I use it all the time. If nwchem can be installed that way, that will probably be the easiest way to achieve that - however, I am not sure how would PyDP4 call it from a windows Python interpreter... It looks like having a proper NWChem on Windows requires compiling it yourself, which is not a process I would suggest to a less experienced user.

The installation would be a fair bit easier on Linux, I'm afraid, windows is not particularly convenient for computational stuff. Things can be made to work on it, it just takes fair bit more work. Would you consider installing Linux side-by-side with windows on your machine? Or perhaps a Linux virtual machine?

usmanhs commented 4 years ago

Thank you for the advice! I can try creating a Linux virtual machine on Windows 10. Is there a particular method and version of Linux you would recommend that would work best with your software?

KristapsE commented 4 years ago

We did all our development on Ubuntu 16.04 and 18.04. I think Ubuntu 18.04 or 20.04 would be a safe bet, but other modern Linux flavours should work reasonably well too.

I haven't used virtual machines too much, but they seem quite straightforward to use - definitely easier than cross-compiling NWChem for running on Windows!

usmanhs commented 4 years ago

Thank you! I will give that a try - I hope it would be possible to transfer some of the NMR data from windows to the virtual machine so that your software could read it.

Will keep you posted (and maybe I will start another thread instead of cluttering this one if I have problems with installation of your software on linux.)

KristapsE commented 4 years ago

Thanks, that sounds like a good idea - I will close this issue then.