-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from anamariaelek/add_package_rBLAST_support
rBLAST support
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
apt-get -qq update | ||
apt-get -qq install ncbi-blast+ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
install.packages(c("devtools","BiocManager"), repos="https://cran.rstudio.com") | ||
BiocManager::install("Biostrings") | ||
devtools::install_github("mhahsler/rBLAST") | ||
library(rBLAST) | ||
rBLAST::blast_help() | ||
|
||
## check if makeblastdb is correctly installed | ||
Sys.which("makeblastdb") | ||
|
||
## see possible arguments | ||
blast_help("makeblastdb") | ||
|
||
## create a database for some example sequences | ||
seq <- readRNAStringSet(system.file("examples/RNA_example.fasta", | ||
package="rBLAST")) | ||
|
||
## 1. write the FASTA file | ||
dir <- tempdir() | ||
writeXStringSet(seq, filepath = file.path(dir, "seqs.fasta")) | ||
|
||
## 2. make database | ||
makeblastdb(file.path(dir, "seqs.fasta"), dbtype = "nucl") | ||
|
||
## 3. open database | ||
db <- blast(file.path(dir, "seqs.fasta")) | ||
|
||
## 4. perform search (first sequence in the db should be a perfect match) | ||
predict(db, seq[1]) | ||
|
||
## clean up | ||
unlink(dir, recursive = TRUE) |