coregenomics / kmap

Generate mappable regions of the genome for a given K-mer length.
0 stars 0 forks source link

mappable() should standardize genome input string for optimal caching #2

Closed omsai closed 7 years ago

omsai commented 7 years ago

Currently, different files would be written for these 2 cases, which should be equivalent:

mappable(genome = "hg38")
mappable(genome = "BSgenome.Hsapiens.UCSC.hg38")

This is because the string genome is used directly in constructing the BiocFileCache reference. One could instead standardize the string using bsgenomeName(bsgenome) or similar to ensure the shorthand and long versions of the above genome string both fetch the same files.

However to add the unit test to reproduce this fault would require splitting off the caching functionality into a separate function that returns the BiocFileCache string reference we construct. Such a reference string function would be useful later on for providing functions to export or import cached mappable files, as well as reducing the code in the current mappable cache unit test unit case.