Skip to contents

This function facilitates the downloading of reference files from the GENCODE database. It supports downloading GTF, GFF, and transcriptome FASTA files for human and mouse genomes. The function ensures that the correct version and file type are downloaded and handles directory creation and file existence checks to avoid redundant downloads.

Usage

download_reference(
  version = "46",
  reference = "gencode",
  organism = c("human", "mouse"),
  file_type = c("gtf", "gff", "fasta"),
  output_path = "data-raw",
  timeout_limit = 3600,
  method = "auto"
)

Arguments

version

Character with the version string. For mouse references, the letter 'M' in the version string is mandatory.

reference

Character indicating the source of the reference file. One of "gencode" or "mane". Defaults to "gencode". NOTE: "mane" is not implemented yet.

organism

Character indicating the organism. For GENCODE, this can only "human" or "mouse".

file_type

Character indicating the type of file to download. One of "gtf", "gff", or "fasta". Defaults to "gtf". NOTE: "fasta" refers to the transcriptome FASTA.

output_path

Character specifying the directory where the downloaded file will be saved. Defaults to "data-raw".

timeout_limit

Numeric value specifying the time in seconds for the download limit. This argument takes precedence over base::options("timeout"). Defaults to 3600 seconds (1 Hour).

method

Character specifying the method used by utils::download.file(). Defaults to "auto"

Value

A character string with the full path to the downloaded file.