Skip to contents

This function allows you to download data from the European Nucleotide Archive (ENA) using either a query or accession numbers.

Usage

ena_datahub_download(
  download_type,
  query = NULL,
  accession = NULL,
  format,
  location = getwd(),
  email = "NONE",
  dataHubUsername = NULL,
  dataHubPassword = NULL
)

Arguments

download_type

A character specifying the type of download: 'q' for query or 'a' for accession.

query

A character string containing the query to retrieve specific data (required for 'q' download type).

accession

A character string containing accession numbers (required for 'a' download type).

format

A character string specifying the format of the data to download. It must be one of: 'READS_FASTQ', 'READS_SUBMITTED', 'ANALYSIS_SUBMITTED', 'ANALYSIS_GENERATED'.

location

A character string specifying the download location (default is the current working directory).

email

A character string specifying the email address for notifications (default is "NONE").

dataHubUsername

A character string specifying the username for ENA data hub account.

dataHubPassword

A character string specifying the password for ENA data hub account.

Value

None (downloads data to the specified location)

Details

This function downloads data from the ENA using the ENA file downloader tool. It supports two types of downloads: - Query-based download ('q'): You provide a query string to retrieve specific data. - Accession-based download ('a'): You provide accession numbers to download specific data.

Examples

# Download data using a query
q = "result=read_run&query=country=%22Japan%22AND%20depth=168"
ena_download("q", query = q, format = "READS_FASTQ")

# Download data using accession numbers
ena_download("a", accession = "SAMEA3231268,SAMEA3231287", format = "READS_FASTQ")