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

Probelm in deconvolution #30

Closed
biostat0903 opened this issue Feb 14, 2023 · 8 comments
Closed

Probelm in deconvolution #30

biostat0903 opened this issue Feb 14, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@biostat0903
Copy link

Dear author,
Our group hopes to use the Spatalk package. When we analyze the 10x Visium data, the function dec_celltype can not work.
Our code:

obj <- dec_celltype(obj,
                               sc_data = as.matrix(sc_count),
                               sc_celltype = celltype,
                               if_doParallel = T,
                               use_n_cores = N_CORES,
                              dec_result = decon_prop)

Error:

Error in { :
  task 14 failed - "error in evaluating the argument 'x' in selecting a method for function 'rowSums':
invalid character indexing"

Could you tell me the reason for the error? Thank you!

Best,
Sheng

@multitalk
Copy link
Collaborator

You can check length(intersect(rownames(st_data), rownames(sc_data))). See #26

@biostat0903
Copy link
Author

Thanks for your fast reply.

intersect(rownames(st_data),rownames(sc_data)) %>% length
[1] 9510
 dim(st_data)
[1] 9817 7481
dim(sc_data)
[1] 26733 19311

Now, I try to use the intersection between sc_data and st_data to subset the two dataset.

Best,
Sheng

@biostat0903
Copy link
Author

When I use the intersection to fit the model.
I also meet the error:

Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'x' in selecting a method for function 'rowSums': invalid character indexing

@multitalk
Copy link
Collaborator

multitalk commented Feb 14, 2023

Can you show the colnames(obj@data$rawdata)[1:10], unique(celltype) and decon_prop[1:10, ]?
all(rownames(decon_prop) == colnames(obj@data$rawdata))? Is it TRUE?

@biostat0903
Copy link
Author

Thanks for your fast reply.
I sent all my data to your email. When you have time, please help me to check that.
Best,
Sheng

@multitalk
Copy link
Collaborator

The reason is that the inconsistent names of decon_prop. I have fixed the bug. Thanks for your feedback.

@multitalk multitalk added the bug Something isn't working label Feb 15, 2023
multitalk added a commit that referenced this issue Feb 19, 2023
fix the bug #30
@multitalk
Copy link
Collaborator

@biostat0903 The reason of error invalid character indexing when doing Parallel in dec_celltype() is the generation of NA data.frame in generated newmeta, which will not occur when if_doParallel = FALSE. I have finished dec_celltype(if_doParallel = FALSE) for your data without error. I have fixed this bug and you can have a try with if_doParallel = TRUE. Thanks a lot!

@multitalk
Copy link
Collaborator

dec_celltype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants