derfinder fails on findRegions step
1
0
Entering edit mode
pschaugh • 0
@pschaugh-8090
Last seen 9.6 years ago
United States

Hello,

I have successfully run derfinder following the tutorial on some human data, but now I am getting an error when trying to go through the same process with some mouse data. Any help would be appreciated.

Thanks,

Paul Schaughency

Here is the relevant log:

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.0 (BiocInstaller 1.16.4), ?biocLite for help
A new version of Bioconductor is available after installing the most recent version of R; see http://bioconductor.org/install
>
> library('derfinder')
> library('GenomicRanges')
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap, parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB

The following object is masked from ‘package:stats’:

    xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, do.call, duplicated, eval, evalq, Filter, Find, get, intersect, is.unsorted, lapply, Map, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, rownames, sapply, setdiff, sort, table, tapply, union, unique,
    unlist, unsplit

Loading required package: S4Vectors
Loading required package: stats4
Loading required package: IRanges
Loading required package: GenomeInfoDb
> filenames <- c('GFP_plus_k_sorted.bam' ,'GFP_minus_k_sorted.bam')
> pheno <- data.frame(sample=filenames, group=c('GFP_plus', 'GFP_minus'))
>
> options(species = 'mus_musculus')
> fullCov <- fullCoverage(filenames, chrs=c('chr1'))
2015-06-05 13:54:16 fullCoverage: processing chromosome chr1
2015-06-05 13:54:16 loadCoverage: finding chromosome lengths
2015-06-05 13:54:16 loadCoverage: loading BAM file GFP_plus_k_sorted.bam
2015-06-05 13:54:38 loadCoverage: loading BAM file GFP_minus_k_sorted.bam
2015-06-05 13:54:55 loadCoverage: applying the cutoff to the merged data
2015-06-05 13:54:55 filterData: originally there were 195471971 rows, now there are 195471971 rows. Meaning that 0 percent was filtered.
> filteredCov <- lapply(fullCov, filterData, cutoff = 2)
2015-06-05 13:55:08 filterData: originally there were 195471971 rows, now there are 43712465 rows. Meaning that 77.64 percent was filtered.
> sampleDepths <- sampleDepth(collapseFullCoverage(fullCov), 1)
2015-06-05 13:55:10 sampleDepth: Calculating sample quantiles
2015-06-05 13:55:10 sampleDepth: Calculating sample adjustments
> models <- makeModels(sampleDepths, testvars = pheno$group)
Warning messages:
1: In makeModels(sampleDepths, testvars = pheno$group) :
  Dropping from the alternative model matrix (mod) the column(s) sampleDepths as the matrix is not full rank.
2: In makeModels(sampleDepths, testvars = pheno$group) :
  Dropping from the null model matrix (mod0) the column(s) sampleDepths as they were dropped in the alternative model matrix (mod).
> dir.create('analysisResultsgfp')
Warning message:
In dir.create("analysisResultsgfp") : 'analysisResultsgfp' already exists
> originalWd <- getwd()
> setwd(file.path(originalWd, 'analysisResultsgfp'))
> system.time(resultschr1 <- analyzeChr( chr= 'chr1', filteredCov$chr1, models, groupInfo = pheno$group, runAnnotation = FALSE, writeOutput = TRUE, cutoffFstat = 5e-02, nPermute = 20, seeds = 20140923 + seq_len(20), returnOutput = TRUE))
2015-06-05 13:55:25 analyzeChr: Pre-processing the coverage data
2015-06-05 13:56:23 analyzeChr: Calculating statistics
2015-06-05 13:56:23 calculateStats: calculating the F-statistics
2015-06-05 13:56:33 analyzeChr: Calculating pvalues
2015-06-05 13:56:33 analyzeChr: Using the following theoretical cutoff for the F-statistics NaN
2015-06-05 13:56:33 calculatePvalues: identifying data segments
2015-06-05 13:56:33 findRegions: segmenting F-stats information
Error in .local(x, lower, upper, ...) : 'lower' must be a single number
In addition: Warning message:
In qf(cutoffFstat, df1 - df0, n - df1, lower.tail = FALSE) : NaNs produced
Timing stopped at: 64.51 4.25 68.065
> ## Session information
> options(width = 90)
> devtools::session_info()
Session info -----------------------------------------------------------------------------
 setting  value                       
 version  R version 3.1.3 (2015-03-09)
 system   x86_64, darwin14.1.0        
 ui       RStudio (0.98.1091)         
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            

