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

Using scATAC-seq dataset to deconvolute 10x Visium dataset #374

Open
Jadeapple opened this issue Jun 27, 2024 · 2 comments
Open

Using scATAC-seq dataset to deconvolute 10x Visium dataset #374

Jadeapple opened this issue Jun 27, 2024 · 2 comments
Labels
question Further information is requested

Comments

@Jadeapple
Copy link

Hello, I want to use scATAC-seq dataset to deconvolute 10x Visium dataset, is it feasible?

When I prepare anndata for the regression model, some warings appeared as follows:
cell2location.models.RegressionModel.setup_anndata(adata=adata_sc,
... batch_key='orig.ident', # 10X reaction / sample / batch
... labels_key='celltype' # cell type, covariate used for constructing signatures
... )
:119: FutureWarning: SparseDataset is deprecated and will be removed in late 2024. It has been replaced by the public classes CSRDataset and CSCDataset.

For instance checks, use isinstance(X, (anndata.experimental.CSRDataset, anndata.experimental.CSCDataset)) instead.

For creation, use anndata.experimental.sparse_dataset(X) instead.

An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.

What should I do?

@Jadeapple Jadeapple added the question Further information is requested label Jun 27, 2024
@royassis
Copy link

royassis commented Sep 4, 2024

Hey

I found an example in the anndata.experimental.sparse_dataset docstring.

Here is my example code:

import anndata
import h5py
from anndata.experimental import sparse_dataset, read_elem

with h5py.File("somefile.h5ad", "r") as f:
    X = sparse_dataset(f["X"])
    adata = anndata.AnnData(
       layers={"backed": X}, obs=read_elem(f["obs"]), var=read_elem(f["var"])
    )
    print(adata.layers["backed"])

@royassis
Copy link

royassis commented Sep 4, 2024

Writing this anndata object to a new file does not keep the X dataset in the new format.

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

No branches or pull requests

2 participants