Skip to main content

A molecule reading/writing and manipulation package.

Project description

MoleculeKit

Conda codecov

A molecule manipulation library

Getting started

We recommend installing Miniconda on your machine to better manage python packages and environments.

You can install moleculekit either in the "base" conda environment or in a new conda environment. We recommend the second.

Install it into the base conda environment

With conda

Installation Instructions

With pip

The pip version of moleculekit is VERY limited and not officially supported. Use at your own risk.

(base) user@computer:~$ pip install moleculekit

Optional dependencies of moleculekit

Moleculekit has a small number of optional dependencies which are needed for some of it's functionalities. They were not added to the default dependencies to keep moleculekit a fast and small installation and to avoid unnecessary conflicts with other software. However if you want to leverage all of it's functionality you can install the rest of the dependencies with the following command:

(moleculekit) user@computer:~$ wget https://raw.githubusercontent.com/Acellera/moleculekit/master/extra_requirements.txt
(moleculekit) user@computer:~$ conda install --file extra_requirements.txt -c acellera

Using moleculekit in ipython

Install ipython in the correct conda enviroment using the following command. If you have installed the extra dependencies as above, you can skip this step since it already installs ipython.

(moleculekit) user@computer:~$ conda install ipython

Now you can start an ipython console with

(moleculekit) user@computer:~$ ipython

In the ipython console you can now import any of the modules of moleculekit and use it as normal.

from moleculekit.molecule import Molecule

mol = Molecule('3ptb')
mol.view()

API

For the official documentation of the moleculekit API head over to https://software.acellera.com/moleculekit/index.html

Issues

For any bugs or questions on usage feel free to use the issue tracker of this github repo.

Dev

If you are using moleculekit without installing it by using the PYTHONPATH env var you will need to compile the C++ extensions in-place with the following command:

python setup.py build_ext --inplace

Building for WebAssembly

Install emscripten https://emscripten.org/docs/getting_started/downloads.html

mamba create -n pyodide-build
mamba activate pyodide-build
mamba install python=3.11
pip install pyodide-build==0.25.1

# Activate the emscripten environment
cd ../emsdk
./emsdk install 3.1.46
./emsdk activate 3.1.46
source emsdk_env.sh
cd -

# Build the package
export PYO3_CROSS_INCLUDE_DIR="HACK"
export PYO3_CROSS_LIB_DIR="HACK"
rm -rf .pyodide-xbuildenv
pyodide build -o dist_pyodide
cp dist_pyodide/*.whl test_wasm/wheels/
cd test_wasm
python3 -m http.server

If you get an error at building about numpy missing, check this issue https://github.com/pyodide/pyodide/issues/4347

Debugging segmentation faults in Cython part

  1. Put a reproducible script in a file like segfault.py
  2. Modify setup.py to have -g as compile flag instead of -O3
  3. Recompile extensions with python setup.py build_ext --inplace
  4. Execute script with gdb like gdb --args python segfault.py
  5. Execute run and then bt 10 to show the backtrace
  6. Have fun

Citing MoleculeKit

If you use this software in your publication please cite:

Stefan Doerr, Matthew J. Harvey, Frank Noé, and Gianni De Fabritiis. HTMD: High-throughput molecular dynamics for molecular discovery. Journal of Chemical Theory and Computation, 2016, 12 (4), pp 1845–1852. doi:10.1021/acs.jctc.6b00049

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moleculekit-1.9.16.tar.gz (6.8 MB view details)

Uploaded Source

File details

Details for the file moleculekit-1.9.16.tar.gz.

File metadata

  • Download URL: moleculekit-1.9.16.tar.gz
  • Upload date:
  • Size: 6.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for moleculekit-1.9.16.tar.gz
Algorithm Hash digest
SHA256 f28bd6ec348541c4cce301d15336c805a77ab283c42743c36895d7b86960a19c
MD5 c762d3fde29f1234164e3b3f987411c7
BLAKE2b-256 9d593af7227939688a80bbb55505a3f02deae2fb0dd5367c7a79eecae2838a63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page