atoms
- mdtools.select.atoms(ag, sel, warn_empty=True, verbose=True, **kwargs)[source]
Select
Atomsfrom an MDAnalysisAtomGroupinstance based on a selection string.- Parameters:
ag (
MDAnalysis.core.groups.AtomGroup) – MDAnalysisAtomGroup,UpdatingAtomGrouporUniversefrom which theAtomswill be selected.sel (
str) – Selection string for selectingAtomsout of ag. See MDAnalysis’ selection syntax for possible choices.warn_empty (
bool, optional) – IfTrue(default), raise aRuntimeWarningif the createdAtomGroupcontains noAtomsand is not anUpdatingAtomGroup.verbose (
bool, optional) – IfTrue, print some basic information about the created MDAnalysisAtomGroupto 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.AtomGrouporMDAnalysis.core.groups.UpdatingAtomGroup) – An MDAnalysisAtomGrouporUpdatingAtomGroup(if updating isTrue) containing the selectedAtoms.- Raises:
RuntimeWarning : – warn_empty is
Trueand the createdAtomGroupcontains 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.AtomGroupto standard output.