--- /tmp/mdtraj-1.9.5-1txhvoilu/debian/python-mdtraj-doc_1.9.5-1_all.deb +++ python-mdtraj-doc_1.9.5-1_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2021-01-18 05:30:54.000000 debian-binary │ --rw-r--r-- 0 0 0 9368 2021-01-18 05:30:54.000000 control.tar.xz │ --rw-r--r-- 0 0 0 857604 2021-01-18 05:30:54.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 9348 2021-01-18 05:30:54.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 846320 2021-01-18 05:30:54.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── file list │ │ │ @@ -1,3 +1,3 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./ │ │ │ -rw-r--r-- 0 root (0) root (0) 1016 2021-01-18 05:30:54.000000 ./control │ │ │ --rw-r--r-- 0 root (0) root (0) 38783 2021-01-18 05:30:54.000000 ./md5sums │ │ │ +-rw-r--r-- 0 root (0) root (0) 38687 2021-01-18 05:30:54.000000 ./md5sums │ │ ├── ./control │ │ │ @@ -1,13 +1,13 @@ │ │ │ Package: python-mdtraj-doc │ │ │ Source: mdtraj │ │ │ Version: 1.9.5-1 │ │ │ Architecture: all │ │ │ Maintainer: Debichem Team │ │ │ -Installed-Size: 6801 │ │ │ +Installed-Size: 6748 │ │ │ Depends: libjs-mathjax, libjs-sphinxdoc (>= 2.4.3-5~), sphinx-rtd-theme-common (>= 0.5.1+dfsg) │ │ │ Section: doc │ │ │ Priority: optional │ │ │ Homepage: http://mdtraj.org/ │ │ │ Description: Read, write and analyze MD trajectories in Python (documentation) │ │ │ Read, write and analyze MD trajectories with only a few lines of │ │ │ Python code. │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ │ │ │ ├── line order │ │ │ │ @@ -295,15 +295,14 @@ │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/native-contact/native-contact.py │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/native-contact/native-contact_eval.ipynb.gz │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/nmr.html │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/nmr/nmr.ipynb │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/nmr/nmr.py │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/nmr/nmr_eval.ipynb │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/openmm.html │ │ │ │ -usr/share/doc/python-mdtraj-doc/html/examples/output_10_0.png │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/output_11_0.png │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/output_3_0.png │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/output_6_1.png │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/output_7_0.png │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/output_8_0.png │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/output_8_1.png │ │ │ │ usr/share/doc/python-mdtraj-doc/html/examples/output_9_0.png ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -292,20 +292,20 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 3672 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/atom-selection/atom-selection.py │ │ │ -rw-r--r-- 0 root (0) root (0) 1911 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/atom-selection/atom-selection_eval.ipynb.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 31870 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/atom-selection.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/centroids/ │ │ │ -rw-r--r-- 0 root (0) root (0) 3331 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/centroids/centroids.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 1759 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/centroids/centroids.py │ │ │ -rw-r--r-- 0 root (0) root (0) 3331 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/centroids/centroids_eval.ipynb │ │ │ --rw-r--r-- 0 root (0) root (0) 17788 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/centroids.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9501 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/centroids.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/clustering/ │ │ │ -rw-r--r-- 0 root (0) root (0) 3363 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/clustering/clustering.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 1661 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/clustering/clustering.py │ │ │ -rw-r--r-- 0 root (0) root (0) 3363 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/clustering/clustering_eval.ipynb │ │ │ --rw-r--r-- 0 root (0) root (0) 18651 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/clustering.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9982 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/clustering.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/hbonds/ │ │ │ -rw-r--r-- 0 root (0) root (0) 2880 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/hbonds/hbonds.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 1349 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/hbonds/hbonds.py │ │ │ -rw-r--r-- 0 root (0) root (0) 2880 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/hbonds/hbonds_eval.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 19202 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/hbonds.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12717 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 15774 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/introduction.html │ │ │ @@ -321,62 +321,61 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 21424 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/native-contact.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/nmr/ │ │ │ -rw-r--r-- 0 root (0) root (0) 2064 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/nmr/nmr.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 945 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/nmr/nmr.py │ │ │ -rw-r--r-- 0 root (0) root (0) 2064 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/nmr/nmr_eval.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 12072 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/nmr.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10512 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/openmm.html │ │ │ --rw-r--r-- 0 root (0) root (0) 9072 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_10_0.png │ │ │ -rw-r--r-- 0 root (0) root (0) 27745 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_11_0.png │ │ │ -rw-r--r-- 0 root (0) root (0) 17399 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_3_0.png │ │ │ -rw-r--r-- 0 root (0) root (0) 23001 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_6_1.png │ │ │ --rw-r--r-- 0 root (0) root (0) 28959 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_7_0.png │ │ │ +-rw-r--r-- 0 root (0) root (0) 28827 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_7_0.png │ │ │ -rw-r--r-- 0 root (0) root (0) 28886 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_8_0.png │ │ │ -rw-r--r-- 0 root (0) root (0) 8714 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_8_1.png │ │ │ --rw-r--r-- 0 root (0) root (0) 17453 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_9_0.png │ │ │ +-rw-r--r-- 0 root (0) root (0) 17438 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/output_9_0.png │ │ │ -rw-r--r-- 0 root (0) root (0) 22652 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/pca.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/principal-components/ │ │ │ -rw-r--r-- 0 root (0) root (0) 1265 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/principal-components/principal-components.ipynb.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 2162 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/principal-components/principal-components.py │ │ │ -rw-r--r-- 0 root (0) root (0) 1265 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/principal-components/principal-components_eval.ipynb.gz │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/ramachandran-plot/ │ │ │ -rw-r--r-- 0 root (0) root (0) 2714 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/ramachandran-plot/ramachandran-plot.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 1397 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/ramachandran-plot/ramachandran-plot.py │ │ │ -rw-r--r-- 0 root (0) root (0) 2714 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/ramachandran-plot/ramachandran-plot_eval.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 21072 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/ramachandran-plot.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/rmsd-benchmark/ │ │ │ -rw-r--r-- 0 root (0) root (0) 3943 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/rmsd-benchmark/rmsd-benchmark.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 2182 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/rmsd-benchmark/rmsd-benchmark.py │ │ │ -rw-r--r-- 0 root (0) root (0) 3943 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/rmsd-benchmark/rmsd-benchmark_eval.ipynb │ │ │ --rw-r--r-- 0 root (0) root (0) 20275 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/rmsd-benchmark.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9668 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/rmsd-benchmark.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/simulation-with-openmm/ │ │ │ -rw-r--r-- 0 root (0) root (0) 4008 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/simulation-with-openmm/simulation-with-openmm.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 2181 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/simulation-with-openmm/simulation-with-openmm.py │ │ │ -rw-r--r-- 0 root (0) root (0) 4008 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/simulation-with-openmm/simulation-with-openmm_eval.ipynb │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/solvent-accessible-surface-area/ │ │ │ -rw-r--r-- 0 root (0) root (0) 3547 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/solvent-accessible-surface-area/solvent-accessible-surface-area.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 1804 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/solvent-accessible-surface-area/solvent-accessible-surface-area.py │ │ │ -rw-r--r-- 0 root (0) root (0) 3547 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/solvent-accessible-surface-area/solvent-accessible-surface-area_eval.ipynb │ │ │ -rw-r--r-- 0 root (0) root (0) 23237 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/solvent-accessible-surface-area.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/two-pass-clustering/ │ │ │ -rw-r--r-- 0 root (0) root (0) 1673 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/two-pass-clustering/two-pass-clustering.ipynb.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 3053 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/two-pass-clustering/two-pass-clustering.py │ │ │ -rw-r--r-- 0 root (0) root (0) 1673 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/two-pass-clustering/two-pass-clustering_eval.ipynb.gz │ │ │ --rw-r--r-- 0 root (0) root (0) 25193 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/two-pass-clustering.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 9919 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/examples/two-pass-clustering.html │ │ │ -rw-r--r-- 0 root (0) root (0) 6775 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/faq.html │ │ │ -rw-r--r-- 0 root (0) root (0) 27879 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/genindex.html │ │ │ -rw-r--r-- 0 root (0) root (0) 40881 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/hdf5_format.html │ │ │ -rw-r--r-- 0 root (0) root (0) 13790 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10537 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/installation.html │ │ │ -rw-r--r-- 0 root (0) root (0) 20690 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/load_functions.html │ │ │ -rw-r--r-- 0 root (0) root (0) 11361 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/mdconvert.html │ │ │ -rw-r--r-- 0 root (0) root (0) 14005 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/new_to_python.html │ │ │ -rw-r--r-- 0 root (0) root (0) 3639 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/objects.inv │ │ │ -rw-r--r-- 0 root (0) root (0) 6039 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 79702 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/searchindex.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 77346 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/searchindex.js │ │ │ -rw-r--r-- 0 root (0) root (0) 44366 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/whatsnew.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc-base/ │ │ │ -rw-r--r-- 0 root (0) root (0) 313 2021-01-18 05:30:54.000000 ./usr/share/doc-base/mdtraj │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/_static/css/badge_only.css -> ../../../../../sphinx_rtd_theme/static/css/badge_only.css │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/_static/css/theme.css -> ../../../../../sphinx_rtd_theme/static/css/theme.css │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/_static/doctools.js -> ../../../../javascript/sphinxdoc/1.0/doctools.js │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-18 05:30:54.000000 ./usr/share/doc/python-mdtraj-doc/html/_static/fonts/Lato-Bold.ttf -> ../../../../../sphinx_rtd_theme/static/fonts/Lato-Bold.ttf │ │ ├── ./usr/share/doc/python-mdtraj-doc/html/examples/centroids.html │ │ │ @@ -190,183 +190,15 @@ │ │ │
│ │ │ │ │ │
│ │ │
│ │ │ │ │ │
│ │ │

