-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rebuilt html docs for version 2.9.0-dev0 from branch develop with sph…
…inx at 1e95ff7
- Loading branch information
github-actions
committed
Nov 29, 2024
1 parent
bdb5c4d
commit 4e9cfc5
Showing
630 changed files
with
133,650 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
userguide.mdanalysis.org |
Binary file added
BIN
+64 KB
2.9.0-dev0/_downloads/35d4323e5cc041e33705e58839d7a259/auxiliary-1.hires.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
2.9.0-dev0/_downloads/79835177181377e2588d274aed9cad44/auxiliary-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import matplotlib.pyplot as plt | ||
import MDAnalysis as mda | ||
from MDAnalysisTests.datafiles import AUX_EDR | ||
aux = mda.auxiliary.EDR.EDRReader(AUX_EDR) | ||
temp = aux.get_data("Temperature") | ||
plt.plot(temp["Time"], temp["Temperature"]) | ||
plt.ylabel("Temperature [K]") | ||
plt.xlabel("Time [ps]") | ||
plt.show() |
Binary file added
BIN
+9.91 KB
2.9.0-dev0/_downloads/899668c9e2e17d4c2fc64131d19cdebc/auxiliary-1.pdf
Binary file not shown.
Binary file added
BIN
+18.5 KB
2.9.0-dev0/_downloads/e26175fa4b43d8229a32471a3e7c7831/auxiliary-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+352 KB
2.9.0-dev0/_images/aligning_structure_to_another-shifted_aligned_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+34.7 KB
2.9.0-dev0/_images/examples_analysis_alignment_and_rms_pairwise_rmsd_14_1.png
Oops, something went wrong.
Binary file added
BIN
+36.3 KB
2.9.0-dev0/_images/examples_analysis_alignment_and_rms_pairwise_rmsd_21_1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+64.8 KB
2.9.0-dev0/_images/examples_analysis_custom_parallel_analysis_11_1.png
Oops, something went wrong.
Binary file added
BIN
+64.8 KB
2.9.0-dev0/_images/examples_analysis_custom_parallel_analysis_21_1.png
Oops, something went wrong.
Binary file added
BIN
+64.8 KB
2.9.0-dev0/_images/examples_analysis_custom_parallel_analysis_30_1.png
Oops, something went wrong.
Binary file added
BIN
+64.8 KB
2.9.0-dev0/_images/examples_analysis_custom_parallel_analysis_35_1.png
Oops, something went wrong.
Binary file added
BIN
+18.8 KB
2.9.0-dev0/_images/examples_analysis_custom_parallel_analysis_51_0.png
Oops, something went wrong.
Binary file added
BIN
+64.8 KB
2.9.0-dev0/_images/examples_analysis_custom_parallel_analysis_55_1.png
Oops, something went wrong.
Binary file added
BIN
+64.8 KB
2.9.0-dev0/_images/examples_analysis_custom_parallel_analysis_68_1.png
Oops, something went wrong.
Binary file added
BIN
+34.7 KB
2.9.0-dev0/_images/examples_analysis_custom_trajectory_analysis_12_1.png
Oops, something went wrong.
Binary file added
BIN
+28.8 KB
2.9.0-dev0/_images/examples_analysis_custom_trajectory_analysis_15_1.png
Oops, something went wrong.
Binary file added
BIN
+34.7 KB
2.9.0-dev0/_images/examples_analysis_custom_trajectory_analysis_21_1.png
Oops, something went wrong.
Binary file added
BIN
+35.5 KB
2.9.0-dev0/_images/examples_analysis_custom_trajectory_analysis_24_1.png
Oops, something went wrong.
Binary file added
BIN
+44.5 KB
2.9.0-dev0/_images/examples_analysis_custom_trajectory_analysis_34_1.png
Oops, something went wrong.
Binary file added
BIN
+39.1 KB
2.9.0-dev0/_images/examples_analysis_custom_trajectory_analysis_39_1.png
Oops, something went wrong.
Binary file added
BIN
+32.2 KB
...-dev0/_images/examples_analysis_distances_and_contacts_contacts_custom_16_1.png
Oops, something went wrong.
Binary file added
BIN
+31.9 KB
...ages/examples_analysis_distances_and_contacts_contacts_native_fraction_20_0.png
Oops, something went wrong.
Binary file added
BIN
+34 KB
...ages/examples_analysis_distances_and_contacts_contacts_native_fraction_24_0.png
Oops, something went wrong.
Binary file added
BIN
+36.9 KB
...ages/examples_analysis_distances_and_contacts_contacts_native_fraction_34_0.png
Oops, something went wrong.
Binary file added
BIN
+30.4 KB
...ages/examples_analysis_distances_and_contacts_contacts_native_fraction_43_0.png
Oops, something went wrong.
Binary file added
BIN
+45.3 KB
2.9.0-dev0/_images/examples_analysis_distances_and_contacts_contacts_q1q2_12_1.png
Oops, something went wrong.
Binary file added
BIN
+37.5 KB
2.9.0-dev0/_images/examples_analysis_distances_and_contacts_contacts_q1q2_14_1.png
Oops, something went wrong.
Binary file added
BIN
+34.1 KB
...images/examples_analysis_distances_and_contacts_contacts_within_cutoff_15_1.png
Oops, something went wrong.
Binary file added
BIN
+32.3 KB
.../examples_analysis_distances_and_contacts_distances_between_atomgroups_11_1.png
Oops, something went wrong.
Binary file added
BIN
+47.8 KB
.../examples_analysis_distances_and_contacts_distances_between_atomgroups_16_1.png
Oops, something went wrong.
Binary file added
BIN
+26.4 KB
.../examples_analysis_distances_and_contacts_distances_between_selections_11_1.png
Oops, something went wrong.
Binary file added
BIN
+19.2 KB
.../examples_analysis_distances_and_contacts_distances_between_selections_18_1.png
Oops, something went wrong.
Binary file added
BIN
+124 KB
...es/examples_analysis_distances_and_contacts_distances_within_selection_15_1.png
Oops, something went wrong.
Binary file added
BIN
+135 KB
...es/examples_analysis_distances_and_contacts_distances_within_selection_25_1.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
2.9.0-dev0/_images/examples_analysis_hydrogen_bonds_hbonds-lifetimes_13_0.png
Oops, something went wrong.
Binary file added
BIN
+21.7 KB
2.9.0-dev0/_images/examples_analysis_hydrogen_bonds_hbonds-lifetimes_17_0.png
Oops, something went wrong.
Binary file added
BIN
+38.3 KB
2.9.0-dev0/_images/examples_analysis_hydrogen_bonds_hbonds-lifetimes_21_0.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
2.9.0-dev0/_images/examples_analysis_hydrogen_bonds_hbonds-lifetimes_30_0.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+25.6 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_29_1.png
Oops, something went wrong.
Binary file added
BIN
+23.9 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_32_1.png
Oops, something went wrong.
Binary file added
BIN
+55.7 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_39_1.png
Oops, something went wrong.
Binary file added
BIN
+43.6 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_41_1.png
Oops, something went wrong.
Binary file added
BIN
+104 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_43_1.png
Oops, something went wrong.
Binary file added
BIN
+88.3 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_45_1.png
Oops, something went wrong.
Binary file added
BIN
+38.1 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_47_1.png
Oops, something went wrong.
Binary file added
BIN
+21.4 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_58_1.png
Oops, something went wrong.
Binary file added
BIN
+103 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_60_1.png
Oops, something went wrong.
Binary file added
BIN
+56 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_hole2_66_0.png
Oops, something went wrong.
Binary file added
BIN
+10.1 KB
2.9.0-dev0/_images/examples_analysis_polymers_and_membranes_polymer_18_1.png
Oops, something went wrong.
Binary file added
BIN
+107 KB
2.9.0-dev0/_images/examples_analysis_reduced_dimensions_diffusion_map_15_1.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
2.9.0-dev0/_images/examples_analysis_reduced_dimensions_diffusion_map_9_1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.1 KB
2.9.0-dev0/_images/examples_analysis_structure_elastic_network_13_1.png
Oops, something went wrong.
Binary file added
BIN
+36.5 KB
2.9.0-dev0/_images/examples_analysis_structure_elastic_network_15_1.png
Oops, something went wrong.
Binary file added
BIN
+10.2 KB
2.9.0-dev0/_images/examples_analysis_structure_elastic_network_20_1.png
Oops, something went wrong.
Binary file added
BIN
+45.3 KB
2.9.0-dev0/_images/examples_analysis_structure_elastic_network_21_1.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+30.3 KB
2.9.0-dev0/_images/examples_analysis_structure_site_specific_rdf_14_1.png
Oops, something went wrong.
Binary file added
BIN
+22.7 KB
2.9.0-dev0/_images/examples_analysis_structure_site_specific_rdf_23_1.png
Oops, something went wrong.
Binary file added
BIN
+28.3 KB
2.9.0-dev0/_images/examples_analysis_structure_site_specific_rdf_27_1.png
Oops, something went wrong.
Binary file added
BIN
+20.1 KB
...examples_analysis_trajectory_similarity_clustering_ensemble_similarity_20_0.png
Oops, something went wrong.
Binary file added
BIN
+20.1 KB
...examples_analysis_trajectory_similarity_clustering_ensemble_similarity_27_0.png
Oops, something went wrong.
Binary file added
BIN
+23.7 KB
...examples_analysis_trajectory_similarity_clustering_ensemble_similarity_38_0.png
Oops, something went wrong.
Binary file added
BIN
+21.3 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_convergence_13_1.png
Oops, something went wrong.
Binary file added
BIN
+37 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_convergence_21_1.png
Oops, something went wrong.
Binary file added
BIN
+21.8 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_convergence_27_1.png
Oops, something went wrong.
Binary file added
BIN
+37.8 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_convergence_33_1.png
Oops, something went wrong.
Binary file added
BIN
+20.7 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_16_0.png
Oops, something went wrong.
Binary file added
BIN
+72.2 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_19_1.png
Oops, something went wrong.
Binary file added
BIN
+20.7 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_27_0.png
Oops, something went wrong.
Binary file added
BIN
+78.7 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_28_1.png
Oops, something went wrong.
Binary file added
BIN
+18.2 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_37_0.png
Oops, something went wrong.
Binary file added
BIN
+11.8 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_41_1.png
Oops, something went wrong.
Binary file added
BIN
+15.7 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_43_1.png
Oops, something went wrong.
Binary file added
BIN
+79.2 KB
...analysis_trajectory_similarity_dimension_reduction_ensemble_similarity_45_1.png
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
...s/examples_analysis_trajectory_similarity_harmonic_ensemble_similarity_14_0.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_psa_20_1.png
Oops, something went wrong.
Binary file added
BIN
+15.1 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_psa_22_1.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_psa_27_1.png
Oops, something went wrong.
Binary file added
BIN
+15.1 KB
2.9.0-dev0/_images/examples_analysis_trajectory_similarity_psa_28_1.png
Oops, something went wrong.
Binary file added
BIN
+119 KB
2.9.0-dev0/_images/examples_analysis_volumetric_density_analysis_33_0.png
Oops, something went wrong.
Binary file added
BIN
+82.5 KB
2.9.0-dev0/_images/examples_analysis_volumetric_density_analysis_40_0.png
Oops, something went wrong.
Binary file added
BIN
+26.9 KB
2.9.0-dev0/_images/examples_analysis_volumetric_density_analysis_50_0.png
Oops, something went wrong.
Binary file added
BIN
+78.7 KB
2.9.0-dev0/_images/examples_analysis_volumetric_density_analysis_52_0.png
Oops, something went wrong.
Binary file added
BIN
+15.2 KB
2.9.0-dev0/_images/examples_analysis_volumetric_linear_density_14_1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
.. -*- coding: utf-8 -*- | ||
.. _advanced-topology: | ||
|
||
========================== | ||
Advanced topology concepts | ||
========================== | ||
|
||
.. _adding-residue: | ||
|
||
Adding a Residue or Segment to a Universe | ||
========================================= | ||
|
||
To add a :class:`~MDAnalysis.core.groups.Residue` or :class:`~MDAnalysis.core.groups.Segment` to a topology, use the :meth:`Universe.add_Residue <MDAnalysis.core.universe.Universe.add_Residue>` or :meth:`Universe.add_Segment <MDAnalysis.core.universe.Universe.add_Segment>` methods. | ||
|
||
.. code-block:: | ||
>>> u = mda.Universe(PSF, DCD) | ||
>>> u.segments | ||
<SegmentGroup with 1 segment> | ||
>>> u.segments.segids | ||
array(['4AKE'], dtype=object) | ||
>>> newseg = u.add_Segment(segid='X') | ||
>>> u.segments.segids | ||
array(['4AKE', 'X'], dtype=object) | ||
>>> newseg.atoms | ||
<AtomGroup with 0 atoms> | ||
To assign the last 100 residues from the :class:`~MDAnalysis.core.universe.Universe` to this new Segment: | ||
|
||
.. code-block:: | ||
>>> u.residues[-100:].segments = newseg | ||
>>> newseg.atoms | ||
<AtomGroup with 1600 atoms> | ||
Another example is `creating custom segments for protein domains <examples/constructing_universe.ipynb#Adding-a-new-segment>`_. | ||
|
||
|
||
.. _molecule: | ||
|
||
Molecules | ||
========= | ||
|
||
In MDAnalysis, a molecule is a GROMACS-only concept that is relevant in some analysis methods. A group of atoms is considered a "molecule" if it is defined by the :code:`[ moleculetype ]` section in a `GROMACS topology <http://manual.gromacs.org/documentation/2019/reference-manual/file-formats.html#top>`_. Molecules are only defined if a Universe is created from a GROMACS topology file (i.e. with a .tpr extension). Unlike fragments, they are not accessible directly from atoms. | ||
|
||
.. code-block:: | ||
>>> tpr = mda.Universe(TPR) | ||
>>> tpr.atoms.molecules | ||
Traceback (most recent call last): | ||
File "<stdin>", line 1, in <module> | ||
File "MDAnalysis/core/groups.py", line 2278, in __getattr__ | ||
cls=self.__class__.__name__, attr=attr)) | ||
AttributeError: AtomGroup has no attribute molecules | ||
However, the order (:code:`molnum`) and name (:code:`moltype`) of each molecule is accessible as :ref:`topology attributes <topology-attributes>`:: | ||
|
||
>>> tpr.atoms.molnums | ||
array([ 0, 0, 0, ..., 11086, 11087, 11088]) | ||
>>> tpr.atoms.moltypes | ||
array(['AKeco', 'AKeco', 'AKeco', ..., 'NA+', 'NA+', 'NA+'], dtype=object) | ||
|
||
|
||
.. _custom-topologyattrs: | ||
|
||
Adding custom TopologyAttrs | ||
=========================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,276 @@ | ||
.. -*- coding: utf-8 -*- | ||
.. _atomgroup: | ||
|
||
AtomGroup | ||
==================== | ||
|
||
A :class:`~MDAnalysis.core.universe.Universe` contains all particles in the molecular system. MDAnalysis calls a particle an :class:`~MDAnalysis.core.groups.Atom`, regardless of whether it really is (e.g. it may be a united-atom particle or coarse-grained bead). :class:`~MDAnalysis.core.groups.Atom`\ s are grouped with an :class:`~MDAnalysis.core.groups.AtomGroup`; the 'master' :class:`~MDAnalysis.core.groups.AtomGroup` of a Universe is accessible at :code:`Universe.atoms`. | ||
|
||
.. note:: | ||
The :class:`~MDAnalysis.core.groups.AtomGroup` is probably the most important object in MDAnalysis. Virtually everything can be accessed through an :class:`~MDAnalysis.core.groups.AtomGroup`. | ||
|
||
----------------------- | ||
Creating an AtomGroup | ||
----------------------- | ||
|
||
|
||
Atom selection language | ||
----------------------- | ||
|
||
AtomGroup instances are typically created with :meth:`Universe.select_atoms <MDAnalysis.core.universe.Universe.select_atoms>` or by manipulating another :class:`~MDAnalysis.core.groups.AtomGroup`, e.g. by slicing. | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
import MDAnalysis as mda | ||
from MDAnalysis.tests.datafiles import PDB | ||
u = mda.Universe(PDB) | ||
u.select_atoms('resname ARG') | ||
See :ref:`Selections` for more information. | ||
|
||
|
||
Indexing and slicing | ||
-------------------- | ||
|
||
An :class:`~MDAnalysis.core.groups.AtomGroup` can be indexed and sliced like a list: | ||
|
||
.. ipython:: python | ||
print(u.atoms[0]) | ||
Slicing returns another :class:`~MDAnalysis.core.groups.AtomGroup`. The below code returns an :class:`~MDAnalysis.core.groups.AtomGroup` of every second element from the first to the 6th element, corresponding to indices 0, 2, and 4. | ||
|
||
.. ipython:: python | ||
ag = u.atoms[0:6:2] | ||
ag.indices | ||
MDAnalysis also supports fancy indexing: passing a :class:`~numpy.ndarray` or a :class:`~list`. | ||
|
||
.. ipython:: python | ||
indices = [0, 3, -1, 10, 3] | ||
u.atoms[indices].indices | ||
Boolean indexing allows you to pass in an array of :code:`True` or :code:`False` values to create a new :class:`~MDAnalysis.core.groups.AtomGroup` from another. The array must be the same length as the original :class:`~MDAnalysis.core.groups.AtomGroup`. This allows you to select atoms on conditions. | ||
|
||
.. ipython:: | ||
:verbatim: | ||
|
||
In [1]: arr = u.atoms.resnames == 'ARG' | ||
|
||
In [2]: len(arr) == len(u.atoms) | ||
|
||
In [3]: arr | ||
Out[3]: Out[11]: array([False, False, False, ..., False, False, False]) | ||
|
||
In [4]: u.atoms[arr] | ||
|
||
|
||
Group operators and set methods | ||
------------------------------- | ||
|
||
MDAnalysis supports a number of ways to compare :class:`~MDAnalysis.core.groups.AtomGroup`\ s or construct a new one: group operators (e.g. :meth:`~MDAnalysis.core.groups.AtomGroup.concatenate`, :meth:`~MDAnalysis.core.groups.AtomGroup.subtract`) and set methods (e.g. :meth:`~MDAnalysis.core.groups.AtomGroup.union`, :meth:`~MDAnalysis.core.groups.AtomGroup.difference`). Group operators achieve a similar outcome to set methods. However, a key difference is that :meth:`~MDAnalysis.core.groups.AtomGroup.concatenate` and :meth:`~MDAnalysis.core.groups.AtomGroup.subtract` preserve the order of the atoms and any duplicates. :meth:`~MDAnalysis.core.groups.AtomGroup.union` and :meth:`~MDAnalysis.core.groups.AtomGroup.difference` return an :class:`~MDAnalysis.core.groups.AtomGroup` where each atom is unique, and ordered by its topology index. | ||
|
||
.. ipython:: python | ||
ag1 = u.atoms[1:6] | ||
ag2 = u.atoms[8:3:-1] | ||
concat = ag1 + ag2 | ||
concat.indices | ||
union = ag1 | ag2 | ||
union.indices | ||
**Available operators** | ||
|
||
Unlike set methods and atom selection language, concatenation and subtraction keep the order of the atoms as well as duplicates. | ||
|
||
+-------------------------------+------------+----------------------------+ | ||
| Operation | Equivalent | Result | | ||
+===============================+============+============================+ | ||
| ``len(s)`` | | number of atoms | | ||
| | | in the group | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s == t`` | | test if ``s`` and ``t`` | | ||
| | | contain the same elements | | ||
| | | in the same order | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.concatenate(t)`` | ``s + t`` | new Group with elements | | ||
| | | from ``s`` and from ``t`` | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.subtract(t)`` | | new Group with elements | | ||
| | | from ``s`` that are not | | ||
| | | in ``t`` | | ||
+-------------------------------+------------+----------------------------+ | ||
|
||
**Available set methods** | ||
|
||
Each of these methods create groups that are sorted sets of unique :class:`~MDAnalysis.core.groups.Atom`\ s. | ||
|
||
+-------------------------------+------------+----------------------------+ | ||
| Operation | Equivalent | Result | | ||
+===============================+============+============================+ | ||
| ``s.isdisjoint(t)`` | | ``True`` if ``s`` and | | ||
| | | ``t`` do not share | | ||
| | | elements | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.issubset(t)`` | | test if all elements of | | ||
| | | ``s`` are part of ``t`` | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.is_strict_subset(t)`` | | test if all elements of | | ||
| | | ``s`` are part of ``t``, | | ||
| | | and ``s != t`` | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.issuperset(t)`` | | test if all elements of | | ||
| | | ``t`` are part of ``s`` | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.is_strict_superset(t)`` | | test if all elements of | | ||
| | | ``t`` are part of ``s``, | | ||
| | | and ``s != t`` | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.union(t)`` | ``s | t`` | new Group with elements | | ||
| | | from both ``s`` and ``t`` | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.intersection(t)`` | ``s & t`` | new Group with elements | | ||
| | | common to ``s`` and ``t`` | | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.difference(t)`` | ``s - t`` | new Group with elements of | | ||
| | | ``s`` that are not in ``t``| | ||
+-------------------------------+------------+----------------------------+ | ||
| ``s.symmetric_difference(t)`` | ``s ^ t`` | new Group with elements | | ||
| | | that are part of ``s`` or | | ||
| | | ``t`` but not both | | ||
+-------------------------------+------------+----------------------------+ | ||
|
||
Groupby and split | ||
----------------- | ||
|
||
An :class:`~MDAnalysis.core.groups.AtomGroup` can be constructed from another by separating atoms by properties. | ||
|
||
:meth:`AtomGroup.split <MDAnalysis.core.groups.AtomGroup.split>` can create a list of :class:`~MDAnalysis.core.groups.AtomGroup`\ s by splitting another :class:`~MDAnalysis.core.groups.AtomGroup` by the 'level' of connectivity: one of *atom*, *residue*, *molecule*, or *segment*. | ||
|
||
.. ipython:: python | ||
ag1 = u.atoms[:100] | ||
ag1.split('residue') | ||
An :class:`~MDAnalysis.core.groups.AtomGroup` can also be separated according to values of :ref:`topology attributes <topology-attributes>` to produce a dictionary of :code:`{value:AtomGroup}`. | ||
|
||
.. ipython:: python | ||
u.atoms.groupby('masses') | ||
Passing in multiple attributes groups them in order: | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
u.select_atoms('resname SOL NA+').groupby(['masses', 'resnames']) | ||
Constructing from Atoms | ||
----------------------- | ||
|
||
An :class:`~MDAnalysis.core.groups.AtomGroup` can be created from an iterable of :class:`~MDAnalysis.core.groups.Atom` instances: | ||
|
||
.. ipython:: python | ||
atom1 = u.atoms[4] | ||
atom2 = u.atoms[6] | ||
atom3 = u.atoms[2] | ||
ag = mda.AtomGroup([atom1, atom2, atom3]) | ||
print(ag) | ||
A neat shortcut for this is to simply add an :class:`~MDAnalysis.core.groups.Atom` to another :class:`~MDAnalysis.core.groups.Atom` or :class:`~MDAnalysis.core.groups.AtomGroup`: | ||
|
||
.. ipython:: python | ||
ag = atom1 + atom2 | ||
print(ag) | ||
ag += atom3 | ||
print(ag) | ||
An alternative method is to provide a list of indices and the Universe that the :class:`~MDAnalysis.core.groups.Atom`\ s belong to: | ||
|
||
.. ipython:: python | ||
ag = mda.AtomGroup([4, 6, 2], u) | ||
print(ag) | ||
Order and uniqueness | ||
----------------------- | ||
|
||
These methods of creating an :class:`~MDAnalysis.core.groups.AtomGroup` result in a sorted, unique list of atoms: | ||
|
||
* Atom selection language | ||
* Slicing | ||
* Boolean indexing | ||
* Set methods | ||
* :meth:`AtomGroup.split <MDAnalysis.core.groups.AtomGroup.split>` and :meth:`AtomGroup.groupby <MDAnalysis.core.groups.AtomGroup.groupby>` | ||
|
||
These methods return a user-ordered :class:`~MDAnalysis.core.groups.AtomGroup` that can contain duplicates: | ||
|
||
* Fancy indexing (with arrays or lists) | ||
* Group operations (:meth:`AtomGroup.concatenate <MDAnalysis.core.groups.AtomGroup.concatenate>` and :meth:`AtomGroup.subtract <MDAnalysis.core.groups.AtomGroup.subtract>`) | ||
* Constructing directly from :class:`~MDAnalysis.core.groups.Atom`\ s | ||
|
||
Empty AtomGroups | ||
---------------- | ||
|
||
MDAnalysis can also work with empty AtomGroups: | ||
|
||
.. ipython:: python | ||
null = u.atoms[[]] | ||
null | ||
The above is the same as creating an :class:`~MDAnalysis.core.groups.AtomGroup` from an empty list and a :class:`~MDAnalysis.core.universe.Universe`. | ||
|
||
.. ipython:: python | ||
mda.AtomGroup([], u) | ||
Each method of creating an AtomGroup can also be used to create an empty one. For example, using selection language: | ||
|
||
.. ipython:: python | ||
u.select_atoms("resname DOES_NOT_EXIST") | ||
and indexing: | ||
|
||
.. ipython:: python | ||
u.atoms[6:6] | ||
or set methods: | ||
|
||
.. ipython:: python | ||
u.atoms - u.atoms | ||
Empty AtomGroups have a length of 0 and evaluate to :code:`False` in a boolean context. | ||
|
||
.. ipython:: python | ||
bool(null) | ||
This allows analysis methods to skip over empty AtomGroups instead of raising an error, which is helpful as occasionally empty AtomGroups can arise from selection logic that is too restrictive (e.g. :ref:`geometric selections <geometric>`). | ||
|
||
|
||
Dynamically updating AtomGroups | ||
------------------------------- | ||
|
||
A normal AtomGroup is static, and the atoms within it do not change as the trajectory frame changes. Several methods require dynamically updating AtomGroups. These are typically created using atom selection language. See :ref:`dynamic-selections` for more information. | ||
|
||
------- | ||
Methods | ||
------- | ||
|
||
Most of the analysis functionality in MDAnalysis is implemented in :ref:`the analysis module <analysis>`, but many interesting methods can be accessed from an :class:`~MDAnalysis.core.groups.AtomGroup` directly. For example, Bonds, Angles, Dihedrals and ImproperDihedrals :ref:`can be created from AtomGroups <topology-objects>`. Providing that required topology attributes are present, :ref:`a number of analysis methods are also available <topology-groupmethods>` to a :class:`~MDAnalysis.core.groups.AtomGroup`, :class:`~MDAnalysis.core.groups.ResidueGroup`, and :class:`~MDAnalysis.core.groups.SegmentGroup`. |
Oops, something went wrong.