lib/generators/templates/blast.rb in quorum-0.7.1 vs lib/generators/templates/blast.rb in quorum-0.8.0
- old
+ new
@@ -362,15 +362,22 @@
@data[:align_len] = hsp.align_len
@data[:qseq] = hsp.qseq
@data[:hseq] = hsp.hseq
@data[:midline] = hsp.midline
+ # Calculate percent identity
+ @data[:pct_identity] = (
+ @data[:identity].to_f / @data[:align_len].to_f
+ ) * 100
+
+ # Calculate mismatch
+ @data[:mismatch] = @data[:align_len] - @data[:identity]
+
if @data[:bit_score] &&
(@data[:bit_score].to_i > @min_score.to_i)
@results = true
save_hsp_results
end
-
end
end
end
end