build_blast_db: Build a BLAST database.

Description Usage Arguments Value Author(s) References Examples

Description

This is a wrapper for makeblastdb.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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.

Author(s)

Joel H Nitta, joelnitta@gmail.com

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)
build_blast_db(
  fs::path(temp_dir, "woodmouse.fasta"),
  title = "test db",
  out_name = "wood",
  parse_seqids = TRUE,
  wd = temp_dir)
list.files(temp_dir)
fs::file_delete(temp_dir)

joelnitta/baitfindR documentation built on May 7, 2020, 6:21 p.m.