Skip to contents

Zenodo is a repository of large scientific datasets. Many projects and publications make their datasets available at Zenodo. This function downloads an archive from Zenodo and extracts the requested file.

Usage

zenodo_download(
  path,
  reader = NULL,
  reader_param = list(),
  url_key = NULL,
  zenodo_record = NULL,
  zenodo_fname = NULL,
  url_param = list(),
  url_key_param = list(),
  ...
)

Arguments

path

Character: path to the file within the archive.

reader

Optional, a function to read the connection.

reader_param

List: arguments for the reader function.

url_key

Character: name of the option containing the URL

zenodo_record

The Zenodo record ID, either integer or character.

zenodo_fname

The file name within the record.

url_param

List: variables to insert into the URL string (which is returned from the options).

url_key_param

List: variables to insert into the `url_key`.

...

Passed to archive_extractor

Value

A connection

Examples

# an example from the OmnipathR::remap_tf_target_download function:
remap_dorothea <- zenodo_download(
    zenodo_record = 3713238,
    zenodo_fname = 'tf_target_sources.zip',
    path = (
        'tf_target_sources/chip_seq/remap/gene_tf_pairs_genesymbol.txt'
    ),
    reader = read_tsv,
    reader_param = list(
        col_names = c(
            'source_genesymbol',
            'target_genesymbol',
            'target_ensembl',
            'score'
        ),
        col_types = cols(),
        progress = FALSE
    ),
  resource = 'ReMap'
)
#> Error in eval(expr, envir, enclos): object 'read_tsv' not found