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

SpaCET: Deconvolution with a matched scRNA-seq data set error (works without matched reference) #14

Open
dbuszta opened this issue May 4, 2023 · 15 comments

Comments

@dbuszta
Copy link

dbuszta commented May 4, 2023

Hi there, when trying to run SpaCET with these data (https://www.10xgenomics.com/products/xenium-in-situ/preview-dataset-human-breast), I am getting an error at the SpaCET.deconvolution.matched.scRNAseq step of the code. This is the error: [1] "1. Generate the reference from the matched scRNAseq data."
Coefficients not estimable: TT WT

Error in chol2inv(fit$qr$qr, size = fit$qr$rank) :
'size' argument must be a positive integer
In addition: Warning message:
In parallel::mclapply(setdiff(cellTypes_level_1, cellType), run_limma, :
all scheduled cores encountered errors in user code)

Do you know what could be causing it? My data works well without the matched reference.
I triple-checked all my file inputs from the scRNAseq side and they match the structure of the tutorial exactly.
Here is my hierarchical tree:
sc_lineageTree <- list("Lymphoid cells" = c("CD4+ T Cells", "CD8+ T Cells", "B Cells"),
"Myeloid cells" = c("Mast Cells", "Macrophages 1", "Macrophages 2", "IRF7+ DCs", "LAMP3+ DCs"),
"Tumour" = c("Prolif Invasive Tumor", "Invasive Tumor", "T Cell & Tumor Hybrid", "DCIS 1", "DCIS 2"),
"Stromal" = c("Stromal", "Stromal & T Cell Hybrid"),
"Endothelial" = "Endothelial",
"Perivascular-Like" = "Perivascular-Like",
"Myoepi" = c("Myoepi ACTA2+", "Myoepi KRT15+"))

Let me know if you need the files I am using and how to best pass them on to you.

@beibeiru
Copy link
Collaborator

beibeiru commented May 4, 2023

Hi, Daria,

Can you upload your input of SpaCET.deconvolution.matched.scRNAseq to the following folder? I will figure out the reason soon.

Best,
Beibei

@dbuszta
Copy link
Author

dbuszta commented May 4, 2023 via email

@beibeiru
Copy link
Collaborator

beibeiru commented May 4, 2023

Hi, Daria,

I have fixed the bug and run your code successfully.
Please reinstall our package and try again. Just let me know if you have any further questions.
BTW, one suggestion is that when building sc_lineageTree, make sure major and sub lineages have different names, e.g., Stromal.

Best,
Beibei

@dbuszta
Copy link
Author

dbuszta commented May 4, 2023 via email

@beibeiru
Copy link
Collaborator

beibeiru commented May 5, 2023

Another suggestion is that you might delete the hybrid cells (e.g., "Stromal & T Cell Hybrid" and "T Cell & Tumor Hybrid") in your single-cell reference because you are doing deconvolution and it is better to use pure cell references.

Best,
Beibei

@dbuszta
Copy link
Author

dbuszta commented May 31, 2023 via email

@beibeiru
Copy link
Collaborator

beibeiru commented Jun 1, 2023

Hi, Daria,

I have fixed it. Please reinstall our package and try again. Thanks.

Best,
Beibei

@dbuszta
Copy link
Author

dbuszta commented Jun 2, 2023 via email

@dbuszta
Copy link
Author

dbuszta commented Jun 5, 2023 via email

@beibeiru
Copy link
Collaborator

beibeiru commented Jun 5, 2023

Hi, Daria,

I will let you know once I figure out the difference between the two visualization methods.

Best,
Beibei

@beibeiru
Copy link
Collaborator

beibeiru commented Jun 8, 2023

Hi, Daria,

I design a new parameter scaleTypeForGeneExpression for SpaCET.visualize.spatialFeature, which can help users select different scale modes to visualize gene expression. Please reinstall SpaCET and try it. Just let me know if you have any further questions.

p1 <- SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "GeneExpression", spatialFeatures=c("EPCAM"),scaleTypeForGeneExpression="RawCounts")
p2 <- SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "GeneExpression", spatialFeatures=c("EPCAM"),scaleTypeForGeneExpression="LogRawCounts")
p3 <- SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "GeneExpression", spatialFeatures=c("EPCAM"),scaleTypeForGeneExpression="LogTPM/10")
p4 <- SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "GeneExpression", spatialFeatures=c("EPCAM"),scaleTypeForGeneExpression="LogTPM")

p1+p2+p3+p4+patchwork::plot_layout(nrow = 2)

Best,
Beibei

@dbuszta
Copy link
Author

dbuszta commented Sep 24, 2023 via email

@beibeiru
Copy link
Collaborator

Hi, Daria,

I am a little confused about your issue "deleting one gene from the spacet object".
Would you please show the codes of what you have run? Thanks.

Best,
Beibei

@dbuszta
Copy link
Author

dbuszta commented Sep 25, 2023 via email

@beibeiru
Copy link
Collaborator

Hi, Daria,

No worries. I am happy to help you figure out the issue.
Can you upload your folder "CytAssist_FFPE_Human_Breast_Cancer_spatial" to the following folder? I will fix it soon.
https://connecthkuhk-my.sharepoint.com/:f:/g/personal/bbru_connect_hku_hk/EgOfT89AoZ9CrpKsVG6ObTsB-djuTjxT-v40zwbkWh8mSg?e=3ccKdd

Also, please upload your related codes.

  1. how to delete genes
  2. how to save ST data after deleting genes
  3. how to re-read the ST data

Thanks.

Best,
Beibei

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