infercnvpy.io.read_scevan

Contents

infercnvpy.io.read_scevan#

infercnvpy.io.read_scevan(adata, scevan_res_dir, scevan_res_table=None, *, subclones=True, inplace=True, subset=True, key_added='scevan')#

Load results from SCEVAN [FCS+21] for downstream analysis with infercnvpy.

Requires that the cell barcodes used for SCEVAN and adata.obs_names match, but the order is irrelevant.

Parameters:
  • adata (AnnData) – adata object to which the SCEVAN results shall be added

  • scevan_res_table (Union[str, Path, None] (default: None)) – The results of SCEVAN::pipelineCNA saved as CSV file. Will add the columns {key_added}_class, {key_added}_confident_normal and, if SCEVAN was ran with subclone calling, {key_added}_subclone to adata.obs. This parameter can be omitted if you only want to load the CNV matrix.

  • scevan_res_dir (Union[str, Path]) – The output directory created by SCEVAN. Must only contain results for a single sample. Will read the files *_CNAmtx.RData, *_CNAmtxSubclones.RData (if available), and *_count_mtx_annot.RData.

  • subclones (bool (default: True)) – Load the separate subclone segmentation, if available.

  • subset (bool (default: True)) – If True (the default), subset anndata to the cells that have not been filtered out by the SCEVAN analysis. Otherwise the CNV matrix may contain nan-values and downstream analysis such as PCA will not work.

  • key_added (str (default: 'scevan')) – Used as prefix for the columns added to adata.obs and will add the CNV matrix as X_{key_added} to adata.obsm, and chromosome indices to adata.uns[key_added].

  • inplace (bool (default: True)) – If True, modify anndata inplace. Otherwise, return a copy.

Return type:

Optional[AnnData]

Returns:

Depending on the value of inplace returns a modified AnnData object or returns None and modifies adata inplace.