Sorry that in the original post (below) I forgot to include the session
info. Here it is:

> sessionInfo()
R version 3.0.0 (2013-04-03)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  grid      stats     graphics  grDevices utils     datasets
[8] methods   base

other attached packages:
 [1] GenomicFeatures_1.12.1 org.Hs.eg.db_2.9.0     RSQLite_0.11.3
 [4] DBI_0.2-6              AnnotationDbi_1.22.3   Biobase_2.20.0
 [7] Rsubread_1.10.2        Rsamtools_1.12.2       Biostrings_2.28.0
[10] ggplot2_0.9.3.1        GenomicRanges_1.12.2   IRanges_1.18.0
[13] BiocGenerics_0.6.0     data.table_1.8.8       Gviz_1.4.1

loaded via a namespace (and not attached):
 [1] annotate_1.38.0    biomaRt_2.16.0     biovizBase_1.8.0   bitops_1.0-5

 [5] BSgenome_1.28.0    cluster_1.14.4     colorspace_1.2-2   DESeq_1.12.0

 [9] dichromat_2.0-0    digest_0.6.3       genefilter_1.42.0
 geneplotter_1.38.0
[13] gtable_0.1.2       Hmisc_3.10-1       labeling_0.1
lattice_0.20-15
[17] MASS_7.3-26        munsell_0.4        plyr_1.8           proto_0.3-10

[21] RColorBrewer_1.0-5 RCurl_1.95-4.1     reshape2_1.2.2
rtracklayer_1.20.1
[25] scales_0.2.3       splines_3.0.0      stats4_3.0.0       stringr_0.6.2

[29] survival_2.37-4    tools_3.0.0        XML_3.95-0.2       xtable_1.7-1

[33] zlibbioc_1.6.0

#### original message ####

*Dear Gviz users/developers,

The package is throwing an error when I try to highlight certain regions in
the axis. The error is easily replicable:

> plotTracks(GenomeAxisTrack(range = IRanges(start = 25000, end = 25100)),
from = 1, to = 50000)

No problem with that. You get your genome axis from 1 to 50,000, and a
highlighted small region around the middle.

The error is thrown when the highlighted small region is close to the
borders:

Towards the left border:
> plotTracks(GenomeAxisTrack(range = IRanges(start = 1, end = 100)), from =
1, to = 50000)
Error in validObject(x) :
  invalid class “IRanges” object: 'widths(x)' cannot contain negative values
> plotTracks(GenomeAxisTrack(range = IRanges(start = 101, end = 200)), from
= 1, to = 50000)
Error in validObject(x) :
  invalid class “IRanges” object: 'widths(x)' cannot contain negative values

Towards the right border:
> plotTracks(GenomeAxisTrack(range = IRanges(start = 49901, end = 50000)),
from = 1, to = 50000)
Error in validObject(x) :
  invalid class “IRanges” object: 'widths(x)' cannot contain negative values
> plotTracks(GenomeAxisTrack(range = IRanges(start = 49801, end = 49900)),
from = 1, to = 50000)
Error in validObject(x) :
  invalid class “IRanges” object: 'widths(x)' cannot contain negative values

However, there's a moment when the highlighted region gets away enough from
the border that the error is avoided:

> plotTracks(GenomeAxisTrack(range = IRanges(start = 501, end = 600)), from
= 1, to = 50000)
> plotTracks(GenomeAxisTrack(range = IRanges(start = 49401, end = 49500)),
from = 1, to = 50000)

Those two run like a breeze.

Interestingly, one can also avoid the error by making the highlighted range
wider:

> plotTracks(GenomeAxisTrack(range = IRanges(start = 1, end = 1000)), from
= 1, to = 50000)
> plotTracks(GenomeAxisTrack(range = IRanges(start = 49001, end = 50000)),
from = 1, to = 50000)

Not a problem with those.

Ideas?

Thanks a lot,

Alvaro J. Gonzalez, PhD
Computational Biology
Memorial Sloan-Kettering Cancer Center
New York, NY*

	[[alternative HTML version deleted]]

