Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCA vs scVI #61

Open
HuynhNPT opened this issue Jan 30, 2023 · 0 comments
Open

DCA vs scVI #61

HuynhNPT opened this issue Jan 30, 2023 · 0 comments

Comments

@HuynhNPT
Copy link

Thank you for the package! I'd like to get your opinion on the use of scVI together with DCA. Is it recommended? From my understanding, DCA uses latent representation to denoise/impute data to combat drop-out effect. However, this package does not correct for batch effect, while scVI does. Will something like the below code make sense?

# Set up adata, then run DCA
dca(adata, threads = 8, mode="denoise")

# Get variable genes before scVI 
sc.pp.highly_variable_genes(
    adata, 
    flavor="seurat_v3", 
    n_top_genes = 2000, 
    layer="counts", 
    batch_key = "orig.ident", 
    subset=True)
# Set up model
scvi.model.SCVI.setup_anndata(adata, layer="counts", batch_key="experimental_batch")
# Train
denoised_vae = scvi.model.SCVI(adata, n_layers = 5, n_latent = 50, gene_likelihood="nb")
denoised_vae.train()
# Dim red and clustering 
adata.obsm['X_scVI'] = denoised_vae.get_latent_representation()
sc.pp.neighbors(adata, use_rep='X_scVI', n_neighbors = 200)
sc.tl.leiden(adata)
sc.tl.umap(adata, min_dist=1.5, spread = 1.2)
sc.pl.umap(adata, color = ['leiden',], ncols = 1, frameon=False)

Please let me know your thoughts. I'd appreciate your inputs on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant