makeblastdb | R Documentation |
Call the makeblastdb
utility to create a BLAST database from a FASTA file.
makeblastdb(
file,
db_name = NULL,
dbtype = "nucl",
hash_index = TRUE,
args = "",
verbose = TRUE
)
file |
input file/database name. Note that the filename and path cannot contain whitespaces. |
db_name |
name of the database (files). |
dbtype |
molecule type of target db ( |
hash_index |
logical; create index of sequence hash values. |
args |
string including additional arguments passed on
to |
verbose |
logical; show the progress report produced by |
R needs to be able to find the executable (mostly an issue with Windows).
Try Sys.which("makeblastdb")
to see if the program is properly
installed.
Use blast_help("makeblastdb")
to see all possible extra arguments.
Arguments need to be formated in exactly the way as they would be used for
the command line tool.
Nothing but creates a BLAST database directory.
Michael Hahsler
Other blast:
blast()
,
blast_db_cache()
## check if makeblastdb is correctly installed
Sys.which("makeblastdb")
## only run if blast is installed
if (has_blast()) {
## see possible arguments
blast_help("makeblastdb")
## read some example sequences
seq <- readRNAStringSet(system.file("examples/RNA_example.fasta",
package = "rBLAST"
))
## 1. write the FASTA file
writeXStringSet(seq, filepath = "seqs.fasta")
## 2. make database
makeblastdb(file = "seqs.fasta", db_name = "db/small", dbtype = "nucl")
## 3. open database
db <- blast("db/small")
db
## 4. perform search (first sequence in the db should be a perfect match)
predict(db, seq[1])
## clean up
unlink("seqs.fasta")
unlink("db", recursive = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.