Question: Ggbio Autoplot Error, Negative Length Vectors Are Not Allowed
0
gravatar for paulr
5.6 years ago by
paulr70
paulr70 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.5k views
ADD COMMENTlink written 5.6 years ago by paulr70
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: 1283 users visited in the last hour