Entering edit mode
Alvaro J. González
▴
80
@alvaro-j-gonzalez-5813
Last seen 10.2 years ago
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]]