Packages ---------------------------------------------------------------------------------
 package           * version  date       source        
 acepack             1.3-3.3  2014-11-24 CRAN (R 3.1.3)
 AnnotationDbi       1.28.2   2015-03-20 Bioconductor  
 base64enc           0.1-2    2014-06-26 CRAN (R 3.1.3)
 BatchJobs           1.6      2015-03-18 CRAN (R 3.1.3)
 BBmisc              1.9      2015-02-03 CRAN (R 3.1.3)
 Biobase             2.26.0   2015-03-18 Bioconductor  
 BiocGenerics      * 0.12.1   2015-03-18 Bioconductor  
 BiocInstaller     * 1.16.4   2015-05-14 Bioconductor  
 BiocParallel        1.0.3    2015-03-18 Bioconductor  
 biomaRt             2.22.0   2015-03-18 Bioconductor  
 Biostrings          2.34.1   2015-03-18 Bioconductor  
 bitops              1.0-6    2013-08-17 CRAN (R 3.1.3)
 brew                1.0-6    2011-04-13 CRAN (R 3.1.3)
 bumphunter          1.6.0    2015-03-18 Bioconductor  
 checkmate           1.5.3    2015-05-13 CRAN (R 3.1.3)
 cluster             2.0.1    2015-01-31 CRAN (R 3.1.3)
 codetools           0.2-11   2015-03-10 CRAN (R 3.1.3)
 colorspace          1.2-6    2015-03-11 CRAN (R 3.1.3)
 DBI                 0.3.1    2014-09-24 CRAN (R 3.1.3)
 derfinder         * 1.0.10   2015-05-15 Bioconductor  
 derfinderHelper     1.0.4    2015-03-18 Bioconductor  
 devtools            1.8.0    2015-05-09 CRAN (R 3.1.3)
 digest              0.6.8    2014-12-31 CRAN (R 3.1.3)
 doRNG               1.6      2014-03-07 CRAN (R 3.1.3)
 fail                1.2      2013-09-19 CRAN (R 3.1.3)
 foreach             1.4.2    2014-04-11 CRAN (R 3.1.3)
 foreign             0.8-63   2015-02-20 CRAN (R 3.1.3)
 Formula             1.2-1    2015-04-07 CRAN (R 3.1.3)
 GenomeInfoDb      * 1.2.5    2015-05-14 Bioconductor  
 GenomicAlignments   1.2.2    2015-03-18 Bioconductor  
 GenomicFeatures     1.18.7   2015-05-14 Bioconductor  
 GenomicFiles        1.2.1    2015-03-18 Bioconductor  
 GenomicRanges     * 1.18.4   2015-03-18 Bioconductor  
 ggplot2             1.0.1    2015-03-17 CRAN (R 3.1.3)
 git2r               0.10.1   2015-05-07 CRAN (R 3.1.3)
 gridExtra           0.9.1    2012-08-09 CRAN (R 3.1.3)
 gtable              0.1.2    2012-12-05 CRAN (R 3.1.3)
 Hmisc               3.16-0   2015-04-30 CRAN (R 3.1.3)
 IRanges           * 2.0.1    2015-03-18 Bioconductor  
 iterators           1.0.7    2014-04-11 CRAN (R 3.1.3)
 lattice             0.20-31  2015-03-30 CRAN (R 3.1.3)
 latticeExtra        0.6-26   2013-08-15 CRAN (R 3.1.3)
 locfit              1.5-9.1  2013-04-20 CRAN (R 3.1.3)
 magrittr            1.5      2014-11-22 CRAN (R 3.1.3)
 MASS                7.3-40   2015-03-21 CRAN (R 3.1.3)
 Matrix              1.2-0    2015-04-04 CRAN (R 3.1.3)
 matrixStats         0.14.0   2015-02-14 CRAN (R 3.1.3)
 memoise             0.2.1    2014-04-22 CRAN (R 3.1.3)
 munsell             0.4.2    2013-07-11 CRAN (R 3.1.3)
 nnet                7.3-9    2015-02-11 CRAN (R 3.1.3)
 pkgmaker            0.22     2014-05-14 CRAN (R 3.1.3)
 plyr                1.8.2    2015-04-21 CRAN (R 3.1.3)
 proto               0.3-10   2012-12-22 CRAN (R 3.1.3)
 qvalue              1.43.0   2015-03-18 Bioconductor  
 RColorBrewer        1.1-2    2014-12-07 CRAN (R 3.1.3)
 Rcpp                0.11.6   2015-05-01 CRAN (R 3.1.3)
 RCurl               1.95-4.6 2015-04-24 CRAN (R 3.1.3)
 registry            0.2      2012-01-24 CRAN (R 3.1.3)
 reshape2            1.4.1    2014-12-06 CRAN (R 3.1.3)
 rngtools            1.2.4    2014-03-06 CRAN (R 3.1.3)
 rpart               4.1-9    2015-02-24 CRAN (R 3.1.3)
 Rsamtools           1.18.3   2015-03-18 Bioconductor  
 RSQLite             1.0.0    2014-10-25 CRAN (R 3.1.3)
 rtracklayer         1.26.3   2015-05-14 Bioconductor  
 rversions           1.0.0    2015-04-22 CRAN (R 3.1.3)
 S4Vectors         * 0.4.0    2015-03-18 Bioconductor  
 scales              0.2.4    2014-04-22 CRAN (R 3.1.3)
 sendmailR           1.2-1    2014-09-21 CRAN (R 3.1.3)
 stringi             0.4-1    2014-12-14 CRAN (R 3.1.3)
 stringr             1.0.0    2015-04-30 CRAN (R 3.1.3)
 survival            2.38-1   2015-02-24 CRAN (R 3.1.3)
 XML                 3.98-1.1 2013-06-20 CRAN (R 3.1.3)
 xtable              1.7-4    2014-09-12 CRAN (R 3.1.3)
 XVector             0.6.0    2015-03-18 Bioconductor  
 zlibbioc            1.12.0   2015-03-18 Bioconductor 
derfinder • 1.6k views
ADD COMMENT
0
Entering edit mode
@lcolladotor
Last seen 9 days ago
United States

Hi Paul,

Looking at the output you provided, there is a problem with the models you are using. There are two warning messages noting that the variable sampleDepths is dropped from the null and alternative models. I recommend inspecting the output from makeModels() to see how they look like. The warnings are not necessarily a problem because you can run the analysis without adjusting for the sample depths (you might have to create the 'models' list object yourself instead of using the makeModels() function). However, in your situation there is a problem because the models produce a NaN (not a number) value for the F-statistic cutoff. This is likely the result of a 0 by 0 division. You can see the NaN output in the message logs and also by running:

derfinder:::.calcFstatCutoff(cutoffType = 'theoretical', cutoffFstat = 5e-02, models = models)

Best,

Leonardo

ADD COMMENT

Login before adding your answer.

Traffic: 514 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6