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

Error in cor(x, y, use = use, method = method) #7

Open
zhangqiannn opened this issue Feb 21, 2023 · 10 comments
Open

Error in cor(x, y, use = use, method = method) #7

zhangqiannn opened this issue Feb 21, 2023 · 10 comments

Comments

@zhangqiannn
Copy link

zhangqiannn commented Feb 21, 2023

hi,
first, i wanna thank you for developing this package. It is wonderful in cancer research.
i try to use function SpaCET_obj1 <- SpaCET.deconvolution(SpaCET_obj1, cancerType="CESC", coreNo=8) in my data
the error is as following:

Error in cor(x, y, use = use, method = method) : 
  long vectors not supported yet: cov.c:722
Calls: SpaCET.deconvolution -> inferMal_cor -> corMat -> <Anonymous> -> cor

i have two sample with different size, the smaller can run normally, the larger not.
i'd like to know why and how to solve this problem?
Best,
Qian

@beibeiru
Copy link
Collaborator

beibeiru commented Feb 21, 2023

Hi, Qian,

Would you please deposit your larger sample (which reports errors) in the following folder? I will figure out the bug. Thanks.

Best,
Beibei

@zhangqiannn
Copy link
Author

zhangqiannn commented Feb 27, 2023 via email

@zhangqiannn
Copy link
Author

zhangqiannn commented Feb 27, 2023 via email

@beibeiru
Copy link
Collaborator

Hi, Qian,

Thank you for uploading your data and I can access them right now.
I am wondering whether your larger sample is ONE visium dataset? Because I observe 58,432 spots in the larger sample.

Best,
Beibei

@zhangqiannn
Copy link
Author

zhangqiannn commented Feb 28, 2023 via email

@beibeiru
Copy link
Collaborator

Sure. Thank you for the clarification. I will let you know once I fix it. Thanks.

Best,
Beibei

@beibeiru
Copy link
Collaborator

beibeiru commented Mar 1, 2023

Hi, Qian,

I notice that the spot size of Stereo-seq is 0.22 um. In your dataset, you got 58,432 bins finally.
Just wondering what the size of a bin is. Do you mind telling me how you transform the Stereo-seq data from spot-level to bin-level? Thanks.

Best,
Beibei

@zhangqiannn
Copy link
Author

zhangqiannn commented Mar 1, 2023 via email

@beibeiru
Copy link
Collaborator

beibeiru commented Mar 6, 2023

Hi, Qian,

I have updated SpaCET to process a larger ST dataset (e.g., >50,000 spots or bins). Please reinstall SpaCET and try the following code. I also deposited the results that I got in the following link.

# reinstall SpaCET
remove.packages("SpaCET")
devtools::install_github("data2intelligence/SpaCET")
library(SpaCET)

# load data
SpaCET_obj <- readRDS("SpaCET_raw.rds")

# modify the input data
SpaCET_obj@input$image$path <- NA
SpaCET_obj@input$image$grob <- NA
SpaCET_obj@input$platform <- "Stereo-seq"

# save fig1 for EPCAM expression
pdf("fig1.pdf",  width = 7.5, height = 7)
SpaCET.visualize.spatialFeature(
  SpaCET_obj, 
  spatialType = "GeneExpression", 
  spatialFeatures=c("EPCAM"),
  pointSize = 0.01, 
  nrow=1
)
dev.off()

SpaCET_obj <- SpaCET.quality.control(SpaCET_obj)

# save fig2 for QC
pdf("fig2.pdf",  width = 15, height = 7)
SpaCET.visualize.spatialFeature(
  SpaCET_obj, 
  spatialType = "QualityControl", 
  spatialFeatures=c("UMI","Gene"),
  pointSize = 0.01, 
  nrow=1
)
dev.off()

# run deconvolution
SpaCET_obj <- SpaCET.deconvolution(SpaCET_obj, cancerType="CESC", coreNo=8)

# save fig3 for cell type fraction
pdf("fig3.pdf",  width = 50, height = 35)
SpaCET.visualize.spatialFeature(
  SpaCET_obj, 
  spatialType = "CellFraction", 
  spatialFeatures=c("All"), 
  pointSize = 0.01, 
  nrow=5
)
dev.off()

# save new data
saveRDS(SpaCET_obj, file = "SpaCET_new.rds")

Please let me know if you have any further questions.

Best,
Beibei

@zhangqiannn
Copy link
Author

zhangqiannn commented Mar 6, 2023 via email

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