No project description provided
Project description
ConservedWaterSearch
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).
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.
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
Documentation: hosted on Read The Docs
GitHub repository: source code/contribute code
Issue tracker: Report issues/request features
Citation
See this article.
Installation
The easiest way to install ConservedWaterSearch is using pip
:
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.
Conda builds will be available soon.
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
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
Built Distribution
File details
Details for the file ConservedWaterSearch-0.1.0.tar.gz
.
File metadata
- Download URL: ConservedWaterSearch-0.1.0.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0811404f0bd2dbac693bbc2f0d6ee1163dbeee34c552c5e33e82cd00a1a56a74 |
|
MD5 | aa1ef62227737ddb71a80279ed3ddd95 |
|
BLAKE2b-256 | 51b7178269bff90dca7d9dc9c7b55a06cbb511f7cff30ff5c1af58a48ffc5c0b |
File details
Details for the file ConservedWaterSearch-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ConservedWaterSearch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a455bdb7c920e333087cb9ca4e9f1e8abf8b7ba573e625b96cd2c0d8b670e1d |
|
MD5 | 95abe78b6b3f84ad943ab5eaf6ae579b |
|
BLAKE2b-256 | d77c8daba321d65b45414b1fa51e5cf8a60785f012baad6d79a843bb9ac5b0bd |