-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblaster.rb
executable file
·47 lines (40 loc) · 1.39 KB
/
blaster.rb
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
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/local/bin/ruby
# The Blaster project is copyright 2008, 2009, Stanford University, released as open source under the MIT license.
# Ed Allen, Stanford Genome Technology Center, begun 4 March 2008
# First scratch partial version Feb 20, 2008
$: << File.expand_path(File.dirname(__FILE__) + "/./lib")
# Ruby library & gem requires
require 'rubygems'
require 'bio'
require 'yaml'
# Blaster project requires
require 'my_dna'
require 'blast_flora'
require 'blast_hash'
require 'bacterium'
blaster = BlastFlora.new()
puts "made a BlastFlora object"
# Iterate over a_bacteria, making a Bacterium object for each, and tell it to blast itself.
blaster.a_bacteria.each do |b|
begin
bac = Bacterium.new(b[:nc_id],b[:genus],b[:species],b[:strain], true)
puts "step 2"
puts "made Bacterium for #{b[:nc_id]} #{b[:genus]} #{b[:species]} #{b[:strain]}"
puts "step 3"
bac.set_blast_candidate_file_name()
puts "set candidate file name"
bac.blast_hash.write_to_fasta(bac.bac_results_dir,bac.nc_id)
puts "wrote out candidates file"
bac.blast_human()
puts "blasted against human DB"
bac.bin_human()
puts "Binned human db blast results"
bac.blast_other()
puts "blasted against other DB"
bac.parse_other()
puts "parsed and binned other db blast results"
rescue => error
puts "Error for this input genome file"
puts "#{error.class}: #{error.message}"
end
end