Search
Question: ChipQC not loading files
0
gravatar for avp25
5 weeks ago by
avp250
avp250 wrote:

Hello there,

I am just started playing with ChIPQC and DiffBind but I am failing miserably at just loading the sample data.  I have downloaded the DiffBind Package data from your website (https://www.dropbox.com/s/gfc49wul2bv5nz6/DiffBind_vignette_data.tar.gz)

My script looks like:

# load libraries
library(ChIPQC)
library(DiffBind)
# read in files
samples = read.csv(file="chipqc_trial/DiffBind_Vignette/tamoxifen.csv")
exampleExp = ChIPQC(samples)
exampleDB = dba(sampleSheet="chipqc_trial/DiffBind_Vignette/tamoxifen.csv")

When I run:

> exampleExp = ChIPQC(samples)

I get:

BT4741 BT474 ER Resistant Full-Media 1 bed
Error in if (file.info(peaks)$size > 0) { : 
  missing value where TRUE/FALSE needed

> traceback()
4: pv.peakset(model, peaks = as.character(samples$Peaks[i]), sampID = as.character(samples$SampleID[i]), 
       tissue = as.character(samples$Tissue[i]), factor = as.character(samples$Factor[i]), 
       condition = as.character(samples$Condition[i]), treatment = as.character(samples$Treatment[i]), 
       consensus = F, peak.caller = peakcaller, peak.format = peakformat, 
       scoreCol = peakscores, bLowerScoreBetter = peaksLowerBetter, 
       control = controlid, reads = NA, replicate = as.integer(samples$Replicate[i]), 
       readBam = as.character(samples$bamReads[i]), controlBam = as.character(samples$bamControl[i]), 
       filter = peakfilter, counts = counts, bRemoveM = bRemoveM, 
       bRemoveRandom = bRemoveRandom, skipLines = skipLines)
3: 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, 
       dir)
2: dba(sampleSheet = experiment, bCorPlot = FALSE, peakCaller = "bed")
1: ChIPQC(samples)

___

I have tried a number of different things, I tried using my own files (which are macs2 peaks and bowtie2 bam files).

Any ideas of what can be going on? Is this a version incompatibility?

Many thanks!

Anna

> sessionInfo()
R version 3.5.0 (2018-04-23)
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_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
 [1] ChIPQC_1.16.0               DiffBind_2.8.0              SummarizedExperiment_1.10.1 DelayedArray_0.6.5         
 [5] BiocParallel_1.14.2         matrixStats_0.54.0          Biobase_2.40.0              GenomicRanges_1.32.6       
 [9] GenomeInfoDb_1.16.0         IRanges_2.14.10             S4Vectors_0.18.3            BiocGenerics_0.26.0        
[13] ggplot2_3.0.0               BiocInstaller_1.30.0       

loaded via a namespace (and not attached):
  [1] amap_0.8-16                               colorspace_1.3-2                         
  [3] rjson_0.2.20                              hwriter_1.3.2                            
  [5] XVector_0.20.0                            base64enc_0.1-3                          
  [7] rstudioapi_0.7                            ggrepel_0.8.0                            
  [9] bit64_0.9-7                               AnnotationDbi_1.42.1                     
 [11] splines_3.5.0                             TxDb.Rnorvegicus.UCSC.rn4.ensGene_3.2.2  
 [13] Nozzle.R1_1.1-1                           Rsamtools_1.32.2                         
 [15] annotate_1.58.0                           GO.db_3.6.0                              
 [17] pheatmap_1.0.10                           graph_1.58.0                             
 [19] TxDb.Hsapiens.UCSC.hg18.knownGene_3.2.2   compiler_3.5.0                           
 [21] httr_1.3.1                                GOstats_2.46.0                           
 [23] backports_1.1.2                           assertthat_0.2.0                         
 [25] Matrix_1.2-14                             lazyeval_0.2.1                           
 [27] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2   limma_3.36.2                             
 [29] prettyunits_1.0.2                         tools_3.5.0                              
 [31] bindrcpp_0.2.2                            gtable_0.2.0                             
 [33] glue_1.3.0                                GenomeInfoDbData_1.1.0                   
 [35] Category_2.46.0                           reshape2_1.4.3                           
 [37] systemPipeR_1.14.0                        dplyr_0.7.6                              
 [39] ShortRead_1.38.0                          Rcpp_0.12.18                             
 [41] TxDb.Dmelanogaster.UCSC.dm3.ensGene_3.2.2 TxDb.Mmusculus.UCSC.mm9.knownGene_3.2.2  
 [43] Biostrings_2.48.0                         gdata_2.18.0                             
 [45] rtracklayer_1.40.4                        TxDb.Mmusculus.UCSC.mm10.knownGene_3.4.0 
 [47] stringr_1.3.1                             gtools_3.8.1                             
 [49] XML_3.98-1.15                             edgeR_3.22.3                             
 [51] zlibbioc_1.26.0                           scales_1.0.0                             
 [53] hms_0.4.2                                 RBGL_1.56.0                              
 [55] RColorBrewer_1.1-2                        BBmisc_1.11                              
 [57] yaml_2.2.0                                memoise_1.1.0                            
 [59] biomaRt_2.36.1                            latticeExtra_0.6-28                      
 [61] stringi_1.2.4                             RSQLite_2.1.1                            
 [63] genefilter_1.62.0                         checkmate_1.8.5                          
 [65] GenomicFeatures_1.32.2                    caTools_1.17.1.1                         
 [67] chipseq_1.30.0                            rlang_0.2.1                              
 [69] pkgconfig_2.0.2                           BatchJobs_1.7                            
 [71] bitops_1.0-6                              TxDb.Celegans.UCSC.ce6.ensGene_3.2.2     
 [73] lattice_0.20-35                           purrr_0.2.5                              
 [75] bindr_0.1.1                               GenomicAlignments_1.16.0                 
 [77] bit_1.1-14                                tidyselect_0.2.4                         
 [79] GSEABase_1.42.0                           AnnotationForge_1.22.2                   
 [81] plyr_1.8.4                                magrittr_1.5                             
 [83] sendmailR_1.2-1                           R6_2.2.2                                 
 [85] gplots_3.0.1                              DBI_1.0.0                                
 [87] pillar_1.3.0                              withr_2.1.2                              
 [89] survival_2.42-6                           RCurl_1.95-4.11                          
 [91] tibble_1.4.2                              crayon_1.3.4                             
 [93] KernSmooth_2.23-15                        progress_1.2.0                           
 [95] locfit_1.5-9.1                            grid_3.5.0                               
 [97] data.table_1.11.4                         blob_1.1.1                               
 [99] Rgraphviz_2.24.0                          digest_0.6.15                            
[101] xtable_1.8-2                              brew_1.0-6                               
[103] munsell_0.5.0                            
ADD COMMENTlink modified 5 weeks ago by Thomas Carroll400 • written 5 weeks ago by avp250
0
gravatar for Thomas Carroll
5 weeks ago by
United States/New York/The Rockefeller University
Thomas Carroll400 wrote:

hi Anna,

Your example code is working for me in the versions you are running (version ChIPQC_1.16.0 and Diffbind Version DiffBind_2.8.0).

------------

> setwd("~/../../Volumes/Untitled/DiffBind_Vignette/")
> library(ChIPQC)
> samples = read.csv(file="tamoxifen.csv")
> exampleExp = ChIPQC(samples)
BT4741 BT474 ER Resistant Full-Media 1 bed
BT4742 BT474 ER Resistant Full-Media 2 bed
MCF71 MCF7 ER Responsive Full-Media 1 bed
MCF72 MCF7 ER Responsive Full-Media 2 bed
MCF73 MCF7 ER Responsive Full-Media 3 bed
T47D1 T47D ER Responsive Full-Media 1 bed
T47D2 T47D ER Responsive Full-Media 2 bed
MCF7r1 MCF7 ER Resistant Full-Media 1 bed
MCF7r2 MCF7 ER Resistant Full-Media 2 bed
ZR751 ZR75 ER Responsive Full-Media 1 bed
ZR752 ZR75 ER Responsive Full-Media 2 bed
Checking chromosomes:
[1] "chr18"
Computing metrics for 16 samples...
list
Bam file has 25 contigs
Calculating coverage histogram for chr18...

........

> QCmetrics(exampleExp)
         Reads Map% Filt%  Dup% ReadL FragL RelCC  SSD  RiP%
BT4741  776353  100  15.9  8.42    28   153 2.110 1.88 15.20
BT4742  782419  100  15.2 10.30    28   147 2.010 1.63 14.00
MCF71   438994  .................

----------------

Does the DBA example you show work for you?

exampleDB = dba(sampleSheet="chipqc_trial/DiffBind_Vignette/tamoxifen.csv")

 

 

It looks from your code like you may be in wrong working directory?

best,

tom

 

 

> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.5

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  
[9] base     

other attached packages:
 [1] ChIPQC_1.16.0               DiffBind_2.8.0             
 [3] SummarizedExperiment_1.10.1 DelayedArray_0.6.1         
 [5] BiocParallel_1.14.1         matrixStats_0.53.1         
 [7] Biobase_2.40.0              GenomicRanges_1.32.3       
 [9] GenomeInfoDb_1.16.0         IRanges_2.14.10            
[11] S4Vectors_0.18.3            BiocGenerics_0.26.0        
[13] ggplot2_2.2.1              

ADD COMMENTlink written 5 weeks ago by Thomas Carroll400

I guess this is solved for problem in example and can be closed

ADD REPLYlink written 4 weeks ago by Thomas Carroll400

Hi Tom, 

Thank you for getting back to me. The error persists.  

The files are in the correct directory (note that read.csv() ) does not fail). 

