mnnpy icon indicating copy to clipboard operation
mnnpy copied to clipboard

mnnpy.mnn_correct returning a Tuple

Open Gpasquini opened this issue 6 years ago • 1 comments

Here is a reproducible code for the error:

import scanpy as sc
import scanpy.external as ice
from itertools import cycle

pbmc = sc.datasets.pbmc68k_reduced()
pbmc_corrected = mnnpy.mnn_correct(pbmc, batch_key="phase", save_raw=True)

pbmc_corrected

(AnnData object with n_obs × n_vars = 700 × 765 
     obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score', 'G2M_score', 'phase', 'louvain'
     var: 'n_counts', 'means', 'dispersions', 'dispersions_norm', 'highly_variable'
     uns: 'bulk_labels_colors', 'louvain', 'louvain_colors', 'neighbors', 'pca', 'rank_genes_groups'
     obsm: 'X_pca', 'X_umap'
     varm: 'PCs',)

type(pbmc_corrected) tuple

Gpasquini avatar Aug 21 '19 12:08 Gpasquini

It expects multiple anndata objects and batch_key is just for concatenating the corrected AnnDatas:

https://github.com/chriscainx/mnnpy/blob/750bba42ef7e26ac1eafe75e772440b12160814c/mnnpy/mnn.py#L106-L107

flying-sheep avatar Oct 24 '19 15:10 flying-sheep