CoverageView package_Error in 1:nrow(grDF) : argument of length 0
1
0
Entering edit mode
6.9 years ago
bioinfo8 ▴ 230

Hi,

I am trying to use cov.matrix() from CoverageView package and getting following error:

>mybed <- read.table("mybed.bed", sep='\t', header = FALSE)
>mybed
      V1     V2     V3     V4     V5    V6
1   chr1    468    558 AMPL1 strand gene1
2   chr1   1558   1609  AMPL2 strand gene2
3   chr1   3768   3817  AMPL3 strand gene3
4   chr3     10     59  AMPL4 strand gene3
5   chr3   1067   1128  AMPL5 strand gene4

>trm <- CoverageBamFile("mybam.bam", reads_mapped=11906)
>trm
class: CoverageBamFile 
path: mybam.bam
index: mybam.bam.bai
isOpen: FALSE 
yieldSize: NA 
obeyQname: FALSE 
asMates: FALSE 
qnamePrefixEnd: NA 
qnameSuffixStart: NA 
reads_mapped: 11906 
run_type: single 

>df <- cov.matrix(trm, coordfile = mybed, ctl = NULL, extend = 10, num_cores=1)    
[INFO] A coverage matrix will be generated by calculating the 'log2ratio' of the coverages.
[INFO] processing:mybam.bam
Error in 1:nrow(grDF) : argument of length 0

>traceback()
4: lapply(X, FUN, ...)
3: mclapply(1:nrow(grDF), loopfun, mc.cores = num_cores, obj = tr)
2: cov.matrix(trm, coordfile = mybed, ctl = NULL, extend = 10, num_cores = 1)
1: cov.matrix(trm, coordfile = mybed, ctl = NULL, extend = 10, num_cores = 1)

Kindly guide.

Thanks!

CoverageView R bioconductor mclapply • 2.5k views
ADD COMMENT
0
Entering edit mode
5.6 years ago
KatjaS ▴ 10

I had the same issue, but for me it worked when I specified the path to the bed file instead of the object to which I have saved it in before. Try:

>df <- cov.matrix(trm, coordfile = "mybed.bed", ctl = NULL, extend = 10, num_cores=1)

instead of

>df <- cov.matrix(trm, coordfile = mybed, ctl = NULL, extend = 10, num_cores=1)
ADD COMMENT

Login before adding your answer.

Traffic: 2548 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