Class: Quorum::FetchTools::BlastDb

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/templates/blast_db.rb

Overview

Blast DB Fetch Tool

Constant Summary collapse

DB_TYPE =

blastdbcmd -dbtype

{
  "blastn"  => "nucl",
  "blastx"  => "prot",
  "tblastn" => "nucl",
  "blastp"  => "prot"
}

Instance Method Summary collapse

Instance Method Details

#execute_blast_db_cmdObject

Execute the blastdbcmd(s) and return the matching sequence.

To make Blast execute as quickly as possible, each selected algorithm blasts against all supplied databases at once.

See quorum/lib/search_tools/blast.rb for more information.

One consequence of this is not knowing which Blast database to use when retrieving a hit sequence via blastdbcmd.

See blastdbcmd -help for more information.

To work around this issue, simply execute blastdbcmd against all Blast databases and filter on hit_display_id.



93
94
95
96
97
98
99
100
101
102
# File 'lib/generators/templates/blast_db.rb', line 93

def execute_blast_db_cmd
  generate_blast_db_cmds
  @logger.log("NCBI Blast", @cmds.join('; '))

  @seqs = ""
  @cmds.each { |c| @seqs << `#{c} 2> /dev/null` }

  seq = parse_and_send_results
  $stdout.print seq
end