class GeneValidator::LengthClusterValidationOutput
Class that stores the validation output information
Attributes
limits[R]
query_length[R]
result[R]
Public Class Methods
new(short_header, header, description, query_length, limits, expected = :yes)
click to toggle source
# File lib/genevalidator/validation_length_cluster.rb, line 16 def initialize(short_header, header, description, query_length, limits, expected = :yes) @short_header = short_header @header = header @description = description @limits = limits @query_length = query_length @expected = expected @result = validation @plot_files = [] @approach = 'If the query sequence is well conserved and similar' \ ' sequences (BLAST hits) are correct, we can expect' \ ' query and hit sequences to have similar lengths.' \ ' Here, we cluster the lengths of hit sequences and' \ ' compare the length of our query sequence to the most' \ ' dense cluster of hit lengths. ' @explanation = explain @conclusion = conclude end
Public Instance Methods
conclude()
click to toggle source
# File lib/genevalidator/validation_length_cluster.rb, line 44 def conclude if @result == :yes # i.e. if inside the main cluster 'There is no reason to believe there is any problem with the length' \ ' of the query sequence.' else size_diff = @query_length > @limits[1] ? 'long' : 'short' "This suggests that the query sequence may be too #{size_diff}." end end
explain()
click to toggle source
# File lib/genevalidator/validation_length_cluster.rb, line 36 def explain diff = @result == :yes ? 'inside' : 'outside' 'The most dense length-cluster of BLAST hits includes' \ " sequences that are from #{@limits[0]} to #{@limits[1]} amino-acids" \ " long. The query sequence is #{@query_length} amino-acids long and" \ " is thus #{diff} the most dense length-cluster of BLAST hits." end
print()
click to toggle source
# File lib/genevalidator/validation_length_cluster.rb, line 54 def print "#{@query_length} #{@limits.to_s.gsub(' ', ' ')}" end
validation()
click to toggle source
# File lib/genevalidator/validation_length_cluster.rb, line 58 def validation return if @limits.nil? if @query_length >= @limits[0] && @query_length <= @limits[1] :yes else :no end end