This is a wrapper for makeblastdb.

build_blast_db(in_seqs, db_type = "nucl", out_name = NULL,
  title = NULL, parse_seqids = FALSE, echo = TRUE, wd, ...)

Arguments

in_seqs

Character vector of length one; the path to the fasta file containing the sequences to be included in the database.

db_type

Character vector of length one; "nucl" for DNA or "prot" for amino acids (proteins).

out_name

Character vector of length one; name of BLAST database to be created (optional). This will be used to name all database files; if omitted, the name of the `in_seqs` file will be used instead.

title

Character vector of length one; title of BLAST database to be created (optional).

parse_seqids

Logical; should the makeblastdb flag "parse_seqids" be used?

echo

Logical; should standard error and output be printed?

wd

Character vector of length one; working directory. The blast database will be made here.

...

Additional other arguments. Not used by this function, but meant to be used by drake_plan for tracking during workflows.

Value

A series of files starting with out_name and ending in .phr, .pin, .pog, .psd, .psi, psq (for proteins) or .nhr, .nin, .nog, .nsd, .nsi, and .nsq (for DNA) that constitute the BLAST database in the working directory.

References

https://www.ncbi.nlm.nih.gov/books/NBK279690/

Examples

library(ape) data(woodmouse) temp_dir <- fs::dir_create(fs::path(tempdir(), "baitfindR_example")) ape::write.FASTA(woodmouse, fs::path(temp_dir, "woodmouse.fasta")) list.files(temp_dir)
#> [1] "woodmouse.fasta"
build_blast_db( fs::path(temp_dir, "woodmouse.fasta"), title = "test db", out_name = "wood", parse_seqids = TRUE, wd = temp_dir)
#> #> #> Building a new DB, current time: 05/15/2019 16:40:39 #> New DB name: /tmp/RtmpeNC9nF/baitfindR_example/wood #> New DB title: test db #> Sequence type: Nucleotide #> Keep MBits: T #> Maximum file size: 1000000000B #> Adding sequences from FASTA; added 15 sequences in 0.0120161 seconds.
#> $status #> [1] 0 #> #> $stdout #> [1] "\n\nBuilding a new DB, current time: 05/15/2019 16:40:39\nNew DB name: /tmp/RtmpeNC9nF/baitfindR_example/wood\nNew DB title: test db\nSequence type: Nucleotide\nKeep MBits: T\nMaximum file size: 1000000000B\nAdding sequences from FASTA; added 15 sequences in 0.0120161 seconds.\n" #> #> $stderr #> [1] "" #> #> $timeout #> [1] FALSE #>
list.files(temp_dir)
#> [1] "wood.nhr" "wood.nin" "wood.nog" "wood.nsd" #> [5] "wood.nsi" "wood.nsq" "woodmouse.fasta"
fs::file_delete(temp_dir)