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

uniPort also does the annotations in the spatial data? #2

Open
ankitbioinfo opened this issue Mar 1, 2023 · 2 comments
Open

uniPort also does the annotations in the spatial data? #2

ankitbioinfo opened this issue Mar 1, 2023 · 2 comments

Comments

@ankitbioinfo
Copy link

ankitbioinfo commented Mar 1, 2023

Thanks for making a such a beautiful program. I read the paper and it impute the genes in spatial data using scRNA-sequencing data. I was reading following tutorial
https://uniport.readthedocs.io/en/latest/examples/MERFISH/MERFISH_and_scRNA.html

And it create a latent representation of combined spatial and sequencing data. I am more interested in following function
uniport.metrics.label_transfer(ref, query, rep='latent', label='celltype')
to transfer the annotation of single-cell sequencing into spatial data. So I am bit confused how to use label_transfer function for my data.
I have the following
(1) spatial data (adata_merfish): AnnData object with n_obs × n_vars = 7416 × 241
(2) sequencing data (adata_rna with HVG): AnnData object with n_obs × n_vars = 2239 × 2000
(3) adata_cm = adata_merfish.concatenate(adata_rna, join='inner', batch_key='domain_id')
(4) adata = up.Run(adatas=[adata_merfish, adata_rna], adata_cm=adata_cm)
AnnData object with n_obs × n_vars = 9655 × 188

Could you guide me that what should go in ref and query variable in the label_transfer because adata_merfish and adata_rna have different number of genes?
Thank you.

@caokai1073
Copy link
Owner

caokai1073 commented Mar 1, 2023

Hi, thanks for your interest in our work!

It seems that there are 188 common genes between spatial data and sequencing data in your data. The output adata of 'up.Run' contains both spatial data and sequencing data with common 188 genes. Therefore, you can use the following if you want to transfer labels from RNA to spatial:

RNA_ref = adata[adata.obs['source']=='RNA']
MERFISH_query = adata[adata.obs['source']=='MERFISH']
MERFISH_predict_label = uniport.metrics.label_transfer(ref=RNA_ref, query=MERFISH_query, label='cell_type')

Please tell me if that doesn't work. Thanks!

@ankitbioinfo
Copy link
Author

Hi Thanks for the help. It seems working.

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

2 participants