snapatac2.AnnDataSet.subset#
- AnnDataSet.subset(obs_indices, var_indices, out)#
Subsetting the AnnDataSet object.
Note
AnnDataSet will not move data across underlying AnnData objects. So the orders of rows in the resultant AnnDataSet object may not be consistent with the input
obs_indices
. This function will return a vector that can be used to reorder theobs_indices
to match the final order of rows in the AnnDataSet.- Parameters
obs_indices – obs indices
var_indices – var indices
out – Name of the directory used to store the new files. If provided, the result will be saved to the directory and the original files remains unchanged.
- Returns
If
out
is notNone
, a new AnnDataSet object will be returned. Otherwise, the operation will be performed inplace. If the order of inputobs_indices
has been changed, it will return the indices that would sort theobs_indices
array.- Return type
None | list[int] | Tuple[AnnDataSet, list[int]]