swiftcnv.add_mat_to_adata#
- add_mat_to_adata(adata, matrix, cell_order, gene_order, cnv_key='cnv_mat', reference_key='reference', inplace=False)#
Add the SwiftCNV output matrix to an anndata.AnnData object along with matrix indices (cell_order and gene_order). cell_order and gene_order must be pandas.DataFrames, and their indices will be ignored.
- Parameters:
adata (anndata.AnnData) – Object to add the matrix to.
matrix (numpy.ndarray) – CNV matrix, output of
run().cell_order (pandas.DataFrame) – DataFrame with cell index information.
gene_order (pandas.DataFrame) – DataFrame with gene column information.
cnv_key (str, default 'cnv_mat') – Key for storing the CNV matrix in adata.obsm.
reference_key (str, default 'reference') – Key for storing reference status in adata.obs.
inplace (bool, default False) – Whether to modify
adatain-place or return a copy.
- Returns:
An updated copy of
adataifinplace=False, otherwiseNone.- Return type:
anndata.AnnData or None