Ggbio Autoplot Error, Negative Length Vectors Are Not Allowed
0
1
Entering edit mode
11.3 years ago
paulr ▴ 80

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!

bioconductor r • 2.7k views
ADD COMMENT

Login before adding your answer.

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