Error: HelloRanges eval
1
0
Entering edit mode
bioinf ▴ 10
@bioinf-12080
Last seen 13 days ago
United States

Hi,

I am trying to compute the coverage histogram of my bedpe file (converted from paired-end bam file) by following the HelloRanges tutorial, but it gives me error while using eval:

>code <- bedtools_coverage("-a 1.bedpe -hist -b org.genome")
​>code

{
    genome <- Seqinfo(genome = NA_character_)
    gr_a <- import("1.bedpe", genome = genome)
    gr_b <- import("org.genome", genome = genome)
    cov <- unname(coverage(gr_b)[gr_a])
    tab <- t(table(cov))
    tab <- cbind(tab, all = rowSums(tab))
    covhist <- DataFrame(as.table(tab))
    colnames(covhist) <- c("coverage", "a", "count")
    len <- c(lengths(cov, use.names = FALSE), sum(lengths(cov)))
    covhist$len <- rep(len, each = nrow(tab))
    covhist <- subset(covhist, count > 0L)
    covhist$fraction <- with(covhist, count/len)
    ans <- gr_a
    covhistList <- split(covhist, ~a)[, -2L]
    mcols(ans)$coverage <- head(covhistList, -1L)
    metadata(ans)$coverage <- covhistList$all
    ans
}
>ans <- eval(code)
Error: logical subscript contains NAs

Kindly guide!

Thanks

 

HelloRanges bedtools • 1.6k views
ADD COMMENT
0
Entering edit mode
Haiying.Kong ▴ 110
@haiyingkong-9254
Last seen 5.7 years ago
Germany

You can just run the code trunk between { }  like your own code.

I would run it line by line and see what happens.

I am guessing a variable in the code trunk is having wrong value or wrong format.

ADD COMMENT
0
Entering edit mode

While running:

gr_a <- import("1.bedpe", genome = genome)
Error: logical subscript contains NAs

Edited bedpe file and ran single commands, now again error:

cov <- unname(coverage(gr_b)[gr_a])
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘coverage’ for signature ‘"Seqinfo"’
ADD REPLY
0
Entering edit mode

Could you please check gr_a and gr_b? See if they are strictly in the same format as example data?

ADD REPLY
0
Entering edit mode

Yes, I checked.

ADD REPLY

Login before adding your answer.

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