[BioC] rtracklayer export.wig variableStep problem

Vincent Schulz Vincent.Schulz at yale.edu
Fri Mar 23 16:59:43 CET 2012


Hi,

I can no longer generate variableStep wig files in R2.14 (or 2.13 or 2.12) but it works in 2.11. 
Example below:

library(IRanges)
library(rtracklayer)
dummy <- file() # dummy file connection for demo
track2 <- RangedData(IRanges(start = c(1, 72, 74, 76, 77, 94,108,151,152),
end = c(71,  73,  75,  76,  93, 107, 150, 151, 152)),
score = c(3,4,5,8,9,10,11,14,15),
space = c("chr1", "chr1", "chr1", "chr1", "chr1", "chr1","chr1","chr1","chr1"))
wig <- export.wig(track2, dummy, dataFormat = "variableStep")

Error in FUN(X[i], ...) :
   The span must be uniform for Wiggle export. Consider bedGraph or bigWig as alternatives.

Note that is does work if the regions are all of the same size, but then what is the point of 
variableStep?  Could this possibly be fixed in R2.15 (if it isn't already)?

Another question, apologies that it is unrelated, probably obvious, and not bioconductor specific: 
How do I see code for S4 functions?  What I tried below is unhelpfully recursive:

getMethod(export.ucsc)
Method Definition:

function (object, con, subformat = c("auto", "gff1", "wig", "bed",
     "bed15", "bedGraph"), append = FALSE, ...)
{
     cl <- class(object)
     track <- try(as(object, "RangedData"), silent = TRUE)
     if (class(track) == "try-error") {
         track <- try(as(object, "RangedDataList"), silent = TRUE)
         if (class(track) == "try-error")
             stop("cannot export object of class '", cl, "'")
     }
     export.ucsc(track, con = con, subformat = subformat, append = append,
         ...)
}
<environment: namespace:rtracklayer>

Signatures:
         object con
target  "ANY"  "ANY"
defined "ANY"  "ANY"

Thanks,

Vince

sessionInfo()
R version 2.14.2 (2012-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C                 LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] IRanges_1.12.5     rtracklayer_1.14.4 RCurl_1.91-1       bitops_1.0-4.1

loaded via a namespace (and not attached):
[1] Biostrings_2.22.0   BSgenome_1.22.0     GenomicRanges_1.6.7
[4] tools_2.14.2        XML_3.9-4           zlibbioc_1.0.0



More information about the Bioconductor mailing list