ErnakovichLab / dada2_ernakovichlab

Other
12 stars 4 forks source link

LearnErrors function - Error rates could not be estimated - Novaseq data #17

Closed katfiishn closed 6 months ago

katfiishn commented 6 months ago

Hi,

I've been testing the 4 options to learn error rates with my Novaseq data. However everytime I try to run one of the options I get the following error:

errF_4 <- learnErrors(+ filtFs, + multithread = TRUE, + nbases = 1e8, + errorEstimationFunction = loessErrfun_mod4, + verbose = TRUE + )

239949068 total bases in 1140848 reads from 3 samples will be used for learning the error rates. Initializing error rates to maximum possible estimate. Error rates could not be estimated (this is usually because of very few reads). Error in getErrors(err, enforce = TRUE) : Error matrix is NULL.

Any idea why this could be the case? I'm assuming its not because of low reads...

Thanks!

hhollandmoritz commented 6 months ago

Hi @katfiishn,

I'm not sure exactly without more information, but this looks a lot like a similar error that others have had: https://github.com/benjjneb/dada2/issues/1307#issuecomment-1725876512

I haven't had a lot of time to troubleshoot it in depth but I suspect it's because the dplyr package is not loaded inside the custom error functions. A simple change, currently low priority on the to-do list for me. The work around is making sure that you've loaded the dplyr package at the top of your script along with the dada2 package.

If you try that and it doesn't work, the next step would be to share the exact code you're using and some of your data as an example (if you can share it).

katfiishn commented 6 months ago

Hi @hhollandmoritz

Loading the dplyr package fixed the problem!

Thanks very much for finding that.

Cheers!