### Manually install QML for troubleshooting Source: https://hmcezar.github.io/clusttraj/install.html Workaround for installation failures related to the qml package by installing it separately with specific setuptools versions. ```bash pip install "setuptools<60" pip install "qml @ git+https://github.com/hmcezar/qml@develop" ``` -------------------------------- ### Install ClustTraj with QML support Source: https://hmcezar.github.io/clusttraj/install.html Installs ClustTraj with the optional qmllib dependency. ```bash pip install "clusttraj[qml]" ``` -------------------------------- ### Install ClustTraj with Conda Source: https://hmcezar.github.io/clusttraj/install.html Recommended installation sequence when using Conda to manage Open Babel. ```bash conda install -c conda-forge openbabel pip install clusttraj ``` -------------------------------- ### Install ClustTraj via pip Source: https://hmcezar.github.io/clusttraj/install.html Standard installation command for ClustTraj and its core dependencies. ```bash pip install clusttraj ``` -------------------------------- ### Install ClustTraj with Open Babel support Source: https://hmcezar.github.io/clusttraj/install.html Installs ClustTraj along with the openbabel-wheel package for pip-only environments. ```bash pip install "clusttraj[openbabel]" ``` -------------------------------- ### Clustering output with reordering Source: https://hmcezar.github.io/clusttraj/examples.html Example output showing the impact of atom reordering on clustering statistics. ```text $ python -m clusttraj h2o_traj.xyz -ss -p -m average -e -f 2024-12-10 20:44:05,214 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-10 20:44:07,216 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-10 20:44:07,217 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-10 20:44:07,229 INFO [classify.py:61] Highest silhouette score: 0.11873407875769022 2024-12-10 20:44:07,229 INFO [classify.py:71] Optimal RMSD threshold value: 1.2370133377873964 2024-12-10 20:44:07,229 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-10 20:44:09,279 INFO [main.py:102]
A total 100 snapshots were read and 35 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 2 2 4 3 3 4 1 5 1 6 1 7 2 8 2 9 3 10 2 11 7 12 3 13 7 14 7 15 3 16 5 17 4 18 3 19 2 20 4 21 2 22 3 23 3 24 1 25 2 26 3 27 2 28 1 29 2 30 2 31 5 32 4 33 2 34 1 35 1 2024-12-10 20:44:09,280 INFO [main.py:126]
Total wall time: 4.066500 s ``` -------------------------------- ### Display Help Options Source: https://hmcezar.github.io/clusttraj/usage.html View available command-line arguments and options. ```bash clusttraj -h ``` ```bash python -m clusttraj -h ``` -------------------------------- ### View simulation details Source: https://hmcezar.github.io/clusttraj/examples.html Display the contents of the clusters.out file to see simulation parameters and cluster sizes. ```bash $ cat clusters.out Full command: /Users/rafael/Documents/FĂ­sica/projetos/clusttraj/clusttraj/__main__.py h2o_traj.xyz -rmsd 2.0 Clusterized from trajectory file: h2o_traj.xyz Method: average RMSD criterion: 2.0 Ignoring hydrogens?: False RMSD matrix was written in: distmat.npy The classification of each configuration was written in: clusters.dat A total 100 snapshots were read and 3 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 44 2 22 3 34 ``` -------------------------------- ### Run clustering with Median method Source: https://hmcezar.github.io/clusttraj/examples.html Executes the clustering process using the median method and displays the resulting log output. ```bash $ python -m clusttraj h2o_traj.xyz -ss -i distmat.npy -p -m median -f 2024-12-10 20:27:55,765 INFO [distmat.py:28] Reading condensed RMSD matrix from distmat.npy 2024-12-10 20:27:55,766 INFO [classify.py:27] Clustering using 'median' method to join the clusters 2024-12-10 20:27:55,775 INFO [classify.py:61] Highest silhouette score: 0.07527635729544939 2024-12-10 20:27:55,775 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 1.8608407527454136, 1.9608407527454137, 2.060840752745414 2024-12-10 20:27:55,775 INFO [classify.py:68] The smallest RMSD of 1.8608407527454136 has been adopted 2024-12-10 20:27:55,775 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-10 20:27:58,152 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 99 2 1 2024-12-10 20:27:58,153 INFO [main.py:126]
Total wall time: 2.388923 s ``` -------------------------------- ### Run Clustering with Final Kabsch Rotation Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Execute the clustering process with the final Kabsch rotation enabled using the specified input file and parameters. ```console $ clusttraj olig_solv.gro -m average -ss -p --metrics -e -ns 702 -f --final-kabsch ``` -------------------------------- ### View Cluster Output Summary Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Display the final cluster sizes and quality metrics from the output file. ```console $ tail clusters.out The cluster sizes are: Cluster Size 1 30 2 70 Silhouette score: 0.442 Calinski Harabsz score: 256.998 Davies-Bouldin score: 0.482 Cophenetic correlation coefficient: 0.845 ``` ```console $ tail clusters.out The cluster sizes are: Cluster Size 1 30 2 70 ``` -------------------------------- ### Inspect trajectory file Source: https://hmcezar.github.io/clusttraj/examples.html View the initial lines of the XYZ trajectory file containing molecular configurations. ```bash $ head h2o_traj.xyz 15 Frame 1 O 5.79224 23.34640 11.44660 H 4.98409 23.01319 11.83659 H 5.84046 22.91839 10.59179 O 5.59517 22.31815 8.86907 H 5.09795 21.51188 8.73143 H 6.50540 22.06908 8.70880 O 2.78349 22.26232 10.73374 H 2.46676 23.16482 10.69619 ``` -------------------------------- ### Run clustering with solvent reordering Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Includes the -e flag for molecular permutation and -ns to specify the number of oligomer atoms to ignore during reordering. ```console $ clusttraj olig_solv.gro -m average -ss -p --metrics -e -ns 702 -f 2024-12-12 16:09:08,619 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-12 16:12:08,573 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-12 16:12:08,576 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-12 16:12:08,675 INFO [classify.py:61] Highest silhouette score: 0.4420374106917728 ``` -------------------------------- ### View execution log Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Display the log file containing system output and processing times. ```console $ cat clusttraj.log 2024-12-10 20:03:47,369 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-10 20:03:49,416 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-10 20:03:49,418 INFO [classify.py:97] Clustering using 'average' method to join the clusters 2024-12-10 20:03:49,420 INFO [classify.py:105] Saving clustering classification to clusters.dat 2024-12-10 20:03:49,422 INFO [main.py:102]
A total 100 snapshots were read and 3 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 44 2 22 3 34 2024-12-10 20:03:49,422 INFO [main.py:126]
Total wall time: 2.053868 s ``` -------------------------------- ### clusttraj.io.configure_runtime Source: https://hmcezar.github.io/clusttraj/clusttraj.html Configures the runtime environment based on provided command-line arguments. ```APIDOC ## clusttraj.io.configure_runtime(args_in) ### Description Configure the runtime based on command line arguments. ### Parameters - **args_in** (List[str]) - Required - The command line arguments. ### Returns - **argparse.Namespace** - The parsed command line arguments. ``` -------------------------------- ### Run clustering with Ward method Source: https://hmcezar.github.io/clusttraj/examples.html Executes the clustering process using the Ward variance minimization algorithm and forces an output overwrite. ```bash $ python -m clusttraj h2o_traj.xyz -ss -i distmat.npy -p -m ward -f ``` -------------------------------- ### Display cluster output statistics Source: https://hmcezar.github.io/clusttraj/examples.html Shows the final cluster sizes and quality metrics by reading the output file. ```bash $ tail clusters.out The cluster sizes are: Cluster Size 1 30 2 70 Silhouette score: 0.442 Calinski Harabsz score: 256.998 Davies-Bouldin score: 0.482 Cophenetic correlation coefficient: 0.845 ``` -------------------------------- ### Display clustering performance metrics Source: https://hmcezar.github.io/clusttraj/examples.html Displays the final cluster sizes and quantitative performance scores from the output file. ```bash $ tail clusters.out The cluster sizes are: Cluster Size 1 99 2 1 Silhouette score: 0.139 Calinski Harabsz score: 2.476 Davies-Bouldin score: 0.619 Cophenetic correlation coefficient: 0.908 ``` -------------------------------- ### Display clustering results Source: https://hmcezar.github.io/clusttraj/examples.html Shows the contents of the clusters.out file, providing a summary of cluster sizes and quality metrics. ```bash $ tail clusters.out The cluster sizes are: Cluster Size 1 30 2 70 Silhouette score: 0.451 Calinski Harabsz score: 268.899 Davies-Bouldin score: 0.463 Cophenetic correlation coefficient: 0.845 ``` -------------------------------- ### clusttraj.main.main Source: https://hmcezar.github.io/clusttraj/clusttraj.html The main entry point for the clusttraj library, used to perform clustering and generate output. ```APIDOC ## clusttraj.main.main(args: List[str] | None = None) -> None ### Description Performs clustering and generates output based on the provided arguments. ### Parameters - **args** (List[str]) - Optional - List of command-line arguments. ``` -------------------------------- ### Display clustering metrics Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Shows the output metrics for the clustering performance. ```console $ tail clusters.out The cluster sizes are: Cluster Size 1 99 2 1 Silhouette score: 0.139 Calinski Harabsz score: 2.476 Davies-Bouldin score: 0.619 Cophenetic correlation coefficient: 0.908 ``` -------------------------------- ### Run ClustTraj with Median linkage Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Executes the clustering process using the median linkage method and displays the resulting log output. ```console $ python -m clusttraj h2o_traj.xyz -ss -i distmat.npy -p -m median -f 2024-12-10 20:27:55,765 INFO [distmat.py:28] Reading condensed RMSD matrix from distmat.npy 2024-12-10 20:27:55,766 INFO [classify.py:27] Clustering using 'median' method to join the clusters 2024-12-10 20:27:55,775 INFO [classify.py:61] Highest silhouette score: 0.07527635729544939 2024-12-10 20:27:55,775 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 1.8608407527454136, 1.9608407527454137, 2.060840752745414 2024-12-10 20:27:55,775 INFO [classify.py:68] The smallest RMSD of 1.8608407527454136 has been adopted 2024-12-10 20:27:55,775 INFO [classify.py:76] Saving clustering classification to clusters.dat ``` -------------------------------- ### Run clusttraj with solvent reordering Source: https://hmcezar.github.io/clusttraj/examples.html Executes the clustering process with the -e flag for molecular permutation and -ns to specify the number of oligomer atoms to ignore. ```bash $ clusttraj olig_solv.gro -m average -ss -p --metrics -e -ns 702 -f 2024-12-12 16:09:08,619 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-12 16:12:08,573 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-12 16:12:08,576 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-12 16:12:08,675 INFO [classify.py:61] Highest silhouette score: 0.4420374106917728 2024-12-12 16:12:08,676 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 11.532116467337541, 11.632116467337543, 11.73211646733754, 11.832116467337542, 11.93211646733754, 12.032116467337541, 12.13211646733754, 12.23211646733754, 12.332116467337539, 12.43211646733754, 12.532116467337538, 12.63211646733754, 12.732116467337537, 12.832116467337539, 12.932116467337536, 13.032116467337538, 13.132116467337536, 13.232116467337537, 13.332116467337535, 13.432116467337536, 13.532116467337534, 13.632116467337536, 13.732116467337534, 13.832116467337535, 13.932116467337533, 14.032116467337534, 14.132116467337532, 14.232116467337534, 14.332116467337531, 14.432116467337533, 14.53211646733753, 14.632116467337532, 14.73211646733753, 14.832116467337531, 14.93211646733753, 15.03211646733753, 15.132116467337529, 15.23211646733753, 15.332116467337528, 15.43211646733753, 15.532116467337527, 15.632116467337529, 15.732116467337526, 15.832116467337528, 15.932116467337526, 16.032116467337527, 16.132116467337525, 16.232116467337526, 16.332116467337524, 16.432116467337526, 16.532116467337524 2024-12-12 16:12:08,676 INFO [classify.py:68] The smallest RMSD of 11.532116467337541 has been adopted 2024-12-12 16:12:08,676 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-12 16:12:11,256 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 30 2 70 2024-12-12 16:12:11,262 INFO [main.py:126]
Total wall time: 182.642790 s ``` -------------------------------- ### Run standard hierarchical clustering Source: https://hmcezar.github.io/clusttraj/examples.html Executes the clustering process on a trajectory file using the average linkage method and calculates performance metrics. ```bash $ clusttraj olig_solv.gro -m average -ss -p --metrics 2024-12-12 16:13:01,490 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-12 16:13:43,838 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-12 16:13:43,840 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-12 16:13:43,923 INFO [classify.py:61] Highest silhouette score: 0.13900364227503081 2024-12-12 16:13:43,923 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 25.157769211396136, 25.257769211396134 2024-12-12 16:13:43,923 INFO [classify.py:68] The smallest RMSD of 25.157769211396136 has been adopted 2024-12-12 16:13:43,924 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-12 16:13:46,184 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 99 2 1 2024-12-12 16:13:46,189 INFO [main.py:126]
Total wall time: 44.698860 s ``` -------------------------------- ### Run ClustTraj with Ward linkage Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Executes the clustering process using the Ward variance minimization algorithm and displays the corresponding log output. ```console $ python -m clusttraj h2o_traj.xyz -ss -i distmat.npy -p -m ward -f ``` ```console $ tail -n 22 clusttraj.log 2024-12-10 20:23:31,014 INFO [main.py:126]
Total wall time: 2.051024 s 2024-12-10 20:24:58,651 INFO [distmat.py:28] Reading condensed RMSD matrix from distmat.npy 2024-12-10 20:24:58,652 INFO [classify.py:27] Clustering using 'ward' method to join the clusters 2024-12-10 20:24:58,712 INFO [classify.py:61] Highest silhouette score: 0.23037242401157287 2024-12-10 20:24:58,712 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 6.0608407527454125, 6.160840752745413, 6.260840752745413, 6.360840752745412, 6.460840752745413, 6.5608407527454125, 6.660840752745413, 6.760840752745413, 6.860840752745412, 6.960840752745413, 7.0608407527454125, 7.160840752745413, 7.260840752745413, 7.360840752745412, 7.460840752745413, 7.5608407527454125, 7.660840752745412, 7.760840752745413, 7.860840752745412, 7.960840752745412, 8.060840752745412, 8.160840752745413, 8.260840752745413, 8.360840752745412, 8.460840752745412, 8.560840752745412, 8.660840752745413, 8.760840752745413, 8.860840752745412, 8.960840752745412, 9.060840752745412, 9.160840752745411, 9.260840752745413, 9.360840752745412, 9.460840752745412, 9.560840752745412, 9.660840752745411, 9.760840752745413, 9.860840752745412, 9.960840752745412, 10.060840752745412, 10.160840752745411, 10.260840752745413, 10.360840752745412, 10.460840752745412, 10.560840752745412, 10.660840752745411, 10.760840752745413 2024-12-10 20:24:58,712 INFO [classify.py:68] The smallest RMSD of 6.0608407527454125 has been adopted 2024-12-10 20:24:58,712 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-10 20:25:00,661 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 46 2 54 2024-12-10 20:25:00,661 INFO [main.py:126]
Total wall time: 2.011472 s ``` -------------------------------- ### Inspect cluster labels Source: https://hmcezar.github.io/clusttraj/examples.html View the generated cluster labels for each configuration in the trajectory. ```bash $ head clusters.dat 3 3 1 2 1 1 2 1 1 3 ``` -------------------------------- ### Run Clusttraj with automatic threshold detection Source: https://hmcezar.github.io/clusttraj/examples.html Executes the clustering process using the -ss flag to maximize the silhouette coefficient, with -i for input matrix and -p for visualization outputs. ```bash $ python -m clusttraj h2o_traj.xyz -ss -i distmat.npy -p ``` -------------------------------- ### Clustering with solute-solvent separation Source: https://hmcezar.github.io/clusttraj/examples.html Use the -ns flag to specify the number of solvent atoms for improved clustering in solvated systems. ```bash $ python -m clusttraj h2o_traj.xyz -ss -p -m average -e -f -ns 3 2024-12-10 20:46:41,192 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-10 20:46:43,383 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-10 20:46:43,385 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-10 20:46:43,407 INFO [classify.py:61] Highest silhouette score: 0.24735123044958363 2024-12-10 20:46:43,407 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 3.035586843407412, 3.135586843407412, 3.235586843407412, 3.335586843407412 2024-12-10 20:46:43,407 INFO [classify.py:68] The smallest RMSD of 3.035586843407412 has been adopted 2024-12-10 20:46:43,407 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-10 20:46:45,206 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 3 2 97 2024-12-10 20:46:45,206 INFO [main.py:126]
Total wall time: 4.015671 s ``` -------------------------------- ### Apply final Kabsch rotation Source: https://hmcezar.github.io/clusttraj/examples.html Use the --final-kabsch flag to minimize RMSD after reordering solvent atoms. ```bash $ python -m clusttraj h2o_traj.xyz -ss -p -m average -e -f -ns 3 --final-kabsch ``` -------------------------------- ### View execution logs Source: https://hmcezar.github.io/clusttraj/examples.html Display the contents of the clusttraj.log file for detailed execution information and timing. ```bash $ cat clusttraj.log 2024-12-10 20:03:47,369 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-10 20:03:49,416 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-10 20:03:49,418 INFO [classify.py:97] Clustering using 'average' method to join the clusters 2024-12-10 20:03:49,420 INFO [classify.py:105] Saving clustering classification to clusters.dat 2024-12-10 20:03:49,422 INFO [main.py:102]
A total 100 snapshots were read and 3 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 44 2 22 3 34 2024-12-10 20:03:49,422 INFO [main.py:126]
Total wall time: 2.053868 s ``` -------------------------------- ### View silhouette clustering log Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Display the log file showing the highest silhouette score and optimal RMSD threshold values. ```console $ cat clusttraj.log 2024-12-10 20:06:50,323 INFO [distmat.py:28] Reading condensed RMSD matrix from distmat.npy 2024-12-10 20:06:50,324 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-10 20:06:50,338 INFO [classify.py:61] Highest silhouette score: 0.21741836027295453 2024-12-10 20:06:50,338 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 2.160840752745414, 2.2608407527454135 ``` -------------------------------- ### Cluster solvated systems Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Specify the number of solvent atoms using the -ns flag to treat specific molecules as solute and others as solvent. ```console $ python -m clusttraj h2o_traj.xyz -ss -p -m average -e -f -ns 3 2024-12-10 20:46:41,192 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-10 20:46:43,383 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-10 20:46:43,385 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-10 20:46:43,407 INFO [classify.py:61] Highest silhouette score: 0.24735123044958363 2024-12-10 20:46:43,407 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 3.035586843407412, 3.135586843407412, 3.235586843407412, 3.335586843407412 2024-12-10 20:46:43,407 INFO [classify.py:68] The smallest RMSD of 3.035586843407412 has been adopted 2024-12-10 20:46:43,407 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-10 20:46:45,206 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 3 2 97 2024-12-10 20:46:45,206 INFO [main.py:126]
Total wall time: 4.015671 s ``` -------------------------------- ### Run standard RMSD clustering Source: https://hmcezar.github.io/clusttraj/_sources/examples.rst.txt Executes the hierarchical clustering scheme without accounting for solvent permutation. ```console $ clusttraj olig_solv.gro -m average -ss -p --metrics 2024-12-12 16:13:01,490 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-12 16:13:43,838 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-12 16:13:43,840 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-12 16:13:43,923 INFO [classify.py:61] Highest silhouette score: 0.13900364227503081 2024-12-12 16:13:43,923 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 25.157769211396136, 25.257769211396134 2024-12-12 16:13:43,923 INFO [classify.py:68] The smallest RMSD of 25.157769211396136 has been adopted 2024-12-12 16:13:43,924 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-12 16:13:46,184 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 99 2 1 2024-12-12 16:13:46,189 INFO [main.py:126]
Total wall time: 44.698860 s ``` -------------------------------- ### Run clusttraj with final Kabsch rotation Source: https://hmcezar.github.io/clusttraj/examples.html Executes the clusttraj command with specific flags for solvent reordering and Kabsch rotation, including the resulting log output. ```bash $ clusttraj olig_solv.gro -m average -ss -p --metrics -e -ns 702 -f --final-kabsch 2024-12-12 16:35:25,405 INFO [distmat.py:34] Calculating RMSD matrix using 4 threads 2024-12-12 16:38:24,715 INFO [distmat.py:38] Saving condensed RMSD matrix to distmat.npy 2024-12-12 16:38:24,718 INFO [classify.py:27] Clustering using 'average' method to join the clusters 2024-12-12 16:38:24,798 INFO [classify.py:61] Highest silhouette score: 0.4505111680708198 2024-12-12 16:38:24,798 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 11.504201293638701, 11.6042012936387, 11.7042012936387, 11.8042012936387, 11.9042012936387, 12.0042012936387, 12.104201293638699, 12.204201293638699, 12.304201293638698, 12.404201293638698, 12.504201293638697, 12.604201293638697, 12.704201293638697, 12.804201293638696, 12.904201293638696, 13.004201293638696, 13.104201293638695, 13.204201293638695, 13.304201293638695, 13.404201293638694, 13.504201293638694, 13.604201293638694, 13.704201293638693, 13.804201293638693, 13.904201293638693, 14.004201293638692, 14.104201293638692, 14.204201293638691, 14.304201293638691, 14.40420129363869, 14.50420129363869, 14.60420129363869, 14.70420129363869, 14.80420129363869, 14.904201293638689, 15.004201293638689, 15.104201293638688, 15.204201293638688, 15.304201293638688, 15.404201293638687, 15.504201293638687, 15.604201293638686, 15.704201293638686, 15.804201293638686, 15.904201293638685, 16.004201293638687, 16.104201293638685, 16.204201293638683, 16.304201293638684, 16.404201293638685, 16.504201293638683 2024-12-12 16:38:24,798 INFO [classify.py:68] The smallest RMSD of 11.504201293638701 has been adopted 2024-12-12 16:38:24,798 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-12 16:38:26,979 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 30 2 70 2024-12-12 16:38:26,981 INFO [main.py:126]
Total wall time: 181.576293 s ``` -------------------------------- ### Run clustering with manual RMSD threshold Source: https://hmcezar.github.io/clusttraj/examples.html Execute the clustering procedure by specifying the trajectory file and a fixed RMSD cutoff distance. ```bash $ python -m clusttraj h2o_traj.xyz -rmsd 2.0 ``` -------------------------------- ### Cluster by Silhouette Coefficient Source: https://hmcezar.github.io/clusttraj/usage.html Determine the RMSD threshold automatically by maximizing the silhouette coefficient. ```bash clusttraj trajectory.xyz -ss ``` -------------------------------- ### Reorder atoms with molecule permutation flag Source: https://hmcezar.github.io/clusttraj/examples.html Use the -e flag to reorder atoms to account for identical molecule permutations. ```bash $ python -m clusttraj h2o_traj.xyz -ss -p -m average -e -f ``` -------------------------------- ### Perform Trajectory Clustering Source: https://hmcezar.github.io/clusttraj/usage.html Basic command to cluster a trajectory file using an RMSD threshold. ```bash clusttraj trajectory.xyz -rmsd ``` -------------------------------- ### clusttraj.io.save_medoids_config Source: https://hmcezar.github.io/clusttraj/clusttraj.html Saves the best superpositioned medoids configurations to a single file. ```APIDOC ## clusttraj.io.save_medoids_config(trajfile, medoids, noh, reorder, reorder_solvent_only, nsatoms, weight_solute, outbasename, outfmt, reorderexcl, final_kabsch, overwrite) ### Description Save best superpositioned medoids configurations to a single file. First medoid is the reference. ### Parameters - **trajfile** (str) - Required - The trajectory file path. - **medoids** (ndarray) - Required - An array containing medoid indices. - **noh** (bool) - Required - Flag indicating whether to exclude hydrogen atoms. - **reorder** (Callable) - Optional - A function to reorder the atoms, if necessary. - **nsatoms** (int) - Required - The number of atoms in the solute. - **weight_solute** (float) - Required - The weight of the solute atoms in the RMSD calculation. - **outbasename** (str) - Required - The base name for the output file. - **outfmt** (str) - Required - The output file format. - **reorderexcl** (ndarray) - Required - An array of atom indices to exclude during reordering. - **final_kabsch** (bool) - Required - Flag indicating whether to perform a final Kabsch rotation. - **overwrite** (bool) - Required - Flag indicating whether to overwrite existing output files. ``` -------------------------------- ### View clustering log output Source: https://hmcezar.github.io/clusttraj/examples.html Displays the final lines of the clusttraj log file to verify the clustering results. ```bash $ tail -n 22 clusttraj.log 2024-12-10 20:23:31,014 INFO [main.py:126]
Total wall time: 2.051024 s 2024-12-10 20:24:58,651 INFO [distmat.py:28] Reading condensed RMSD matrix from distmat.npy 2024-12-10 20:24:58,652 INFO [classify.py:27] Clustering using 'ward' method to join the clusters 2024-12-10 20:24:58,712 INFO [classify.py:61] Highest silhouette score: 0.23037242401157287 2024-12-10 20:24:58,712 INFO [classify.py:65] The following RMSD threshold values yielded the same optimial silhouette score: 6.0608407527454125, 6.160840752745413, 6.260840752745413, 6.360840752745412, 6.460840752745413, 6.5608407527454125, 6.660840752745413, 6.760840752745413, 6.860840752745412, 6.960840752745413, 7.0608407527454125, 7.160840752745413, 7.260840752745413, 7.360840752745412, 7.460840752745413, 7.5608407527454125, 7.660840752745412, 7.760840752745413, 7.860840752745412, 7.960840752745412, 8.060840752745412, 8.160840752745413, 8.260840752745413, 8.360840752745412, 8.460840752745412, 8.560840752745412, 8.660840752745413, 8.760840752745413, 8.860840752745412, 8.960840752745412, 9.060840752745412, 9.160840752745411, 9.260840752745413, 9.360840752745412, 9.460840752745412, 9.560840752745412, 9.660840752745411, 9.760840752745413, 9.860840752745412, 9.960840752745412, 10.060840752745412, 10.160840752745411, 10.260840752745413, 10.360840752745412, 10.460840752745412, 10.560840752745412, 10.660840752745411, 10.760840752745413 2024-12-10 20:24:58,712 INFO [classify.py:68] The smallest RMSD of 6.0608407527454125 has been adopted 2024-12-10 20:24:58,712 INFO [classify.py:76] Saving clustering classification to clusters.dat 2024-12-10 20:25:00,661 INFO [main.py:102]
A total 100 snapshots were read and 2 cluster(s) was(were) found. The cluster sizes are: Cluster Size 1 46 2 54 2024-12-10 20:25:00,661 INFO [main.py:126]
Total wall time: 2.011472 s ``` -------------------------------- ### Configure NumPy Threading Source: https://hmcezar.github.io/clusttraj/usage.html Set environment variables to restrict NumPy threading when using multiprocessing. ```bash export OMP_NUM_THREADS=1 export OPENBLAS_NUM_THREADS=1 export MKL_NUM_THREADS=1 export VECLIB_MAXIMUM_THREADS=1 export NUMEXPR_NUM_THREADS=1 ```