Coder Social home page Coder Social logo

jecatosovic / conservedwatersearch Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 1.0 5.78 MB

Python module for identification of conserved water molecules from molecular dynamics trajectories.

Home Page: https://conservedwatersearch.readthedocs.io/en/latest/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

conservedwatersearch's Introduction

ConservedWaterSearch

https://readthedocs.org/projects/conservedwatersearch/badge/?version=latest

The ConservedWaterSearch (CWS) Python library uses density based clustering approach to detect conserved waters from simulation trajectories. First, positions of water molecules are determined based on clustering of oxygen atoms belonging to water molecules(see figure below for more information). Positions on water molecules can be determined using Multi Stage Re-Clustering (MSRC) approach or Single Clustering (SC) approach (see for more information on clustering procedures).

https://raw.githubusercontent.com/JecaTosovic/ConservedWaterSearch/main/docs/source/figs/Scheme.png

Conserved water molecules can be classified into 3 distinct conserved water types based on their hydrogen orientation: Fully Conserved Waters (FCW), Half Conserved Waters (HCW) and Weakly Conserved Waters (WCW) - see figure below for examples and more information or see CWS docs.

https://raw.githubusercontent.com/JecaTosovic/ConservedWaterSearch/main/docs/source/figs/WaterTypes.png

Both, MSRC and SC can be used with either OPTICS (via sklearn) and HDBSCAN. MSRC approach using either of the two algorithms produces better quality results at the cost of computational time, while SC approach produces lowe quality results at a fraction of the computational cost.

Important links

Related Tools

Citation

See this article.

Installation

The easiest ways to install ConservedWaterSearch is to install it from conda-forge using conda:

conda install -c conda-forge ConservedWaterSearch

CWS can also be installed from PyPI (using pip). To install via pip use:

pip install ConservedWaterSearch

Optional visualization dependencies

nglview can be installed from PyPI (pip) or conda or when installing CWS through pip by using pip install ConservedWaterSearch[nglview]. PyMOL is the recomended visualization tool for CWS and can be installed only using conda or from source. PyMOL is not available via PyPI (pip), but can be installed from conda-forge. If PyMOL is already installed in your current python environment it can be used with CWS. If not, the free (open-source) version can be installed from conda-forge via conda (or mamba):

conda install -c conda-forge pymol-open-source

and paid (licensed version) from schrodinger channel (see here for more details) via conda (or mamba):

conda install -c conda-forge -c schrodinger pymol-bundle

Matplotlib is only required for analyzing of clustering and is useful if default values of clustering parameters need to be fine-tuned (which should be relatively rarely). You can install it from pip or conda or when installing CWS through pip by using pip install ConservedWaterSearch[matplotlib]. Both mpl and nglveiw can be installed when installing CWS by using:

pip install ConservedWaterSearch[all]

For more information see installation.

Example

The easiest way to use CWS is by calling WaterClustering class. The starting trajectory should be aligned first, and coordinates of water oxygen and hydrogens extracted. See WaterNetworkAnalysis for more information and convenience functions.

# imports
from ConservedWaterSearch.water_clustering import WaterClustering
from ConservedWaterSearch.utils import get_orientations_from_positions
# Number of snapshots
Nsnap = 20
# load some example - trajectory should be aligned prior to extraction of atom coordinates
Opos = np.loadtxt("tests/data/testdataO.dat")
Hpos = np.loadtxt("tests/data/testdataH.dat")
wc = WaterClustering(nsnaps=Nsnap)
wc.multi_stage_reclustering(*get_orientations_from_positions(Opos, Hpos))
print(wc.water_type)
# "aligned.pdb" should be the snapshot original trajectory was aligned to.
wc.visualise_pymol(aligned_protein = "aligned.pdb", output_file = "waters.pse")

https://raw.githubusercontent.com/JecaTosovic/ConservedWaterSearch/main/docs/source/figs/Results.png

Sometimes users might want to explicitly classify conserved water molecules. A simple python code can be used to classify waters into categories given an array of 3D oxygen coordinates and their related relative hydrogen orientations:

import ConservedWaterSearch.hydrogen_orientation as HO
# load some example
orientations = np.loadtxt("tests/data/conserved_sample_FCW.dat")
# Run classification
res = HO.hydrogen_orientation_analysis(
     orientations,
)
# print the water type
print(res[0][2])

For more information on preprocessing trajectory data, please refer to the WaterNetworkAnalysis.

conservedwatersearch's People

Contributors

domfijan avatar jecatosovic avatar dependabot[bot] avatar

Stargazers

Sampurna Mukherjee avatar Niklas Rindtorff avatar  avatar  avatar  avatar  avatar  avatar Semihakb avatar Sutanu Mukhopadhyay avatar  avatar Janex avatar

Watchers

 avatar

Forkers

gregoryschwing

conservedwatersearch's Issues

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Hi,

I tried to install the package but encountered this error:

      building 'hdbscan._hdbscan_tree' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

There is a fix for this described here on stackoverflow:

https://stackoverflow.com/questions/64261546/how-to-solve-error-microsoft-visual-c-14-0-or-greater-is-required-when-inst

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.