Search
Question: ChIPQC error: "if (nrow(pv$binding) > 0) { : argument is of length zero"
2
gravatar for Danielle Denisko
16 months ago by
University of Toronto, Canada
Danielle Denisko30 wrote:

We would like to run ChIPQC on two samples with narrowPeak files. However, we obtain the error in if (nrow(pv$binding) > 0) { : argument is of length zero, as recorded below. The "runChIPQC.R" script was previously described here: C: ChIPQC without peak calls. Do you know what causes this error, and how it can be resolved?

 

QCexperiment.csv:

SampleID        Tissue  Factor  bamReads        ControlID       bamControl      Peaks   PeakCaller
GATA3_WT    tissue    GATA3    GATA3.wt.bam    GATA3_KO    GATA3.ko.bam    GATA3_peaks.narrowPeak    narrow
SRF_WT    tissue    SRF    SRF.wt.bam    SRF_KO    SRF.ko.bam    SRF_peaks.narrowPeak    narrow


In R:

> options(error = recover)
> source("runChIPQC.R", echo=TRUE, max.deparse.length=10000)

> #!/usr/bin/xvfb-run -s "-screen 0 1600x1200x24+32" Rscript

> options(stringsAsFactors=FALSE, bitmapType='cairo')

> library("ChIPQC")
Loading required package: ggplot2
Loading required package: DiffBind
Loading required package: 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 objects are masked from ‘package:stats’:

    IQR, mad, xtabs

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

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

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: ‘S4Vectors’

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

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

> samples <- read.csv("QCexperiment.csv", sep="\t", stringsAsFactors=FALSE)

> experiment <- ChIPQC(samples, annotation="mm9")
GATA3_WT tissue GATA3   NA narrow
SRF_WT tissue SRF   NA narrow
Error in if (nrow(pv$binding) > 0) { : argument is of length zero

Enter a frame number, or 0 to exit    

1: source("runChIPQC.R", echo = TRUE, max.deparse.length = 10000)
2: withVisible(eval(ei, envir))
3: eval(ei, envir)
4: eval(expr, envir, enclos)
5: runChIPQC.R#12: ChIPQC(samples, annotation = "mm9")
6: dba(sampleSheet = experiment, bCorPlot = FALSE, peakCaller = "bed")
7: pv.model(DBA, mask = mask, minOverlap = minOverlap, samplesheet = sampleShe
8: pv.vectors(model, mask = mask, minOverlap = minOverlap, attributes = attrib

Selection: 8
Called from: top level
Browse[1]> pv$binding
         CHR        START          END     GATA3_WT       SRF_WT
9.000000e+00 3.405637e+07 3.405662e+07 1.043910e-01 5.304492e-02
Browse[1]> nrow(pv$binding)
NULL

 

> traceback()
8: pv.vectors(model, mask = mask, minOverlap = minOverlap, attributes = attributes,
       bAllSame <- (peakcaller == "counts"))
7: pv.model(DBA, mask = mask, minOverlap = minOverlap, samplesheet = sampleSheet,
       config = config, caller = peakCaller, format = peakFormat,
       scorecol = scoreCol, bLowerBetter = bLowerScoreBetter, skipLines = skipLines,
       bAddCallerConsensus = bAddCallerConsensus, bRemoveM = bRemoveM,
       bRemoveRandom = bRemoveRandom, filter = filter, attributes = attributes)
6: dba(sampleSheet = experiment, bCorPlot = FALSE, peakCaller = "bed")
5: ChIPQC(samples, annotation = "mm9") at runChIPQC.R#12
4: eval(expr, envir, enclos)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("runChIPQC.R", echo = TRUE, max.deparse.length = 10000)



> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.5 (Final)

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C             
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8   
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8  
[7] LC_PAPER=en_US.UTF-8       LC_NAME=C                
[9] LC_ADDRESS=C               LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C        

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets
[8] methods   base      

other attached packages:
[1] ChIPQC_1.8.2               DiffBind_2.0.2           
[3] SummarizedExperiment_1.2.3 Biobase_2.32.0           
[5] GenomicRanges_1.24.2       GenomeInfoDb_1.8.1       
[7] IRanges_2.6.1              S4Vectors_0.10.1         
[9] BiocGenerics_0.18.0        ggplot2_2.1.0              

loaded via a namespace (and not attached):
[1] edgeR_3.14.0                            
[2] splines_3.3.0                           
[3] TxDb.Hsapiens.UCSC.hg18.knownGene_3.2.2 
[4] TxDb.Mmusculus.UCSC.mm10.knownGene_3.2.2
[5] gtools_3.5.0                            
[6] assertthat_0.1                          
[7] latticeExtra_0.6-28                     
[8] amap_0.8-14                             
[9] RBGL_1.48.1                             
[10] Rsamtools_1.24.0                        
[11] Category_2.38.0                         
[12] RSQLite_1.0.0                           
[13] backports_1.0.3                         
[14] lattice_0.20-33                         
[15] limma_3.28.14                           
[16] digest_0.6.9                            
[17] RColorBrewer_1.1-2                      
[18] XVector_0.12.0                          
[19] checkmate_1.8.1                         
[20] colorspace_1.2-6                        
[21] Matrix_1.2-6                            
[22] plyr_1.8.4                              
[23] GSEABase_1.34.0                         
[24] chipseq_1.22.0                          
[25] XML_3.98-1.4                            
[26] pheatmap_1.0.8                          
[27] ShortRead_1.30.0                        
[28] biomaRt_2.28.0                          
[29] genefilter_1.54.2                       
[30] zlibbioc_1.18.0                         
[31] xtable_1.8-2                            
[32] GO.db_3.3.0                             
[33] scales_0.4.0                            
[34] brew_1.0-6                              
[35] gdata_2.17.0                            
[36] TxDb.Rnorvegicus.UCSC.rn4.ensGene_3.2.2 
[37] BiocParallel_1.6.2                      
[38] tibble_1.1                              
[39] annotate_1.50.0                         
[40] GenomicFeatures_1.24.3                  
[41] survival_2.39-5                         
[42] magrittr_1.5                            
[43] systemPipeR_1.6.2                       
[44] fail_1.3                                
[45] gplots_3.0.1                            
[46] hwriter_1.3.2                           
[47] GOstats_2.38.1                          
[48] graph_1.50.0                            
[49] tools_3.3.0                             
[50] BBmisc_1.9                              
[51] stringr_1.0.0                           
[52] sendmailR_1.2-1                         
[53] munsell_0.4.3                           
[54] locfit_1.5-9.1                          
[55] AnnotationDbi_1.34.3                    
[56] Biostrings_2.40.2                       
[57] caTools_1.17.1                          
[58] grid_3.3.0                              
[59] RCurl_1.95-4.8                          
[60] TxDb.Celegans.UCSC.ce6.ensGene_3.2.2    
[61] rjson_0.2.15                            
[62] AnnotationForge_1.14.2                  
[63] bitops_1.0-6                            
[64] base64enc_0.1-3                         
[65] gtable_0.2.0                            
[66] DBI_0.4-1                               
[67] reshape2_1.4.1                          
[68] R6_2.1.2                                
[69] GenomicAlignments_1.8.3                 
[70] Nozzle.R1_1.1-1                         
[71] dplyr_0.5.0                             
[72] rtracklayer_1.32.1                      
[73] KernSmooth_2.23-15                      
[74] stringi_1.1.1                           
[75] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 
[76] BatchJobs_1.6                           
[77] Rcpp_0.12.5                             
[78] TxDb.Dmelanogaster.UCSC.dm3.ensGene_3.2.2
[79] TxDb.Mmusculus.UCSC.mm9.knownGene_3.2.2  

 

ADD COMMENTlink modified 16 months ago • written 16 months ago by Danielle Denisko30
1

We are still unable to fix this. We are successfully able to process each sample individually by disabling faceting (as previously mentioned in C: ChIPQC for a single sample (disabling facets)). We are also able to process samples with multiple replicates using the workaround below:

if (!is.null(samples$Replicate) && length(samples$Replicate) > 1) {
        makeActiveBinding("resultObj", function() experiment, .GlobalEnv)
} else {
        resultObj <- QCsample(experiment)[[1]]
}

However, we are unable to extend this to the case where we have multiple samples without replicates. Is there a way to apply a similar workaround to our case?
 

ADD REPLYlink written 15 months ago by Danielle Denisko30
2
hi Danielle,
Sorry for the delay.
Yes, i will add a proper fix for the workaround in the post you mention. C: ChIPQC for a single sample (disabling facets).

I'll will get back to you when check in and then see if this solves the issue.

thanks,

tom

ADD REPLYlink written 15 months ago by Thomas Carroll390

Ok, great. Thank you, Tom!

Danielle

ADD REPLYlink written 15 months ago by Danielle Denisko30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 145 users visited in the last hour