我正在使用来自Bioconductor的 Gviz库,我正在尝试绘制从左到右技术上绘制的表意文字,但我们的数据有一些负宽度,表明情节应来自右到左。 如何使用IRanges输入宽度的负值?
以下是我们正在处理的代码:
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))
谢谢:)))))
答案 0 :(得分:1)
就像错误信息所说,IRanges不能有负宽度 - 'start'始终是最左边的。也许使用带strand="-"
的GRanges对象?