Hi,
I am using Scran and the tutorial as below to analyze singe-cell ATAC-seq data from 10x. https://www.bioconductor.org/packages/devel/workflows/vignettes/simpleSingleCell/inst/doc/work-3-tenx.html#7_modelling_the_mean-variance_trend
When using the example data, I could run it without any issue.
But when using my own data, at the step of fitting I got the following error:
>new.trend <- makeTechTrend(x=sce)
Error in seq.default(from = 0, to = upper.value, length.out = 100) : 
  'to' must be a finite number
Could anyone kindly help me on this? Thank you very much! My sessionInfo() is:
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
 [1] scran_1.9.16                EnsDb.Mmusculus.v79_2.99.0  ensembldb_2.5.4            
 [4] AnnotationFilter_1.5.2      GenomicFeatures_1.33.2      AnnotationDbi_1.43.1       
 [7] scater_1.9.14               ggplot2_3.0.0               DropletUtils_1.1.8         
[10] SingleCellExperiment_1.3.10 SummarizedExperiment_1.11.6 DelayedArray_0.7.28        
[13] matrixStats_0.54.0          Biobase_2.41.2              GenomicRanges_1.33.13      
[16] GenomeInfoDb_1.17.1         IRanges_2.15.16             S4Vectors_0.19.19          
[19] BiocGenerics_0.27.1         BiocParallel_1.15.8        

Thank you very much! It seems that it is because of the negative size factor as a similar question here: Warning: negative size factors
I have not fixed this problem yet, but it seems that I need to find a way to deal with such zeros in my data.
I would suggest filtering more aggressively during size factor calculation, and then applying the size factors to the unfiltered data. Of course, this assumes that high-count regions in ATAC-seq exhibit the same biases as low-count regions, and I know for a fact that's not true for certain types of ChIP-seq data, so YMMV.