Function to read BLAST data generated with standalone BLAST from NCBI.
Usage
read.blast(file, sep = "\t")
Arguments
file
character: BLAST file to read in.
sep
the field separator character. Values on each line of the file are
separated by this character. Default "\t".
Value
A data.frame with variables
query.id
character: sequence identifier.
subject.id
character: subject identifier.
identity
numeric: identity between sequences (in percent).
alignment.length
integer: number of nucleotides.
mismatches
integer: number of mismatches.
gap.opens
integer: number of gaps.
q.start
integer: query sequence start.
q.end
integer: query sequence end.
s.start
integer: subject sequence start.
s.end
integer: subject sequence end.
evalue
numeric: evalue.
bit.score
numeric: score value.
Details
The function reads data which was generated with standalone BLAST from NCBI;
see ftp://ftp.ncbi.nih.gov/blast/executables/release/.
Possible steps:
1) Install NCBI BLAST
2) Generate and import database(s)
3) Apply BLAST with options outfmt and out; e.g.
blastn -query Testquery -db Testdatabase -outfmt 6 -out out.txt
or
blastn -query Testquery -db Testdatabase -outfmt 10 -out out.csv
One can also call BLAST from inside R by using function system
system("blastn -query Testquery -db Testdatabase -outfmt 6 -out out.txt")
4) Read in the results
test.res <- read.blast(file = "out.txt")
or
test.res <- read.blast(file = "out.csv", sep = ",")
Flessa, F., Kehl, A., Kohl, M.
Analysing diversity and community structures using PCR-RFLP: a new software application.
Molecular Ecology Resources 2013 Jul; 13(4):726-33.