[Bioc-sig-seq] GRanges tabulate the coverage

Dario Strbenac D.Strbenac at garvan.org.au
Fri Aug 6 05:00:16 CEST 2010


I'm encountering a problem where I can tabulate coverage results when I've got a GRanges object without seqlengths in it, but when I put seqlengths in it, it gives an error about negative length vectors. Here is my small example.


chrs = paste("chr", c(1:22, "X", "Y"), sep = "")
myGR <- GRanges(seqnames = c("chr1", "chr3", "chr3", "chr3"), ranges = IRanges(100, width = 200), strand = '+')
coverage <- colSums(table(coverage(resize(myGR, 300))))

seqlengths(myGR) <- seqlengths(Hsapiens)[chrs]
coverage <- colSums(table(coverage(resize(myGR, 300))))

Dario Strbenac
Research Assistant
Cancer Epigenetics
Garvan Institute of Medical Research
Darlinghurst NSW 2010

More information about the Bioc-sig-sequencing mailing list