Class: Bio::CNLS::Result
- Inherits:
-
Object
- Object
- Bio::CNLS::Result
- Defined in:
- lib/bio/cnls_screenscraper/cnls_screenscraper.rb
Defined Under Namespace
Classes: BipartiteNLS, MonopartiteNLS, NLS
Instance Attribute Summary collapse
-
#signals ⇒ Object
Returns the value of attribute signals.
Instance Method Summary collapse
- #bipartite_predicted?(minimum_score = nil) ⇒ Boolean
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #max_bipartite_score ⇒ Object
- #max_monopartite_score ⇒ Object
- #monopartite_predicted?(minimum_score = nil) ⇒ Boolean
-
#predicted? ⇒ Boolean
Is this result a positive prediction or negative prediction?.
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
16 17 18 |
# File 'lib/bio/cnls_screenscraper/cnls_screenscraper.rb', line 16 def initialize @signals = [] end |
Instance Attribute Details
#signals ⇒ Object
Returns the value of attribute signals.
14 15 16 |
# File 'lib/bio/cnls_screenscraper/cnls_screenscraper.rb', line 14 def signals @signals end |
Instance Method Details
#bipartite_predicted?(minimum_score = nil) ⇒ Boolean
46 47 48 49 50 51 52 53 54 |
# File 'lib/bio/cnls_screenscraper/cnls_screenscraper.rb', line 46 def bipartite_predicted?(minimum_score=nil) @signals.each do |s| if s.kind_of?(BipartiteNLS) return true if minimum_score.nil? #if no cutoff, return true return true if s.score >= minimum_score #otherwise apply the cutoff end end return false end |
#max_bipartite_score ⇒ Object
66 67 68 69 70 71 72 73 74 |
# File 'lib/bio/cnls_screenscraper/cnls_screenscraper.rb', line 66 def max_bipartite_score max = 0.0 @signals.each do |s| if s.kind_of?(BipartiteNLS) and s.score > max max = s.score end end return max end |
#max_monopartite_score ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/bio/cnls_screenscraper/cnls_screenscraper.rb', line 56 def max_monopartite_score max = 0.0 @signals.each do |s| if s.kind_of?(MonopartiteNLS) and s.score > max max = s.score end end return max end |
#monopartite_predicted?(minimum_score = nil) ⇒ Boolean
36 37 38 39 40 41 42 43 44 |
# File 'lib/bio/cnls_screenscraper/cnls_screenscraper.rb', line 36 def monopartite_predicted?(minimum_score=nil) @signals.each do |s| if s.kind_of?(MonopartiteNLS) return true if minimum_score.nil? #if no cutoff, return true return true if s.score >= minimum_score #otherwise apply the cutoff end end return false end |
#predicted? ⇒ Boolean
Is this result a positive prediction or negative prediction?
32 33 34 |
# File 'lib/bio/cnls_screenscraper/cnls_screenscraper.rb', line 32 def predicted? !signals.nil? and !signals.empty? end |