Class: Mspire::Lipid::Search::Hit

Inherits:
Object
  • Object
show all
Defined in:
lib/mspire/lipid/search/hit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_groupObject

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
  @db_isobar_group
end

#decoy_qvalueObject

qvalue derived from decoy testing



19
20
21
# File 'lib/mspire/lipid/search/hit.rb', line 19

def decoy_qvalue
  @decoy_qvalue
end

#observed_mzObject

the experimental m/z value



10
11
12
# File 'lib/mspire/lipid/search/hit.rb', line 10

def observed_mz
  @observed_mz
end

#probability_distributionObject

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

#pvalueObject

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

#qvalueObject

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

#deltaObject 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_absObject

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

#inspectObject



50
51
52
# File 'lib/mspire/lipid/search/hit.rb', line 50

def inspect
  "<<#{super} -- <ppm=#{ppm} delta=#{delta} theoretical_mz=#{theoretical_mz}>>"
end

#ppmObject

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_mzObject



46
47
48
# File 'lib/mspire/lipid/search/hit.rb', line 46

def theoretical_mz
  @db_isobar_group.first.mz
end