ivanek / Gviz

This is the Gviz development repository. Gviz plots data and annotation information along genomic coordinates.
https://bioconductor.org/packages/Gviz/
Artistic License 2.0
75 stars 10 forks source link

method for function 'tolower': Unable to identify extension for file '' #68

Closed yonniejon closed 2 years ago

yonniejon commented 2 years ago

I run the following code:

bgFile <- system.file("/path/to/a_file.bedGraph", package = "Gviz")
dTrack2 <- DataTrack(range = bgFile, genome = "hg19", type = "l", 
                 chromosome = "chr19", name = "bedGraph")

and I get the following error: Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'tolower': Unable to identify extension for file ''

The traceback: `14: h(simpleError(msg, call)) 13: .handleSimpleError(function (cond) .Internal(C_tryCatchHelper(addr, 1L, cond)), "Unable to identify extension for file ''", base::quote(.fileExtension(range))) 12: stop("Unable to identify extension for file '", file, "'") 11: .fileExtension(range) 10: tolower(.fileExtension(range)) 9: .defaultVarMap(tolower(.fileExtension(range)), trackType, stream, !autodetect) 8: .local(range, ...) 7: .buildRange(range = range, start = start, end = end, width = width, args = args, defaults = defs, asIRanges = FALSE, chromosome = chromosome, genome = NA, trackType = "DataTrack", importFun = importFunction, stream = stream) 6: .buildRange(range = range, start = start, end = end, width = width, args = args, defaults = defs, asIRanges = FALSE, chromosome = chromosome, genome = NA, trackType = "DataTrack", importFun = importFunction, stream = stream) 5: DataTrack(range = bgFile, genome = "hg19", type = "l", chromosome = "chr19", name = "bedGraph") at .active-rstudio-document#7 ``

Do you know what the problem could be?

yonniejon commented 2 years ago

I was following this guide https://www.bioconductor.org/packages/devel/bioc/vignettes/Gviz/inst/doc/Gviz.html#43_DataTrack but i guess it is outdated. Providing the filename directly as input worked well