negative value with IRanges

I'm using the Gviz library from Bioconductor, I'm trying to plot ideograms which are technically graphed from left to right, but our data have some negative width indicating that the plot should be from right to left. How can I input negative values for the width with IRanges?

Here is the piece of code we're working with:

library(Gviz)
library(IRanges)
gen <- "mm9"
chr <- "chr1"

itrack <- IdeogramTrack(genome = gen, chromosome = chr)
gtrack <- GenomeAxisTrack()

dat <- read.delim("C:/R/mydata.TXT", header = FALSE, sep ="\t")
s <- dat[[2]]
e <- dat[[3]]
l <- dat[[4]]

annot1 = IRanges(start = s, width = l)
Error.Call2("solve_user_SEW0", start, end, width, PACKAGE = "IRanges") : 
solving row 1: negative widths are not allowed

# Those logical following commands work well if no negative integer is passed to IRanges
atrack <- AnnotationTrack (annot1, chromosome = chr, genome = gen, name = "foo") 
plotTracks (list(itrack, gtrack, atrack))

Thanks :))))

Answers


Like the error message says, IRanges can't have negative width -- the 'start' is always left-most. Perhaps using a GRanges object with strand="-"?


Need Your Help

Why can't I include PHP in XML file?

php html xml apache

I have the following XML site map structure:

Saving constant values securely

android properties reverse-engineering proguard

I am working on a Android application related to secure data communication. I am using a few constant values in my application, and am saving them in constant.java class. I don't want these values ...