View source: R/blast_best_reciprocal_hit.R
| blast_best_reciprocal_hit | R Documentation | 
This function performs a BLAST search between query and subject sequences reciprocally and returns (for each direction) only the best hit based on the following criteria.
A best blast hit is defined as:
the hit with the smallest e-value
if e-values are identical then the hit with the longest alignment length is chosen
A best reciprocal BLAST hit is defined as a hit that fulfills the following symmetry criteria:
blast_best_hit(A,B) = blast_best_hit(B,A)
blast_best_reciprocal_hit(
  query,
  subject,
  search_type = "nucleotide_to_nucleotide",
  strand = "both",
  output.path = NULL,
  is.subject.db = FALSE,
  task = "blastn",
  db.import = FALSE,
  postgres.user = NULL,
  evalue = 0.001,
  out.format = "csv",
  cores = 1,
  max.target.seqs = 10000,
  db.soft.mask = FALSE,
  db.hard.mask = FALSE,
  blast.path = NULL
)
query | 
 path to input file in fasta format.  | 
subject | 
 path to subject file in fasta format or blast-able database.  | 
search_type | 
 type of query and subject sequences that will be compared via BLAST search. Options are: 
  | 
strand | 
 Query DNA strand(s) to search against database/subject. Options are: 
  | 
output.path | 
 path to folder at which BLAST output table shall be stored. 
Default is   | 
is.subject.db | 
 logical specifying whether or not the   | 
task | 
 BLAST search task option (depending on the selected  
  | 
db.import | 
 shall the BLAST output be stored in a PostgresSQL database and shall a connection be established to this database? Default is   | 
postgres.user | 
 when   | 
evalue | 
 Expectation value (E) threshold for saving hits (default:   | 
out.format | 
 a character string specifying the format of the file in which the BLAST results shall be stored. Available options are: 
  | 
cores | 
 number of cores for parallel BLAST searches.  | 
max.target.seqs | 
 maximum number of aligned sequences that shall be retained. Please be aware that   | 
db.soft.mask | 
 shall low complexity regions be soft masked? Default is   | 
db.hard.mask | 
 shall low complexity regions be hard masked? Default is   | 
blast.path | 
 path to BLAST executables.  | 
Hajk-Georg Drost
blast_nucleotide_to_nucleotide, blast_protein_to_protein,
blast_nucleotide_to_protein, blast_protein_to_nucleotide, blast_best_hit
## Not run: 
test_best_reciprocal_hit <- blast_best_reciprocal_hit(
                 query   = system.file('seqs/qry_nn.fa', package = 'metablastr'),
                 subject = system.file('seqs/sbj_nn_best_hit.fa', package = 'metablastr'),
                 search_type = "nucleotide_to_nucleotide",
                 output.path = tempdir(),
                 db.import  = FALSE)
                 
 # look at results
 test_best_reciprocal_hit
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.