-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx2.rb
More file actions
25 lines (18 loc) · 655 Bytes
/
Copy pathEx2.rb
File metadata and controls
25 lines (18 loc) · 655 Bytes
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
#!/usr/bin/env ruby
require 'bio'
# Create blast connection object
blast = Bio::Blast.remote('blastp', 'nr-aa', '-e 10 -m 7', 'genomenet')
# Iterate through each possible frame
(1..6).each do |frame|
puts "Processing frame #{frame}"
# Read the aminoacids sequence FASTA files
records = Bio::FlatFile.open(Bio::FastaFormat, "#{ARGV[0]}\$#{frame}.fas")
File.open("#{ARGV[0]}\$#{frame}.blas", 'w') do |f|
records.each_entry do |entry|
# Make the query to the BLAST tool
report = blast.query(entry.seq)
# Write XML output to file
f.puts blast.output
end
end
end