neurorestore / Augur

Cell type prioritization in single-cell data
MIT License
94 stars 10 forks source link

A stubborn error #6

Open JustMoveOnnn opened 3 years ago

JustMoveOnnn commented 3 years ago

Hello, Thank you for providing such an excellent single-cell tool. I encountered the following error while using it, but I ran through this process yesterday and I don’t know why?

_> augur = calculate_auc(pbmc, pbmc@meta.data, cell_type_col = "seurat_clusters", label_col = "type",nthreads = 8)
| | 0%, ETA NA Error: Problem with filter() input ..1. x object 'metric' not found ℹ Input ..1 is metric == "roc_auc". Run rlang::last_error() to see where the error occurred. In addition: Warning messages: 1: In calculate_auc(pbmc, pbmc@meta.data, cell_type_col = "seurat_clusters", : coercing labels to factor ... 2: In mclapply(X, function(...) { : all scheduled cores encountered errors in user code Called from: signal_abort(cnd) Browse[1]>

Thank you very much! Yang Jing

skinnider commented 3 years ago

Hi @RunningCrystal - unfortunately due to the multithreading Augur doesn't produce very informative error messages, all I can discern from this is each of your 8 threads is failing. Is there any way you can send me the pbmc data you're using so I can try to figure out what's going wrong?

JustMoveOnnn commented 3 years ago

Hi @RunningCrystal - unfortunately due to the multithreading Augur doesn't produce very informative error messages, all I can discern from this is each of your 8 threads is failing. Is there any way you can send me the pbmc data you're using so I can try to figure out what's going wrong?

image

Thank you very much for your reply, I have the same error when using the demo data (sc_sim) , and I switched the 0.0.04 version and 0.07 version of yardstick, but it didn’t work.

skinnider commented 3 years ago

Hmm, can you send me your sessionInfo() in the R environment where this is breaking?

skinnider commented 3 years ago

Could you also try running with n_threads = 1 to get a more informative error message?

JustMoveOnnn commented 3 years ago

sessionInfo()

image

JustMoveOnnn commented 3 years ago

Could you also try running with n_threads =

image image

jordansquair commented 3 years ago

I'm not able to reproduce your error.

Can you please confirm: 1) operating system, and 2) R version.

Also, can you make sure you are using the most up to date version: devtools::install_github("neurorestore/Augur")

In a fresh R session please run:

library(Augur) data("sc_sim") augur = calculate_auc(sc_sim, n_threads = 1)

skinnider commented 3 years ago

Hi @RunningCrystal, I apologize for the delay getting back to you - I’ve been away for the last two weeks without my computer.

I took another shot at reproducing your bug in a fresh install of R 4.0.2. I did:

install.packages("devtools") 
devtools::install_github("const-ae/sparseMatrixStats")
devtools::install_github("neurorestore/Augur")
install.packages("Seurat")
library(Augur)
data("sc_sim")
augur = calculate_auc(sc_sim)

(I fixed a bug requiring glmnet to be installed when using the random forest classifier).

This gave:

> augur$AUC
# A tibble: 3 x 2
  cell_type   auc
  <chr>     <dbl>
1 CellTypeC 0.868
2 CellTypeB 0.740
3 CellTypeA 0.566

So I can’t really tell why you are getting this error. Have you tried a clean R install? What version of R are you using?

ygidtu commented 3 years ago

I met the same error tody. The functions from MatrixGenerics could not be apply to data.frame object, according to the error message. Therefore I solved this by convert data.frame to matrix.

DelongZHOU commented 7 months ago

Hi,

I have a similar issue with 'metric' not found

image image

I tried the function on simulated data and it worked. However with my real data I got this error. I also tried to convert the count matrix to a matrix but I got the same error.

My sessioninfo is attached.

Please let me know if there's anything else I can provide for debugging.

Thanks! session.log

mumdark commented 7 months ago

I encountered the same issue. However, when I set the cell_type and label columns in sce@meta to factors, the problem was immediately resolved. @DelongZHOU

DelongZHOU commented 6 months ago

I encountered the same issue. However, when I set the cell_type and label columns in sce$meta to factors, the problem was immediately resolved. @DelongZHOU

Indeed that works! Thanks!

hanrong498 commented 6 months ago

Hi!

I found this error persists when I try to change the parameter subsample_size. Can you suggest what can be changed if my number of cells per condition is small (<20), asI am running to the error seen in #24 ?

Thanks!

BolinZheng80 commented 5 months ago

Same error on both simulated data and my real data. and the cell_type and label columns in sce@meta are factors. Seurat 5 object. R version 4.3.2 (2023-10-31) -- "Eye Holes" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

Thanks!

Abiud commented 5 months ago

I had the same error with a Seurat 5 object, my cell_type and label metadata columns were factors. However, it worked after I reorder the levels on my label column to follow alphabetical order.

R version 4.3.2 (2023-10-31) -- "Eye Holes" Platform: x86_64-pc-linux-gnu (64-bit)

neurorestore commented 4 months ago

Hi all, we have provided a fix for this. The label factors should not affect the results either way.