snapatac2.AnnDataSet.subset#

AnnDataSet.subset(obs_indices=None, var_indices=None, out=None, backend=None)#

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 the obs_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.

  • backend (str | None) –

Returns:

A new AnnDataSet object will be returned. If the order of input obs_indices has been changed, it will return the indices that would sort the obs_indices array.

Return type:

Tuple[AnnDataSet, list[int] | None]