lawremi / rtracklayer

R interface to genome annotation files and the UCSC genome browser
Other
29 stars 17 forks source link

Inconsistancy with export.wig depending on type of 'object' #16

Closed FelixErnst closed 5 years ago

FelixErnst commented 5 years ago

Hi,

I just noticed a bit of an inconsistancy when using export.wig

library(rtracklayer)
test_path <- system.file("tests", package = "rtracklayer")
test_wig <- file.path(test_path, "step.wig")
test <- import(test_wig)
f1 <- tempfile()
test.out1 <- export.wig(test,f1)
test.out1
#> WIGFile object
#> resource: C:\Users\flixr\AppData\Local\Temp\RtmpAjm2XV\file31b8225a5b1e
f2 <- tempfile()
testgrl <- GRangesList(test1 = test, test2 = test)
test.out2 <- export.wig(testgrl,f2)
test.out2
#> NULL
test.re <- import(f2,format = "wig")
test.re
#> GenomicRangesList of length 2
#> names(2): test1 test2

test.out1 is of type WIGFile, whereas test.out2 is NULL. The reimport works as will, so I am not sure, why the result in the second case should be NULL.

Is this expected and I am missing a point or is it a bug?

lawremi commented 5 years ago

Thanks for catching that. I've fixed it in trunk.