Conduct BLAST search and return top hit
blast_top_hit(
query,
db,
type = "blastn",
identity = 95,
coverage = 95,
evalue = 1e+06,
max_target_seqs = 5,
max_hsp = 5,
ranks = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"),
delim = ";",
resolve_ties = "first",
args = NULL,
remove_db_gaps = TRUE,
quiet = FALSE,
...
)
(Required) Query sequence. Accepts a DNABin object, DNAStringSet object, Character string, or filepath.
(Required) Reference sequences to conduct search against. Accepts a DNABin object, DNAStringSet object, Character string, or filepath. If DNAbin, DNAStringSet or character string is provided, a temporary fasta file is used to construct BLAST database
(Required) type of search to conduct, default 'blastn'
(Required) Minimum percent identity cutoff. Note that this is calculated using all alignments for each query-subject match.
(Required) Minimum percent query coverage cutoff. Note that this is calculated using all alignments for each query-subject match.
(Required) Minimum expect value (E) for saving hits
(Required) Number of aligned sequences to keep. Even if you are only looking for 1 top hit keep this higher for calculations to perform properly.
(Required) Maximum number of HSPs (alignments) to keep for any single query-subject pair.
(Required) The taxonomic ranks contained in the fasta headers
(Required) The delimiter between taxonomic ranks in fasta headers
(Optional) Extra arguments passed to BLAST
Whether gaps should be removed from the fasta file used for the database. Note that makeblastdb can fail if there are too many gaps in the sequence.
(Optional) Whether progress should be printed to console, default is FALSE
How to handle ties in top hit results. Options are to break ties by selecting the first hit (Default), or return all tied hits.