Class: Mspire::Lipid::Search::Hit
- Inherits:
-
Object
- Object
- Mspire::Lipid::Search::Hit
- Defined in:
- lib/mspire/lipid/search/hit.rb
Instance Attribute Summary collapse
-
#db_isobar_group ⇒ Object
the db_isobar_group this hit is associated with.
-
#decoy_qvalue ⇒ Object
qvalue derived from decoy testing.
-
#observed_mz ⇒ Object
the experimental m/z value.
-
#probability_distribution ⇒ Object
the probability distribution that can be used to determine its pvalue.
-
#pvalue ⇒ Object
the probability the hit is due to random chance.
-
#qvalue ⇒ Object
the FDR if the threshold accepts this pvalue.
Instance Method Summary collapse
-
#delta ⇒ Object
(also: #amu)
observed_mz - query m/z.
-
#delta_abs ⇒ Object
the absolute value of distance from true val.
-
#initialize(hash = {}) ⇒ Hit
constructor
A new instance of Hit.
- #inspect ⇒ Object
-
#ppm ⇒ Object
parts per million (divided by theoretical m/z).
- #theoretical_mz ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Hit
Returns a new instance of Hit.
25 26 27 |
# File 'lib/mspire/lipid/search/hit.rb', line 25 def initialize(hash={}) hash.each {|k,v| instance_variable_set("@#{k}", v) } end |
Instance Attribute Details
#db_isobar_group ⇒ Object
the db_isobar_group this hit is associated with. Each hit is only associated with a single db_isobar_group!
8 9 10 |
# File 'lib/mspire/lipid/search/hit.rb', line 8 def @db_isobar_group end |
#decoy_qvalue ⇒ Object
qvalue derived from decoy testing
19 20 21 |
# File 'lib/mspire/lipid/search/hit.rb', line 19 def decoy_qvalue @decoy_qvalue end |
#observed_mz ⇒ Object
the experimental m/z value
10 11 12 |
# File 'lib/mspire/lipid/search/hit.rb', line 10 def observed_mz @observed_mz end |
#probability_distribution ⇒ Object
the probability distribution that can be used to determine its pvalue
23 24 25 |
# File 'lib/mspire/lipid/search/hit.rb', line 23 def probability_distribution @probability_distribution end |
#pvalue ⇒ Object
the probability the hit is due to random chance
12 13 14 |
# File 'lib/mspire/lipid/search/hit.rb', line 12 def pvalue @pvalue end |
#qvalue ⇒ Object
the FDR if the threshold accepts this pvalue. Note that this value is relative to the number of tests performed and not completely intrinsic to the hit itself.
16 17 18 |
# File 'lib/mspire/lipid/search/hit.rb', line 16 def qvalue @qvalue end |
Instance Method Details
#delta ⇒ Object Also known as: amu
observed_mz - query m/z
30 31 32 |
# File 'lib/mspire/lipid/search/hit.rb', line 30 def delta @observed_mz - @db_isobar_group.first.mz.to_f end |
#delta_abs ⇒ Object
the absolute value of distance from true val
37 38 39 |
# File 'lib/mspire/lipid/search/hit.rb', line 37 def delta_abs delta.abs end |
#inspect ⇒ Object
50 51 52 |
# File 'lib/mspire/lipid/search/hit.rb', line 50 def inspect "<<#{super} -- <ppm=#{ppm} delta=#{delta} theoretical_mz=#{theoretical_mz}>>" end |
#ppm ⇒ Object
parts per million (divided by theoretical m/z)
42 43 44 |
# File 'lib/mspire/lipid/search/hit.rb', line 42 def ppm (delta / @db_isobar_group.first.mz) * 1e6 end |
#theoretical_mz ⇒ Object
46 47 48 |
# File 'lib/mspire/lipid/search/hit.rb', line 46 def theoretical_mz @db_isobar_group.first.mz end |