From d37dc4d477cb7fb2c708e27f56b47f3edb26e9ee Mon Sep 17 00:00:00 2001 From: aya9aladdin Date: Sun, 28 Aug 2022 10:29:51 +0200 Subject: [PATCH 1/4] guesser ug --- .../formats/guessers/default_guesser.rst | 72 +++++++++++++++++++ doc/source/formats/guessers_list.rst | 12 ++++ doc/source/universe.rst | 49 +++++++++---- 3 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 doc/source/formats/guessers/default_guesser.rst create mode 100644 doc/source/formats/guessers_list.rst diff --git a/doc/source/formats/guessers/default_guesser.rst b/doc/source/formats/guessers/default_guesser.rst new file mode 100644 index 000000000..9d27e3913 --- /dev/null +++ b/doc/source/formats/guessers/default_guesser.rst @@ -0,0 +1,72 @@ +.. -*- coding: utf-8 -*- +.. _default-guesser: + +==================== +Default guesser +==================== + +The default guesser class contain generic methods that is not intended to any specific context. It is useful in general purpose guessing for universes that has no special cases. + + +.. _guessing-masses: + +Masses +====== + +Atom masses are always guessed for every file format. They are guessed from the ``Atom.atom_type``. This attribute represents a number of different values in MDAnalysis, depending on which file format you used to create your Universe. ``Atom.atom_type`` can be force-field specific atom types, from files that provide this information; or it can be an element, guessed from the atom name. `See further discussion here. `_ + + +.. important:: + + When an atom mass cannot be guessed from the atom ``atom_type`` or ``name``, the atom is assigned a mass of 0.0. Masses are guessed atom-by-atom, so even if most atoms have been guessed correctly, it is possible that some have been given masses of 0. It is important to check for non-zero masses before using methods that rely on them, such as :meth:`AtomGroup.center_of_mass`. + + +Types +===== + +When atom ``atom_type``\ s are guessed, they represent the atom element. Atom types are always guessed from the atom name. MDAnalysis follows biological naming conventions, where atoms named "CA" are much more likely to represent an alpha-carbon than a calcium atom. This guesser is still relatively fragile for non-traditionally biological atom names. + +Bonds, Angles, Dihedrals, Impropers +==================================== + +MDAnalysis can guess if bonds exist between two atoms, based on the distance between them. A bond is created if the 2 atoms are within + +.. math:: + + d < f \cdot (R_1 + R_2) + +of each other, where :math:`R_1` and :math:`R_2` are the VdW radii +of the atoms and :math:`f` is an ad-hoc *fudge_factor*. This is +the `same algorithm that VMD uses`_. + +Angles can be guessed from the bond connectivity. MDAnalysis assumes that if atoms 1 & 2 are bonded, and 2 & 3 are bonded, then (1,2,3) must be an angle. + +:: + + 1 + \ + 2 -- 3 + +Dihedral angles and improper dihedrals can both be guessed from angles. Proper dihedrals are guessed by assuming that if (1,2,3) is an angle, and 3 & 4 are bonded, then (1,2,3,4) must be a dihedral. + +:: + + 1 4 + \ / + 2 -- 3 + +Likewise, if (1,2,3) is an angle, and 2 & 4 are bonded, then (2, 1, 3, 4) must be an improper dihedral (i.e. the improper dihedral is the angle between the planes formed by (1, 2, 3) and (1, 3, 4)) + +:: + + 1 + \ + 2 -- 3 + / + 4 + +The method available to users is :meth:`AtomGroup.guess_bonds `, which allows users to pass in a dictionary of van der Waals' radii for atom types. This guesses bonds, angles, and dihedrals (but not impropers) for the specified AtomGroup and adds it to the underlying Universe. + + +.. _`same algorithm that VMD uses`: + http://www.ks.uiuc.edu/Research/vmd/vmd-1.9.1/ug/node26.html diff --git a/doc/source/formats/guessers_list.rst b/doc/source/formats/guessers_list.rst new file mode 100644 index 000000000..426854e26 --- /dev/null +++ b/doc/source/formats/guessers_list.rst @@ -0,0 +1,12 @@ +.. -*- coding: utf-8 -*- +.. _guessers-list: + +==================== +Guessers list +==================== + +.. toctree:: + :maxdepth: 1 + :glob: + + guessers/* diff --git a/doc/source/universe.rst b/doc/source/universe.rst index 2dd410674..3c684b530 100644 --- a/doc/source/universe.rst +++ b/doc/source/universe.rst @@ -9,14 +9,14 @@ Universe -- Carl Sagan, Cosmos -MDAnalysis is structured around two fundamental classes: the :class:`~MDAnalysis.core.universe.Universe` and the :class:`~MDAnalysis.core.groups.AtomGroup`. Almost all code in MDAnalysis begins with :class:`~MDAnalysis.core.universe.Universe`, which contains all the information describing a molecular dynamics system. +MDAnalysis is structured around two fundamental classes: the :class:`~MDAnalysis.core.universe.Universe` and the :class:`~MDAnalysis.core.groups.AtomGroup`. Almost all code in MDAnalysis begins with :class:`~MDAnalysis.core.universe.Universe`, which contains all the information describing a molecular dynamics system. It has two key properties: * :attr:`~MDAnalysis.core.universe.Universe.atoms`: an :class:`~MDAnalysis.core.groups.AtomGroup` of the system's atoms, providing access to important analysis methods (described below) * :attr:`~MDAnalysis.core.universe.Universe.trajectory`: the currently loaded trajectory reader -A :class:`~MDAnalysis.core.universe.Universe` ties the static information from the "topology" (e.g. atom identities) to dynamically updating information from the "trajectory" (e.g. coordinates). A key feature of MDAnalysis is that an entire trajectory is not loaded into memory (unless the user explicitly does so with :class:`~MDAnalysis.coordinates.memory.MemoryReader`). Instead, the :attr:`~MDAnalysis.core.universe.Universe.trajectory` attribute provides a view on a specific frame of the trajectory. This allows the analysis of arbitrarily long trajectories without a significant impact on memory. +A :class:`~MDAnalysis.core.universe.Universe` ties the static information from the "topology" (e.g. atom identities) to dynamically updating information from the "trajectory" (e.g. coordinates). A key feature of MDAnalysis is that an entire trajectory is not loaded into memory (unless the user explicitly does so with :class:`~MDAnalysis.coordinates.memory.MemoryReader`). Instead, the :attr:`~MDAnalysis.core.universe.Universe.trajectory` attribute provides a view on a specific frame of the trajectory. This allows the analysis of arbitrarily long trajectories without a significant impact on memory. ------------------- Creating a Universe @@ -29,14 +29,14 @@ Loading from files A Universe is typically created from a "topology" file, with optional "trajectory" file/s. Trajectory files must have the coordinates in the same order as atoms in the topology. See :ref:`Formats ` for the topology and trajectory formats supported by MDAnalysis, and how to load each specific format. :: - u = Universe(topology, trajectory) + u = Universe(topology, trajectory) u = Universe(pdbfile) # read atoms and coordinates from PDB or GRO u = Universe(topology, [traj1, traj2, ...]) # read from a list of trajectories u = Universe(topology, traj1, traj2, ...) # read from multiple trajectories -The line between topology and trajectory files is quite blurry. For example, a PDB or GRO file is considered both a topology and a trajectory file. The difference is that a **topology file** provides static information, such as atom identities (name, mass, etc.), charges, and bond connectivity. A **trajectory file** provides dynamic information, such as coordinates, velocities, forces, and box dimensions. +The line between topology and trajectory files is quite blurry. For example, a PDB or GRO file is considered both a topology and a trajectory file. The difference is that a **topology file** provides static information, such as atom identities (name, mass, etc.), charges, and bond connectivity. A **trajectory file** provides dynamic information, such as coordinates, velocities, forces, and box dimensions. -If only a single file is provided, MDAnalysis tries to read both topology and trajectory information from it. When multiple trajectory files are provided, coordinates are loaded in the order given. +If only a single file is provided, MDAnalysis tries to read both topology and trajectory information from it. When multiple trajectory files are provided, coordinates are loaded in the order given. The default arguments should create a Universe suited for most analysis applications. However, the :class:`~MDAnalysis.core.universe.Universe` constructor also takes optional arguments. @@ -58,7 +58,7 @@ The default arguments should create a Universe suited for most analysis applicat u2 = mda.Universe(GRO, XTC, XTC, all_coordinates=False, continuous=False) print([int(ts.time) for ts in u2.trajectory]) - + **The following options modify the created Universe:** @@ -84,12 +84,12 @@ You can also pass in keywords for parsing the topology or coordinates. For examp user_timestep.trajectory.dt - + Constructing from AtomGroups ---------------------------- -A new Universe can be created from one or more :class:`~MDAnalysis.core.groups.AtomGroup` instances with :func:`~MDAnalysis.core.universe.Merge()`. The :class:`~MDAnalysis.core.groups.AtomGroup` instances can come from different Universes, meaning that this is one way to concatenate selections from different datasets. +A new Universe can be created from one or more :class:`~MDAnalysis.core.groups.AtomGroup` instances with :func:`~MDAnalysis.core.universe.Merge()`. The :class:`~MDAnalysis.core.groups.AtomGroup` instances can come from different Universes, meaning that this is one way to concatenate selections from different datasets. For example, to combine a protein, ligand, and solvent from separate PDB files: @@ -107,9 +107,9 @@ Constructing from scratch A Universe can be constructed from scratch with :meth:`Universe.empty `. There are three stages to this process: - #. Create the blank Universe with specified number of atoms. If coordinates, set :code:`trajectory=True`. + #. Create the blank Universe with specified number of atoms. If coordinates, set :code:`trajectory=True`. #. Add topology attributes such as atom names. - #. (Optional) Load coordinates. + #. (Optional) Load coordinates. For example, to construct a universe with 6 atoms in 2 residues: @@ -119,19 +119,44 @@ For example, to construct a universe with 6 atoms in 2 residues: u = mda.Universe.empty(6, 2, atom_resindex=[0, 0, 0, 1, 1, 1], trajectory=True) u.add_TopologyAttr('masses') coordinates = np.empty((1000, # number of frames - u.atoms.n_atoms, + u.atoms.n_atoms, 3)) u.load_new(coordinates, order='fac') `See this notebook tutorial for more information. `_ +.. _guessing-topology-attributes: +---------------------------- Guessing topology attributes ---------------------------- -MDAnalysis can guess two kinds of information. Sometimes MDAnalysis guesses information instead of reading it from certain file formats, which can lead to mistakes such as assigning atoms the wrong element or charge. See :ref:`the available topology parsers ` for a case-by-case breakdown of which atom properties MDAnalysis guesses for each format. See :ref:`guessing` for how attributes are guessed, and :ref:`topologyattr-defaults` for which attributes have default values. +MDAnalysis has a guesser library that hold various guesser classes. Each guesser class is tailored to be context-specific. For example, PDBGuesser is specific for guessing attributes for PDB file format. See :ref:`guessing` for more details about the available context-aware guessers. +The Universe has the ability to guess an attribute within a specific context at the universe creation or by using :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API. +For example, to guess ``element`` attribute for a PDB file by either of two ways: + +.. ipython:: python + :okwarning: + + u = mda.Universe(PDB, context='PDB', to_guess=['elements']) + +or by using the :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API + +.. ipython:: python + :okwarning: + + u = mda.Universe(PDB) + u.guess_TopologyAttributes(context='PDB', to_guess=['elements']) + +**The following options modify how to guess attribute(s):** + +* :code:`context`: the context of the guesser to be used in guessing the attribute. You can pass either a string representing the context (see :ref:`guessing` for more detail about available guessers and their context), or as an object of a guesser class. The default value of the context is :code:`default`, which corresponds to a generic :class:`~MDAnalysis.guesser.default_guesser.DefaultGuesser`, that is not specific to any context. You can pass a context once, and whenever you call :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` again without passing context, it will assume that you still using the same context. +* :code:`to_guess`: a list of the desired attributes to be guessed. This has to be the plural name of the attributes (masses not mass). +* :code:`**kwargs`: to pass any supplemental data to the :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API that can be useful in guessing some attributes (eg. passing vdwradii for bond guessing). +For now, MDAnalysis automatically guess :code:`types` and :code:`masses` for nearly all topology formats at the universe creation level. This is done using the :class:`~MDAnalysis.guesser.default_guesser.DefaultGuesser`, which maybe not accurate for all contexts. +You can easily override this as mentioned above, by using context specific guesser if there is one exists for your data. .. _universe-properties: From b542c00d67f7ea9b3206717877cc4a48d8ce4899 Mon Sep 17 00:00:00 2001 From: aya9aladdin Date: Sun, 28 Aug 2022 10:30:54 +0200 Subject: [PATCH 2/4] Update guessing.rst --- doc/source/formats/guessing.rst | 71 ++++++--------------------------- 1 file changed, 12 insertions(+), 59 deletions(-) diff --git a/doc/source/formats/guessing.rst b/doc/source/formats/guessing.rst index 2861dfd91..b4d510339 100644 --- a/doc/source/formats/guessing.rst +++ b/doc/source/formats/guessing.rst @@ -5,68 +5,21 @@ Guessing ==================== -When a Universe is created from a Universe, MDAnalysis guesses properties that have not been read from the file. Sometimes these properties are available in the file, but are simply not read by MDAnalysis. For example, :ref:`masses are always guessed `. +When a Universe is created from a Universe, MDAnalysis can guesses properties that have not been read from the file. Sometimes these properties are available in the file, but are simply not read by MDAnalysis. For example, masses are always guessed. +The :mod:`~MDAnalysis.guesser` module contains different context-specific guessers. This can be forcefield-specific like :class:`~MDAnalysis.guesser.default_guesser.MartiniGuesser`, or format-specific guesser like :class:`~MDAnalysis.guesser.default_guesser.PDBGuesser`. +You can utilize guessers either by initiating an object of it or through the :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API of the universe to guess various properties to the universe. See :ref:`Guessing topology attributes ` for details. -.. _guessing-masses: +.. _available-guessers: -Masses -====== +Available guessers +=================== -Atom masses are always guessed for every file format. They are guessed from the ``Atom.atom_type``. This attribute represents a number of different values in MDAnalysis, depending on which file format you used to create your Universe. ``Atom.atom_type`` can be force-field specific atom types, from files that provide this information; or it can be an element, guessed from the atom name. `See further discussion here. `_ +Here is a list of the currently available context-specific guesser and what attributes they can guess -.. important:: - When an atom mass cannot be guessed from the atom ``atom_type`` or ``name``, the atom is assigned a mass of 0.0. Masses are guessed atom-by-atom, so even if most atoms have been guessed correctly, it is possible that some have been given masses of 0. It is important to check for non-zero masses before using methods that rely on them, such as :meth:`AtomGroup.center_of_mass`. - - -Types -===== - -When atom ``atom_type``\ s are guessed, they represent the atom element. Atom types are always guessed from the atom name. MDAnalysis follows biological naming conventions, where atoms named "CA" are much more likely to represent an alpha-carbon than a calcium atom. This guesser is still relatively fragile for non-traditionally biological atom names. - -Bonds, Angles, Dihedrals, Impropers -==================================== - -MDAnalysis can guess if bonds exist between two atoms, based on the distance between them. A bond is created if the 2 atoms are within - -.. math:: - - d < f \cdot (R_1 + R_2) - -of each other, where :math:`R_1` and :math:`R_2` are the VdW radii -of the atoms and :math:`f` is an ad-hoc *fudge_factor*. This is -the `same algorithm that VMD uses`_. - -Angles can be guessed from the bond connectivity. MDAnalysis assumes that if atoms 1 & 2 are bonded, and 2 & 3 are bonded, then (1,2,3) must be an angle. - -:: - - 1 - \ - 2 -- 3 - -Dihedral angles and improper dihedrals can both be guessed from angles. Proper dihedrals are guessed by assuming that if (1,2,3) is an angle, and 3 & 4 are bonded, then (1,2,3,4) must be a dihedral. - -:: - - 1 4 - \ / - 2 -- 3 - -Likewise, if (1,2,3) is an angle, and 2 & 4 are bonded, then (2, 1, 3, 4) must be an improper dihedral (i.e. the improper dihedral is the angle between the planes formed by (1, 2, 3) and (1, 3, 4)) - -:: - - 1 - \ - 2 -- 3 - / - 4 - -The method available to users is :meth:`AtomGroup.guess_bonds `, which allows users to pass in a dictionary of van der Waals' radii for atom types. This guesses bonds, angles, and dihedrals (but not impropers) for the specified AtomGroup and adds it to the underlying Universe. - - -.. _`same algorithm that VMD uses`: - http://www.ks.uiuc.edu/Research/vmd/vmd-1.9.1/ug/node26.html - \ No newline at end of file ++--------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------+ +| **guesser** | **context** | **to_guess** | ++--------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------+ +| :ref:`DefaultGuesser ` | :code:`default` | masses, atom types, elements, bonds, angles, dihedrals, improper dihedrals, aromaticities, gasteiger charges | ++--------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------+ From cfc2816f9660953d150d005bce5c6401be343a52 Mon Sep 17 00:00:00 2001 From: Aya Alaa Date: Sun, 23 Oct 2022 13:01:27 +0200 Subject: [PATCH 3/4] Update universe.rst --- doc/source/universe.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/source/universe.rst b/doc/source/universe.rst index 3c684b530..f7d987717 100644 --- a/doc/source/universe.rst +++ b/doc/source/universe.rst @@ -133,7 +133,7 @@ Guessing topology attributes ---------------------------- MDAnalysis has a guesser library that hold various guesser classes. Each guesser class is tailored to be context-specific. For example, PDBGuesser is specific for guessing attributes for PDB file format. See :ref:`guessing` for more details about the available context-aware guessers. -The Universe has the ability to guess an attribute within a specific context at the universe creation or by using :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API. +The Universe has :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API, which ability to guess an attribute within a specific context either at the universe creation or by using the API directly. For example, to guess ``element`` attribute for a PDB file by either of two ways: .. ipython:: python @@ -141,7 +141,7 @@ For example, to guess ``element`` attribute for a PDB file by either of two ways u = mda.Universe(PDB, context='PDB', to_guess=['elements']) -or by using the :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API +or .. ipython:: python :okwarning: @@ -151,12 +151,14 @@ or by using the :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttribut **The following options modify how to guess attribute(s):** -* :code:`context`: the context of the guesser to be used in guessing the attribute. You can pass either a string representing the context (see :ref:`guessing` for more detail about available guessers and their context), or as an object of a guesser class. The default value of the context is :code:`default`, which corresponds to a generic :class:`~MDAnalysis.guesser.default_guesser.DefaultGuesser`, that is not specific to any context. You can pass a context once, and whenever you call :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` again without passing context, it will assume that you still using the same context. -* :code:`to_guess`: a list of the desired attributes to be guessed. This has to be the plural name of the attributes (masses not mass). +* :code:`context`: the context of the guesser to be used in guessing the attribute. You can pass either a string representing the context (see :ref:`guessing` for more detail about available guessers and their context), or as an object of a guesser class. The default value of the context is :code:`default`, which corresponds to a generic :class:`~MDAnalysis.guesser.default_guesser.DefaultGuesser`, that is not specific to any context. You can pass a context once, and whenever you call :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` again it will assume that you still using the same context. N.B.: If you didn't pass any ``context`` to the API, it will use the :class:`~MDAnalysis.guesser.default_guesser.DefaultGuesser` + +* :code:`to_guess`: list of the attributes to be guessed (these attributes will be either guessed if they don't exist in the universe or partially guessed by only filling its empty values if universe has the attribute). This has to be the plural name of the attributes (masses not mass). +* :code:`force_guess`: a list of attributes to be forced guessed (these attributes will be either guessed if they don't exist in the universe or their values will be completely overwritten by guessed ones if the universe has the attribute). This has to be the plural name of the attributes (masses not mass). * :code:`**kwargs`: to pass any supplemental data to the :meth:`~MDAnalysis.core.universe.Universe.guess_TopologyAttributes` API that can be useful in guessing some attributes (eg. passing vdwradii for bond guessing). -For now, MDAnalysis automatically guess :code:`types` and :code:`masses` for nearly all topology formats at the universe creation level. This is done using the :class:`~MDAnalysis.guesser.default_guesser.DefaultGuesser`, which maybe not accurate for all contexts. -You can easily override this as mentioned above, by using context specific guesser if there is one exists for your data. +For now, MDAnalysis automatically guess :code:`types` and * :code:`masses` at the universe creation by having a default value of the :code:`to_guess` parameter to be * :code`['types', 'masses']`. This is done using the :class:`~MDAnalysis.guesser.default_guesser.DefaultGuesser`. +you can stop this by passing ``()`` to the ``to_guess`` parameter. .. _universe-properties: From b98afd30e98b3b1c26e124ca8eea5bb00cc29c7f Mon Sep 17 00:00:00 2001 From: Aya Alaa Date: Sun, 23 Oct 2022 13:03:05 +0200 Subject: [PATCH 4/4] Update universe.rst --- doc/source/universe.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/universe.rst b/doc/source/universe.rst index f7d987717..c0015da9e 100644 --- a/doc/source/universe.rst +++ b/doc/source/universe.rst @@ -9,14 +9,14 @@ Universe -- Carl Sagan, Cosmos -MDAnalysis is structured around two fundamental classes: the :class:`~MDAnalysis.core.universe.Universe` and the :class:`~MDAnalysis.core.groups.AtomGroup`. Almost all code in MDAnalysis begins with :class:`~MDAnalysis.core.universe.Universe`, which contains all the information describing a molecular dynamics system. +MDAnalysis is structured around two fundamental classes: the :class:`~MDAnalysis.core.universe.Universe` and the :class:`~MDAnalysis.core.groups.AtomGroup`. Almost all code in MDAnalysis begins with :class:`~MDAnalysis.core.universe.Universe`, which contains all the information describing a molecular dynamics system. It has two key properties: * :attr:`~MDAnalysis.core.universe.Universe.atoms`: an :class:`~MDAnalysis.core.groups.AtomGroup` of the system's atoms, providing access to important analysis methods (described below) * :attr:`~MDAnalysis.core.universe.Universe.trajectory`: the currently loaded trajectory reader -A :class:`~MDAnalysis.core.universe.Universe` ties the static information from the "topology" (e.g. atom identities) to dynamically updating information from the "trajectory" (e.g. coordinates). A key feature of MDAnalysis is that an entire trajectory is not loaded into memory (unless the user explicitly does so with :class:`~MDAnalysis.coordinates.memory.MemoryReader`). Instead, the :attr:`~MDAnalysis.core.universe.Universe.trajectory` attribute provides a view on a specific frame of the trajectory. This allows the analysis of arbitrarily long trajectories without a significant impact on memory. +A :class:`~MDAnalysis.core.universe.Universe` ties the static information from the "topology" (e.g. atom identities) to dynamically updating information from the "trajectory" (e.g. coordinates). A key feature of MDAnalysis is that an entire trajectory is not loaded into memory (unless the user explicitly does so with :class:`~MDAnalysis.coordinates.memory.MemoryReader`). Instead, the :attr:`~MDAnalysis.core.universe.Universe.trajectory` attribute provides a view on a specific frame of the trajectory. This allows the analysis of arbitrarily long trajectories without a significant impact on memory. ------------------- Creating a Universe @@ -34,9 +34,9 @@ A Universe is typically created from a "topology" file, with optional "trajector u = Universe(topology, [traj1, traj2, ...]) # read from a list of trajectories u = Universe(topology, traj1, traj2, ...) # read from multiple trajectories -The line between topology and trajectory files is quite blurry. For example, a PDB or GRO file is considered both a topology and a trajectory file. The difference is that a **topology file** provides static information, such as atom identities (name, mass, etc.), charges, and bond connectivity. A **trajectory file** provides dynamic information, such as coordinates, velocities, forces, and box dimensions. +The line between topology and trajectory files is quite blurry. For example, a PDB or GRO file is considered both a topology and a trajectory file. The difference is that a **topology file** provides static information, such as atom identities (name, mass, etc.), charges, and bond connectivity. A **trajectory file** provides dynamic information, such as coordinates, velocities, forces, and box dimensions. -If only a single file is provided, MDAnalysis tries to read both topology and trajectory information from it. When multiple trajectory files are provided, coordinates are loaded in the order given. +If only a single file is provided, MDAnalysis tries to read both topology and trajectory information from it. When multiple trajectory files are provided, coordinates are loaded in the order given. The default arguments should create a Universe suited for most analysis applications. However, the :class:`~MDAnalysis.core.universe.Universe` constructor also takes optional arguments. @@ -107,7 +107,7 @@ Constructing from scratch A Universe can be constructed from scratch with :meth:`Universe.empty `. There are three stages to this process: - #. Create the blank Universe with specified number of atoms. If coordinates, set :code:`trajectory=True`. + #. Create the blank Universe with specified number of atoms. If coordinates, set :code:`trajectory=True`. #. Add topology attributes such as atom names. #. (Optional) Load coordinates.