64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
# File 'lib/full_lengther_next/classes/my_worker.rb', line 64
def full_lenghter2(seqs)
if (@options[:user_db])
if (@options[:user_db] =~ /\//)
user_db_name = @options[:user_db].sub(/.+\//,'')
end
if !File.exists?("#{File.expand_path(@options[:user_db])}.psq")
puts "user database: #{@options[:user_db]} was not found"
exit
end
my_blast = run_blast(seqs, "#{@options[:user_db]}", 'blastx', '1e-6')
if (!@options[:chimera].nil?)
seqs.each_with_index do |seq,i|
if (!my_blast.querys[i].hits[0].nil?)
search_chimeras(seq, my_blast.querys[i], @options, user_db_name)
end
end
seqs=seqs.select{|s| s.get_annotations(:chimera).empty?}
my_blast = select_best_blast(my_blast, seqs)
end
seqs.each_with_index do |seq,i|
analiza_orf_y_fl(seq, my_blast.querys[i], @options, user_db_name)
end
new_seqs=seqs.select{|s| (s.get_annotations(:complete).empty? && s.get_annotations(:chimera).empty?)}
else
new_seqs = seqs
end
return if new_seqs.empty?
sp_path=File.join("sp_#{@options[:tax_group]}","sp_#{@options[:tax_group]}.fasta")
my_blast = run_blast(new_seqs, sp_path, 'blastx', '1e-6')
if (!@options[:chimera].nil?)
new_seqs.each_with_index do |seq,i|
if (!my_blast.querys[i].hits[0].nil?)
search_chimeras(seq, my_blast.querys[i], @options, "sp_#{@options[:tax_group]}")
end
end
new_seqs=seqs.select{|s| s.get_annotations(:chimera).empty?}
my_blast = select_best_blast(my_blast, new_seqs)
end
new_seqs.each_with_index do |seq,i|
analiza_orf_y_fl(seq, my_blast.querys[i], @options, "sp_#{@options[:tax_group]}")
end
new_seqs=seqs.select{|s| (s.get_annotations(:complete).empty? && s.get_annotations(:chimera).empty?)}
return if new_seqs.empty?
tr_path=File.join("tr_#{@options[:tax_group]}","tr_#{@options[:tax_group]}.fasta")
my_blast = run_blast(new_seqs, tr_path, 'blastx', '1e-6')
if (!@options[:chimera].nil?)
new_seqs.each_with_index do |seq,i|
if (!my_blast.querys[i].hits[0].nil?)
search_chimeras(seq, my_blast.querys[i], @options, "tr_#{@options[:tax_group]}")
end
end
new_seqs=new_seqs.select{|s| s.get_annotations(:chimera).empty?}
my_blast = select_best_blast(my_blast, new_seqs)
end
new_seqs.each_with_index do |seq,i|
analiza_orf_y_fl(seq, my_blast.querys[i], @options, "tr_#{@options[:tax_group]}")
end
testcode_input=seqs.select{|s| (!s.get_annotations(:apply_tcode).empty? && s.get_annotations(:chimera).empty?)}
return if testcode_input.empty?
testcode_input.each do |seq|
TestCode.new(seq)
end
unknown_seqs=seqs.select{|s| !s.get_annotations(:tcode_unknown).empty?}
return if unknown_seqs.empty?
ncrna_path=File.join('nc_rna_db','ncrna_fln_100.fasta')
my_blast = run_blast(unknown_seqs, ncrna_path, 'blastn', '1e-3')
unknown_seqs.each_with_index do |seq,i|
find_nc_rna(seq, my_blast.querys[i])
end
end
|