Class: GeneMergeValidationOutput
- Inherits:
-
ValidationReport
- Object
- ValidationReport
- GeneMergeValidationOutput
- Defined in:
- lib/genevalidator/validation_gene_merge.rb
Overview
Class that stores the validation output information
Instance Attribute Summary (collapse)
-
- (Object) slope
readonly
Returns the value of attribute slope.
-
- (Object) threshold_down
readonly
Returns the value of attribute threshold_down.
-
- (Object) threshold_up
readonly
Returns the value of attribute threshold_up.
Attributes inherited from ValidationReport
#bg_color, #errors, #expected, #message, #plot_files, #result, #validation_result
Instance Method Summary (collapse)
- - (Object) color
-
- (GeneMergeValidationOutput) initialize(slope, threshold_down = 0.4, threshold_up = 1.2, expected = :no)
constructor
A new instance of GeneMergeValidationOutput.
- - (Object) print
- - (Object) validation
Constructor Details
- (GeneMergeValidationOutput) initialize(slope, threshold_down = 0.4, threshold_up = 1.2, expected = :no)
Returns a new instance of GeneMergeValidationOutput
12 13 14 15 16 17 18 19 |
# File 'lib/genevalidator/validation_gene_merge.rb', line 12 def initialize (slope, threshold_down = 0.4, threshold_up = 1.2, expected = :no) @slope = slope @threshold_down = threshold_down @threshold_up = threshold_up @result = validation @expected = expected @plot_files = [] end |
Instance Attribute Details
- (Object) slope (readonly)
Returns the value of attribute slope
8 9 10 |
# File 'lib/genevalidator/validation_gene_merge.rb', line 8 def slope @slope end |
- (Object) threshold_down (readonly)
Returns the value of attribute threshold_down
9 10 11 |
# File 'lib/genevalidator/validation_gene_merge.rb', line 9 def threshold_down @threshold_down end |
- (Object) threshold_up (readonly)
Returns the value of attribute threshold_up
10 11 12 |
# File 'lib/genevalidator/validation_gene_merge.rb', line 10 def threshold_up @threshold_up end |
Instance Method Details
- (Object) color
39 40 41 42 43 44 45 |
# File 'lib/genevalidator/validation_gene_merge.rb', line 39 def color if validation == :no "success" else "danger" end end |
- (Object) print
21 22 23 24 25 26 27 |
# File 'lib/genevalidator/validation_gene_merge.rb', line 21 def print if @slope.nan? "slope=Inf" else "slope=#{@slope.round(2)}" end end |
- (Object) validation
29 30 31 32 33 34 35 36 37 |
# File 'lib/genevalidator/validation_gene_merge.rb', line 29 def validation # color gene merge validation if @slope > threshold_down and @slope < threshold_up :yes else :no end end |