rapids_singlecell.pp.sqrt#
- rapids_singlecell.pp.sqrt(data, *, layer=None, obsm=None, inplace=True, copy=False)[source]#
Take the square root of the data matrix.
Computes \(X = \sqrt{X}\).
- Parameters:
- data
Union[AnnData,ndarray,csc_matrix,csr_matrix,Array] The (annotated) data matrix of shape
n_obs×n_vars. Rows correspond to cells and columns to genes. If a matrix is passed instead of anAnnDataobject, the transformed matrix is returned.- layer
str|None(default:None) Layer to transform instead of
X. IfNone,Xis transformed.- obsm
str|None(default:None) Entry of
.obsmto transform.- inplace
bool(default:True) Whether to update
dataor return the matrix. Only applies toAnnDatainput.- copy
bool(default:False) Whether to return a copy or update
data. Not compatible withinplace=False. Only applies toAnnDatainput.
- data
- Return type:
- Returns:
The resulting matrix after applying the square root to the input matrix. If a matrix is passed, the transformed matrix is returned. If an AnnData object is passed and
copyisTrue, returns the modified AnnData. Otherwise, updates thedataobject in-place and returns None.