Skip to content

Commit

Permalink
Merge pull request #330 from anamariaelek/add_package_rBLAST_support
Browse files Browse the repository at this point in the history
rBLAST support
  • Loading branch information
stevenolen authored May 22, 2024
2 parents 896c68c + c85a859 commit 8bba094
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/rBLAST/install
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+

31 changes: 31 additions & 0 deletions packages/rBLAST/test.R
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)

0 comments on commit 8bba094

Please sign in to comment.