atoms¶
-
mdtools.select.
atoms
(ag, sel, warn_empty=True, verbose=True, **kwargs)[source]¶ Select
Atoms
from a MDAnalysisAtomGroup
instance based on a selection string.- Parameters
ag (MDAnalysis.core.groups.AtomGroup) – MDAnalysis
AtomGroup
,UpdatingAtomGroup
orUniverse
from which theAtoms
will be selected.sel (str) – Selection string for selecting
Atoms
out of ag. See MDAnalysis’ selection syntax for possible choices.warn_empty (bool, optional) – If
True
(default), raise aRuntimeWarning
if the createdAtomGroup
contains noAtoms
and is not anUpdatingAtomGroup
.verbose (bool, optional) – If
True
, print some basic information about the created MDAnalysisAtomGroup
to standard output. In fact, if verbose isFalse
,mdtools.select.atoms()
simply callsselect_atoms()
and returns the resultingAtomGroup
.kwargs (dict, optional) – Additional keyword arguments to pass to
MDAnalysis.core.groups.AtomGroup.select_atoms()
.
- Returns
selection – A MDAnalysis
AtomGroup
orUpdatingAtomGroup
(if updating isTrue
) containing the selectedAtoms
.- Return type
MDAnalysis.core.groups.AtomGroup or MDAnalysis.core.groups.UpdatingAtomGroup
See also
MDAnalysis.core.groups.AtomGroup.select_atoms()
Underlying function of this function
mdtools.run_time_info.ag_info_str()
Create a string containing information about a MDAnalysis
AtomGroup
.
Notes
This function is just a convinient wrapper around
MDAnalysis.core.groups.AtomGroup.select_atoms()
that can print the information generated bymdtools.run_time_info.ag_info_str()
about the createdMDAnalysis.core.groups.AtomGroup
to standard output.