mdciao.fragments.fragment_slice¶
-
mdciao.fragments.
fragment_slice
(traj: mdtraj.Trajectory, fragments, keys_or_idxs=None)¶ Slice a geometry using arbitrary fragment definitions, a la
mdtraj.Trajectory.atom_slice
Note
Regardless of the order in which the selection is done (e.g. keys_or_idxs=[1,0]) the returned
sliced_traj
will always be in ascending order atoms as they appear intraj
- Parameters
traj (
mdtraj.Trajectory
) – The trajectory to slicefragments (list or dict) – The fragment definitions as residue indices. Can be as a list or a as a dict, e.g. the output of
mdciao.fragments.get_fragments
(list) ormdciao.nomenclature.LabelerGPCR.top2frags
(dict)keys_or_idxs (iterable or None) – The keys or indices of the fragments to slice to, i.e. to keep. If None, all all fragments are used as a selection
- Returns
sliced_traj – A copy of
traj
only with the atoms present in the selected fragments- Return type