Finding centroids of clusters

│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -

Finding centroids

In this example, we're going to find a "centroid" (representitive structure) for a group of conformations. This group might potentially come from clustering, using method like Ward hierarchical clustering.

│ │ │ -

Note that there are many possible ways to define the centroids. This is just one.

│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
In [1]:
│ │ │ -
│ │ │ -
│ │ │ -
from __future__ import print_function
│ │ │ -%matplotlib inline
│ │ │ -import mdtraj as md
│ │ │ -import numpy as np
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -

Load up a trajectory to use for the example.

│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
In [2]:
│ │ │ -
│ │ │ -
│ │ │ -
traj = md.load('ala2.h5')
│ │ │ -print(traj)
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
<mdtraj.Trajectory with 100 frames, 22 atoms, 3 residues, without unitcells>
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -

Lets compute all pairwise rmsds between conformations.

│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
In [3]:
│ │ │ -
│ │ │ -
│ │ │ -
atom_indices = [a.index for a in traj.topology.atoms if a.element.symbol != 'H']
│ │ │ -distances = np.empty((traj.n_frames, traj.n_frames))
│ │ │ -for i in range(traj.n_frames):
│ │ │ -    distances[i] = md.rmsd(traj, traj, i, atom_indices=atom_indices)
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -

The algorithim we're going to use is relatively simple:

