-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data structures #14
Merged
Merged
Data structures #14
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
453b271
got started on data structures
79f98a4
removed own path
972bc1b
added images and combined data structures
73f1c44
removed generated files
a00d87f
removed autosummary
6b726c3
split coordinate and topology sections from data structures
bfefbbc
updated atomgroup methods and universe properties
65d91c6
split data structures and added refs
1b6a11d
checked atom selections
b2fd1cb
removed periodicity
f72e981
updated universe construction example
bd666ae
travis for nglview
357e772
fixed typo
229e589
added link to notebook
5c95874
removed DS_Store
8b694c5
implemented review changes
f7b5c1c
updated travis
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Binary file not shown.
Binary file not shown.
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
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,61 @@ | ||
.. -*- coding: utf-8 -*- | ||
.. _advanced-topology: | ||
|
||
========================== | ||
Advanced topology concepts | ||
========================== | ||
|
||
.. _adding-residue-label: | ||
|
||
Adding a Residue or Segment to a Universe | ||
----------------------------------------- | ||
|
||
To add a :class:`~MDAnalysis.core.groups.Residue` or :code:`~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-label: | ||
|
||
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:: pycon | ||
|
||
>>> 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) |
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,6 @@ | ||
.. -*- coding: utf-8 -*- | ||
.. analysis: | ||
|
||
===================== | ||
Analysis | ||
===================== |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kill the DS Store file below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a top-level
.gitignore
! You can copy the MDA .gitignore