Question: Ggbio Autoplot Error, Negative Length Vectors Are Not Allowed
1
gravatar for paulr
6.3 years ago by
paulr80
paulr80 wrote:

Dear all, So I'm trying to use autoplot from the Bioconductor ggbio package. For some reason, the following data and code causes an odd error.

library(ggbio)
data(hg19IdeogramCyto, package = "biovizBase")
require(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
sample.data <- data.frame(chromosome='chr7', begin= 6018314, end= 6018316)
actual.var <- GRanges(seqnames=sample.data$chromosome, IRanges(start=sample.data$begin, end=sample.data$end))
p.2 <- autoplot(txdb, which = actual.var, color='blue', names.expr = "gene_id:::tx_name")

And here's the output and subsequent error

Aggregating TranscriptDb...
Parsing exons...
Parsing cds...
Parsing transcripts...
Aggregating... 
Done
Constructing graphics...
Error in approx(c(x.s, x.e), rep(0, 2), n = N) : 
  negative length vectors are not allowed

Does GRanges require at least two coordinates? I just want to indicate where a small variant occurs.

Thanks in advance!

R bioconductor • 1.7k views
ADD COMMENTlink modified 8 months ago by Biostar ♦♦ 20 • written 6.3 years ago by paulr80
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.3.0
Traffic: 1605 users visited in the last hour