rblast: Local blast search with outfmt 6

Description Usage Arguments Value Examples

View source: R/rblast.R

Description

This functions returns a data frame as BLAST output, if multiple databese gave as an arugment, they are all in one, which fomat is outfmt 6 and additional column. The blast outformat is enforced as follows, '-outfmt "6 std qlen slen sstrand salltitles"'.

Usage

1
rblast(in_f, out_f, program, db, ...)

Arguments

in_f

character: input file path of multifasta format.

out_f

character: output file path or stdout as "-".

program

character: select a blast search program "blastn", "blastp", "blastx", "tblastn", "tblastx"

db

blast database name or file path of fasta: if you gives fasta file path, 'makeblastdb' was executed. it is not file path. if multiple database using, corresponding out put files path gave as 'out_f'.

...

additional parameter as character strings E.g. "-num_threads 4 -task megablast".

Value

blast output of 'outfmt 6' and several other column returnd as named data frame. if all query "No hits found", could not create data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
## create blast data base
# com0 <- c("makeblastdb -in TAIR10_chr_all.fas -out TAIR10 -dbtype nucl -parse_seqids")
# system(com0, intern = T)

# sample fasta of rsko package
in_fna <- system.file("extdata", "AtMlos.fna", package="rskodat")
bndb <-  "~/db/cdna/TAIR10_cdna"
bnout <- rblast(in_f = in_fna, out_f = "-", program = "blastn", db = bndb, "-num_threads 4")

# multiple db
db1 <- "~/db/cdna/TAIR10_cdna"
db2 <- "~/db/cdna/kegg_plant"
dbs <- c(db1,db2)
in_fna <- system.file("extdata", "AtMlos.fna", package="rskodat")
bnouts <- rblast(in_f = in_fna, out_f = "-", program = "blastn", db = dbs, "-num_threads 4")

## End(Not run)

shkonishi/rskoseq documentation built on April 18, 2021, 3:50 p.m.