
Bioconductor Rblast
Seamlessly interfaces the Basic Local Alignment Search Tool (BLAST) to search genetic...
Install
npx skills add bioMate-AI/biomate-bioconductor-kb --skill bioconductor-rblast -g -a claude-code -y- Repository
- bioMate-AI/biomate-bioconductor-kb793
- Category
- Writing
- Updated
- 5mo ago
- License
- See repository
- Context cost
- Lightabout 1,110 tokens
- Runs scripts
- No, instructions only
What it does
Seamlessly interfaces the Basic Local Alignment Search Tool (BLAST) to search genetic sequence data bases. This work was partially supported by grant no. R21HG005912 from the National Human Genome Research Institute.
rblast
Workflows
Create Custom Blast Db
Create a custom BLAST database from user-provided sequences and query it locally.
library(rBLAST)
library(Biostrings)
# Load example sequences
seq <- readRNAStringSet(system.file("examples/RNA_example.fasta", package = "rBLAST"))
# Write to FASTA
writeXStringSet(seq, filepath = "seqs.fasta")
# Create database
makeblastdb("seqs.fasta", db_name = "db/small", dbtype = "nucl")
Note: Input is an XStringSet object, and output is a set of local BLAST database files written to disk.
Standard Workflow
Download, extract, and query an existing NCBI BLAST database using local BLAST.
library(rBLAST)
# Download and extract 16S database
tgz_file <- blast_db_get("16S_ribosomal_RNA.tar.gz")
untar(tgz_file, exdir = "16S_rRNA_DB")
# Load existing database
bl <- blast(db = "./16S_rRNA_DB/16S_ribosomal_RNA")
# Query database
seq <- readRNAStringSet(system.file("examples/RNA_example.fasta", package = "rBLAST"))[1]
cl <- predict(bl, seq)
Note: Input is a path to a local BLAST database and a query XStringSet object; output is a data.frame of matches.
Create And Query Custom Db
Seamlessly interfaces the Basic Local Alignment Search Tool (BLAST) to search genetic sequence data
library(rBLAST)
library(Biostrings)
# 1. Read reference sequences
seq <- readRNAStringSet(system.file("examples/RNA_example.fasta", package = "rBLAST"))
# 2. Write sequences to a FASTA file
writeXStringSet(seq, filepath = "seqs.fasta")
# 3. Create custom BLAST database
makeblastdb("seqs.fasta", db_name = "db/small", dbtype = "nucl")
# 4. Load custom database
db <- blast("db/small")
# 5. Extract a subsequence fragment
fragment <- subseq(seq[1], start = 101, end = 200)
# 6. Query custom database
res <- predict(db, fragment)
Note: Input is a set of reference sequences and a query fragment; output is a data.frame of alignment matches.
