download_ncbi_genome_file | R Documentation |
This function downloads specific genomic files from NCBI's FTP server based on the provided accession number. It supports downloading different types of files, or the entire directory containing the files.
download_ncbi_genome_file(
accession,
out_dir = ".",
type = "gff",
file_suffix = NULL,
timeout = 300
)
accession |
A character string representing the NCBI accession number (e.g., "GCF_001036115.1_ASM103611v1" or "GCF_001036115.1"). The accession can start with "GCF" or "GCA". |
out_dir |
A character string representing the directory where the downloaded files will be saved. Defaults to the current working directory ("."). |
type |
A character string representing the type of file to download. Supported types are "all", "gff", "fna". If "all" is specified, the function will prompt the user to use command line tools to download the entire directory. Defaults to "gff". |
file_suffix |
A character string representing the specific file suffix to download.
If specified, this will override the |
timeout |
A numeric value representing the maximum time in seconds to wait for the download. Defaults to 300. |
If the provided accession
does not contain the version suffix (e.g., "GCF_001036115.1"),
the function will query the NCBI FTP server to determine the full accession name.
When type
is set to "all", the function cannot download the entire directory
directly but provides a command line example for the user to download the directory
using tools like wget
.
No value
## Not run:
download_ncbi_genome_file("GCF_001036115.1", out_dir = "downloads", type = "gff")
download_ncbi_genome_file("GCF_001036115.1", out_dir = "downloads", file_suffix = "_genomic.fna.gz")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.