Skip to main content

No project description provided

Project description

ConservedWaterSearch

https://readthedocs.org/projects/conservedwatersearch/badge/?version=latest https://badge.fury.io/py/conservedwatersearch.svg https://img.shields.io/conda/vn/conda-forge/conservedwatersearch.svg

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.

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). However, hdbscan which is a hard dependency, requires a C++ compiler to be installed for pip installation to work (see installation). To install via pip use:

pip install ConservedWaterSearch

Pymol is the only requirement missing on pip and has to be installed either fom source or conda. 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, save_intermediate_results=False, save_results_after_done=False)
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")

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.

Project details


Download files

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

Source Distribution

ConservedWaterSearch-0.1.2.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ConservedWaterSearch-0.1.2-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file ConservedWaterSearch-0.1.2.tar.gz.

File metadata

  • Download URL: ConservedWaterSearch-0.1.2.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for ConservedWaterSearch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fa444a51b4bf2989063979c2a0e68064cc1037324c349b69fc68ef357cca1cb6
MD5 0b587411900be0531219701aa394ab1b
BLAKE2b-256 8226936e762fd48c344217f61f84e24fae4483fbd6c6d93fadf125737b9782e1

See more details on using hashes here.

File details

Details for the file ConservedWaterSearch-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ConservedWaterSearch-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94627a1d212cab0cd316944f9fd130a4b2afea2012b17989269d9dbd3d81a2b5
MD5 8153a388aa9a392dae827d1b352f7d1e
BLAKE2b-256 ae57ea46d644c8d8f7113763e6abf9f0a108510cabeb4ab0cbb0c81e2458a9f9

See more details on using hashes here.

Supported by

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