blast: NCBI BLAST (Basic Local Alignment Search Tool)

Description Usage Arguments Value Examples

View source: R/insilico.R

Description

NCBI BLAST (Basic Local Alignment Search Tool)

Usage

1
blast(query, db, args, type = "blastn", gz = FALSE)

Arguments

query

either a string pointing to the query file, an object of class DNAbin, or an object of class XStringSet

db

string pointing to the BLAST database, or if the switch 'remote' is provided in 'args', the name of the remote NCBI database

args

A named list containing the BLAST program arguments to be used in a key/value manner. There is no need to use leading dashes on the argument names. SEE EXAMPLES

type

string with the name of the BLAST program to use. e.g. 'blastp' or 'blastn'

gz

boolean. For gzip'd query files. if 'TRUE', the query file is uncompressed and read stdin into the BLAST program

Value

An object of class 'data.table'. Only format '6' (tabular format) for 'outfmt' is supported.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
##Run local primer blast

query <- readDNAStringSet("ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/010/525/GCA_000010525.1_ASM1052v1/GCA_000010525.1_ASM1052v1_genomic.fna.gz")

primers <- c("GGCTGGATCACCTCCTT","GCCWAGGCATCCDCC")
db <- makeprimerdb(primers)

#Define BLAST arguments: these are the same that can be found in `RinsilicoPCR::blast.params$primers`
args <- list(
		outfmt="'6 qacc sacc pident length qlen slen qstart sstart qend send evalue'",
		max_target_seqs=20,
		word_size=8
		)

blastres <- blast(query,db,args)



##Run remote blast on NCBI blastdb `nt`

query <- readDNAStringSet("query.fa")

#Define BLAST arguments: these are the same that can be found in `RinsilicoPCR::blast.params$remote`
args <- list(
	outfmt="'6 qacc sacc pident length qlen slen qstart sstart qend send evalue'",
	max_target_seqs=20,
	word_size=11,
	remote=""
	)

blastres <- blast(query,db="nt",args)

zachth/RinsilicoPCR documentation built on Nov. 18, 2017, 11:27 p.m.