This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Ggbio Autoplot Error, Negative Length Vectors Are Not Allowed

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

0 answers

No answers yet.

Log in to answer this question.