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

BiocParallel Errors #107

Open
TeodoraTockovska opened this issue Jan 4, 2022 · 2 comments
Open

BiocParallel Errors #107

TeodoraTockovska opened this issue Jan 4, 2022 · 2 comments

Comments

@TeodoraTockovska
Copy link

TeodoraTockovska commented Jan 4, 2022

Hi! I am trying to run scone() on a very small expression dataset (~2000 genes and 15 cells) to test out my user-defined functions and see the results. I ran into the following error, which I don't know how to resolve:

Error: BiocParallel errors
  element index: 4, 5, 6, 7, 8, 9, ...
  first error: NA/Inf/NaN Expression Values.

The expression data were pre-preprocessed and I removed genes that were not expressed in the cells. My scaling list includes user-defined functions for a few normalization methods (Seurat's simple norm, sctransform's vst(), SCnorm, and scran). The user-defined functions (besides scran) all return the normalized matrices, not scaled. My user-defined functions return normalized matrices when I call them on their own.

This is how I am calling the scone() function:

BiocParallel::register(BiocParallel::SerialParam())
my_scone <- scone(my_scone,
                  scaling=scaling,
                  run=TRUE,
                  eval_kclust = 2:6, 
                  k_ruv = 0,
                  k_qc = 2,
                  return_norm = "in_memory",
                  zero = "postadjust",
                  adjust_bio="no",
                  adjust_batch="no",
                  bpparam = BiocParallel::SerialParam(),
                  verbose = TRUE)

How could I resolve this error? Thank you!

@TeodoraTockovska
Copy link
Author

I discovered the error -- it was due to using sctransform's vst() function. It resulted in NA values. I am closing the issue.

@TeodoraTockovska
Copy link
Author

I've reopened the issue. I am trying to understand the BiocParallel errors. Scone is able to run for all of my user-defined functions except for sctransform's vst() normalization function.

My user-defined function is below:

SCT_VST_FN <- function(expression_data){
  return(sctransform::vst(expression_data)$y)
}

Below are the messages while running scone():

Negative controls will not be used in evaluation (correlations with negative controls will be returned as NA)
Imputation step...
Scaling step...
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 706 by 15
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 706 genes, 15 cells
  |===========================================================================================================================================| 100%
Found 84 outliers - those will be ignored in fitting/regularization step

Second step: Get residuals using fitted parameters for 706 genes
  |===========================================================================================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 0.8297551 secs
Computing RUV factors...
Computing factors for evaluation...
Factor adjustment and evaluation...
...including re-zero step...
Processed: none,none,no_uv,no_bio,no_batch
Error: BiocParallel errors
  element index: 2, 3, 4, 5, 6
  first error: NA/Inf/NaN Expression Values.

It seems that scone() breaks after line 570.

Fortunately, the normalization using SCT_VST_FN() returns the normalized matrix, however I don't understand how to fix this issue.

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

1 participant