Fetchseqs function (DEPRECATED)
fetchSeqs(
x,
database,
marker = NULL,
downstream = FALSE,
output = "h",
min_length = 1,
max_length = 2000,
subsample = FALSE,
chunk_size = NULL,
out_dir = NULL,
compress = TRUE,
force = FALSE,
multithread = FALSE,
quiet = TRUE,
progress = FALSE
)
A taxon name or vector of taxon names to download sequences for.
The database to download from. For NCBI GenBank this currently onlt accepts the arguments 'nuccore' or 'genbank' which is an alias for nuccore. Alternatively sequences can be downloaded from the Barcode of Life Data System (BOLD) using 'bold'
The barcode marker used as a search term for the database. If you are targetting a gene, adding a suffix [GENE] will increase the search selectivity. The default for Genbank is 'COI[GENE] OR COX1[GENE] OR COXI[GENE]', while the default for BOLD is 'COI-5P'. If this is set to "mitochondria" and database is 'nuccore', or 'genbank'it will download mitochondrial genomes only. If this is set to "genome" and database is 'nuccore', or 'genbank'it will download complete genome sequences only.
Instead of search for the query sequence, this provides the option of instead searching for a downstream taxonomic rank. This is useful for big queries where >100k sequences will be downloaded. For example, when x is 'Insecta', and downsteam is Order, this will download all Orders within insecta and thus not overload the query. Default is FALSE.
The output format for the taxonomy in fasta headers.
Options include "h" for full heirarchial taxonomy (SeqID;Domain;Phylum;Class;Order;Family;Genus;Species),
"binom" for just genus species binomials (SeqID;Genus Species),
"bold" for BOLD taxonomic ID only (SeqID;BoldTaxID),
"gb" for genbank taxonomic ID (SeqID;GBTaxID),
"gb-binom" which outputs Genus species binomials, as well as genbank taxonomic ID's, and translates all BOLD taxonomic ID's to genbank taxonomic ID's in the process,
or "standard" which outputs the default format for each database. For bold this is sampleid|species name|markercode|genbankid
while for genbank this is Accession Sequence definition
The maximum length of the query sequence to return. Default 1.
The maximum length of the query sequence to return. This can be useful for ensuring no off-target sequences are returned. Default 2000.
(Numeric) return a random subsample of sequences from the search.
Split up the queries made (for genbank), or returned records(for BOLD) into chunks of this size to avoid overloading API servers. if left NULL, the default for genbank searches will be 10,000 for regular queries, 1,000 if marker is "mitochondria", and 1 if marker is "genome" For BOLD queries the default is 100,000 returned records
Output directory to write fasta files to
Option to compress output fasta files using gzip
Option to overwrite files if they already exist
Whether multithreading should be used, if TRUE the number of cores will be automatically detected, or provided a numeric vector to manually set the number of cores to use Note, the way this is currently implemented, a seperate worker thread is assigned to each taxon, therefore multithreading will only work if x is a vector, or of downstream is being used.
Whether progress should be printed to the console.
A logical, for whether or not to print a progress bar when multithread is true. Note, this will slow down processing.