atoms
- mdtools.select.atoms(ag, sel, warn_empty=True, verbose=True, **kwargs)[source]
Select
Atoms
from an MDAnalysisAtomGroup
instance based on a selection string.- Parameters:
ag (
MDAnalysis.core.groups.AtomGroup
) – MDAnalysisAtomGroup
,UpdatingAtomGroup
orUniverse
from which theAtoms
will be selected.sel (
str
) – Selection string for selectingAtoms
out of ag. See MDAnalysis’ selection syntax for possible choices.warn_empty (
bool
, optional) – IfTrue
(default), raise aRuntimeWarning
if the createdAtomGroup
contains noAtoms
and is not anUpdatingAtomGroup
.verbose (
bool
, optional) – IfTrue
, 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 parse toMDAnalysis.core.groups.AtomGroup.select_atoms()
.
- Returns:
selection (
MDAnalysis.core.groups.AtomGroup
orMDAnalysis.core.groups.UpdatingAtomGroup
) – An MDAnalysisAtomGroup
orUpdatingAtomGroup
(if updating isTrue
) containing the selectedAtoms
.- Raises:
RuntimeWarning : – warn_empty is
True
and the createdAtomGroup
contains no atoms and is not anUpdatingAtomGroup
.
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 an MDAnalysis
AtomGroup
.
Notes
This function is just a convenient 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.