Default function to download Gesel gene description files.

downloadGeneFile(
  name,
  url = geneUrl(),
  cache = cacheDirectory(),
  overwrite = FALSE
)

geneUrl(url = NULL)

Arguments

name

String containing the name of a Gesel gene file, typically of the form <species>_<type>.tsv.gz, e.g., "9606_symbol.tsv.gz".

url

String containing the base URL to the Gesel gene descriptions.

cache

String specifying the path to a cache directory.

overwrite

Boolean indicating whether any cached file should be overwritten.

Value

downloadGeneFile returns a string containing a local path to the downloaded file.

For geneUrl, if url=NULL, the function returns a string containing the URL to the Gesel gene descriptions. If url is provided, it instead stores url as the URL to the indices, and the previous value of url is invisibly returned.

Details

The gene URL defaults to the GitHub releases at https://github.com/LTLA/gesel-feedstock. This can be altered by setting the GESEL_GENE_URL environment variable prior to the first call to this function.

Author

Aaron Lun

Examples

# Download file.
downloadGeneFile("9606_symbol.tsv.gz")
#> [1] "~/.cache/gesel/https%3A%2F%2Fgithub.com%2FLTLA%2Fgesel-feedstock%2Freleases%2Fdownload%2Fgenes-v1.0.0%2F9606_symbol.tsv.gz"

# Altering the default gene URL.
geneUrl()
#> [1] "https://github.com/LTLA/gesel-feedstock/releases/download/genes-v1.0.0"
old <- geneUrl("https://foo")
geneUrl()
#> [1] "https://foo"
geneUrl(old)