Class: MS::Lipid::Search::Hit
- Inherits:
-
Object
- Object
- MS::Lipid::Search::Hit
- Defined in:
- lib/ms/lipid/search/hit.rb
Instance Attribute Summary collapse
-
#db_isobar_group ⇒ Object
the db_isobar_group this hit is associated with.
-
#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.
22 23 24 |
# File 'lib/ms/lipid/search/hit.rb', line 22 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/ms/lipid/search/hit.rb', line 8 def @db_isobar_group end |
#observed_mz ⇒ Object
the experimental m/z value
10 11 12 |
# File 'lib/ms/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
20 21 22 |
# File 'lib/ms/lipid/search/hit.rb', line 20 def probability_distribution @probability_distribution end |
#pvalue ⇒ Object
the probability the hit is due to random chance
12 13 14 |
# File 'lib/ms/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/ms/lipid/search/hit.rb', line 16 def qvalue @qvalue end |
Instance Method Details
#delta ⇒ Object Also known as: amu
observed_mz - query m/z
27 28 29 |
# File 'lib/ms/lipid/search/hit.rb', line 27 def delta @observed_mz - @db_isobar_group.first.mz.to_f end |
#delta_abs ⇒ Object
the absolute value of distance from true val
34 35 36 |
# File 'lib/ms/lipid/search/hit.rb', line 34 def delta_abs delta.abs end |
#inspect ⇒ Object
47 48 49 |
# File 'lib/ms/lipid/search/hit.rb', line 47 def inspect "<<#{super} -- <ppm=#{ppm} delta=#{delta} theoretical_mz=#{theoretical_mz}>>" end |
#ppm ⇒ Object
parts per million (divided by theoretical m/z)
39 40 41 |
# File 'lib/ms/lipid/search/hit.rb', line 39 def ppm (delta / @db_isobar_group.first.mz) * 1e6 end |
#theoretical_mz ⇒ Object
43 44 45 |
# File 'lib/ms/lipid/search/hit.rb', line 43 def theoretical_mz @db_isobar_group.first.mz end |