In addtion, the DBA example also fails:

> exampleDB = dba(sampleSheet="DiffBind_Vignette/tamoxifen.csv")
BT4741 BT474 ER Resistant Full-Media 1 bed
Error in if file.info(peaks)$size > 0) { : 
  missing value where TRUE/FALSE needed

I have also picked up another error message when running the project from scratch from the same directory. I am not sure if this is related? 

Error: package or namespace load failed for ‘ChIPQC’:
 .onLoad failed in loadNamespace() for 'TxDb.Hsapiens.UCSC.hg19.knownGene', details:
  call: initialize(value, ...)
  error: attempt to apply non-function
Error in .requirePackage(package) : 
  unable to find required package ‘ChIPQC’
In addition: Warning messages:
1: package ‘GenomicRanges’ was built under R version 3.5.1 
2: package ‘DelayedArray’ was built under R version 3.5.1 
Loading required package: ChIPQC
Error: package or namespace load failed for ‘ChIPQC’:
 .onLoad failed in loadNamespace() for 'TxDb.Hsapiens.UCSC.hg19.knownGene', details:
  call: .Object$initialize(...)
  error: attempt to apply non-function
Error in .requirePackage(package) : 
  unable to find required package ‘ChIPQC’
In addition: Warning message:
call dbDisconnect() when finished working with a connection 
 

 

ADD REPLYlink written 4 weeks ago by avp250
1

 

hi Anna,

As the Dffbind command is not working this suggest the wrong working directory.

The CSV you are reading lists files as relative paths from the location inside the Diffbind vignette directory. So reading the CSV will work but it will not be able to find any files unless you are in same directory as CSV.

The bamReads column lists files in a directory called "reads/" for instance.

> samples = read.csv(file="tamoxifen.csv")
> samples$bamReads

> samples$bamReads
 [1] reads/Chr18_BT474_ER_1.bam reads/Chr18_BT474_ER_2.bam reads/Chr18_MCF7_ER_1.bam  reads/Chr18_MCF7_ER_2.bam  reads/Chr18_MCF7_ER_3.bam 
 [6] reads/Chr18_T47D_ER_1.bam  reads/Chr18_T47D_ER_2.bam  reads/Chr18_TAMR_ER_1.bam  reads/Chr18_TAMR_ER_2.bam  reads/Chr18_ZR75_ER_1.bam 
[11] reads/Chr18_ZR75_ER_2.bam 
11 Levels: reads/Chr18_BT474_ER_1.bam reads/Chr18_BT474_ER_2.bam reads/Chr18_MCF7_ER_1.bam reads/Chr18_MCF7_ER_2.bam ... reads/Chr18_ZR75_ER_2.bam

The other message looks unrelated to this problem,

vb,

tom

 

 

ADD REPLYlink written 28 days ago by Thomas Carroll400

hi Anna,

Did you try moving to DiffBind_Vignette directory?

tom

ADD REPLYlink written 28 days ago by Thomas Carroll400

Thanks Tom. It is working now. 

 

ADD REPLYlink written 26 days ago by avp250

hi Anna,

Do you mind accepting my answer at the top?

thank you,

tom

ADD REPLYlink written 4 days ago by Thomas Carroll400
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: 306 users visited in the last hour