│ │ │ -
    │ │ │ -
  • Compute all of the pairwise RMSDs between the conformations. This is O(N^2), so it's not going to │ │ │ -scale extremely well to large datasets.
  • │ │ │ -
  • Transform these distances into similarity scores. Our similarities will calculated as │ │ │ -$$ s_{ij} = e^{-\beta \cdot d_{ij} / d_\text{scale}} $$ │ │ │ -where $s_{ij}$ is the pairwise similarity, $d_{ij}$ is the pairwise distance, and $d_\text{scale}$ is the standard deviation of │ │ │ -the values of $d$, to make the computation scale invariant.
  • │ │ │ -
  • Then, we define the centroid as │ │ │ -$$ \text{argmax}_i \sum_j s_{ij} $$
  • │ │ │ -
│ │ │ -

Using $\beta=1$, this is implemented with the following code:

│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
In [4]:
│ │ │ -
│ │ │ -
│ │ │ -
beta = 1
│ │ │ -index = np.exp(-beta*distances / distances.std()).sum(axis=1).argmax()
│ │ │ -print(index)
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
83
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
In [5]:
│ │ │ -
│ │ │ -
│ │ │ -
centroid = traj[index]
│ │ │ -print(centroid)
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ - │ │ │ - │ │ │ -
│ │ │ -
│ │ │ -
<mdtraj.Trajectory with 1 frames, 22 atoms, 3 residues, without unitcells>
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ - │ │ │ -
│ │ │ -
│ │ │ - │ │ │ -

(centroids.ipynb.gz; centroids_eval.ipynb.gz; centroids.py)

│ │ │ +Cell execution timed out

(centroids.ipynb.gz; centroids_eval.ipynb.gz; centroids.py)

│ │ │
│ │ │ │ │ │ │ │ │
│ │ │ │ │ │
│ │ │