Class: MzID::PSM
- Inherits:
-
Object
- Object
- MzID::PSM
- Defined in:
- lib/mzid/psm.rb
Overview
class to represent a single peptide-spectrum match (PSM)
Instance Method Summary collapse
-
#add_pep_ev(pep_ev) ⇒ Object
add the peptide evidence.
-
#get_id ⇒ Object
– get methods ++.
-
#get_mods ⇒ Object
get modifications.
-
#get_pass_threshold ⇒ Object
get pass threshold flag.
-
#get_pep ⇒ Object
get peptide sequence.
-
#get_pep_ev ⇒ Object
get peptide evidence.
-
#get_pep_ref ⇒ Object
get peptide reference.
-
#get_spec_num ⇒ Object
get spectrum number.
-
#get_spec_prob ⇒ Object
get spectral probability.
-
#get_spec_ref ⇒ Object
get spectrum reference.
-
#initialize(h = {}) ⇒ PSM
constructor
A new instance of PSM.
-
#set_pep(pep_seq) ⇒ Object
set peptide.
-
#set_spec_prob(prob) ⇒ Object
set the spectral probability.
-
#to_s ⇒ Object
output PSM as string.
Constructor Details
#initialize(h = {}) ⇒ PSM
Returns a new instance of PSM.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mzid/psm.rb', line 8 def initialize(h={}) @id = h.has_key?(:id) ? h[:id] : nil @pep = h.has_key?(:pep) ? h[:pep] : nil @spec_prob = h.has_key?(:spec_prob) ? h[:spec_prob] : nil @peptide_ref= h.has_key?(:pep_ref) ? h[:pep_ref] : nil @spec_ref = h.has_key?(:spec_ref) ? h[:spec_ref] : nil @spec_num = h.has_key?(:spec_num) ? h[:spec_num] : nil @mods = h.has_key?(:mods) ? h[:mods] : nil @pep_evidence = h.has_key?(:pep_ev) ? h[:pep_ev] : nil @pass_thresh = h.has_key?(:pass_threshold) ? h[:pass_threshold] : nil end |
Instance Method Details
#add_pep_ev(pep_ev) ⇒ Object
add the peptide evidence
54 |
# File 'lib/mzid/psm.rb', line 54 def add_pep_ev(pep_ev) @pep_evidence.nil? ? @pep_evidence = [pep_ev] : @pep_evidence.push(pep_ev) end |
#get_id ⇒ Object
– get methods ++
get ID
25 |
# File 'lib/mzid/psm.rb', line 25 def get_id() @id end |
#get_mods ⇒ Object
get modifications
37 |
# File 'lib/mzid/psm.rb', line 37 def get_mods() @mods end |
#get_pass_threshold ⇒ Object
get pass threshold flag
41 |
# File 'lib/mzid/psm.rb', line 41 def get_pass_threshold() @pass_thresh end |
#get_pep ⇒ Object
get peptide sequence
27 |
# File 'lib/mzid/psm.rb', line 27 def get_pep() @pep end |
#get_pep_ev ⇒ Object
get peptide evidence
39 |
# File 'lib/mzid/psm.rb', line 39 def get_pep_ev() @pep_evidence end |
#get_pep_ref ⇒ Object
get peptide reference
31 |
# File 'lib/mzid/psm.rb', line 31 def get_pep_ref() @peptide_ref end |
#get_spec_num ⇒ Object
get spectrum number
35 |
# File 'lib/mzid/psm.rb', line 35 def get_spec_num() @spec_num end |
#get_spec_prob ⇒ Object
get spectral probability
29 |
# File 'lib/mzid/psm.rb', line 29 def get_spec_prob() @spec_prob end |
#get_spec_ref ⇒ Object
get spectrum reference
33 |
# File 'lib/mzid/psm.rb', line 33 def get_spec_ref() @spec_ref end |
#set_pep(pep_seq) ⇒ Object
set peptide
48 |
# File 'lib/mzid/psm.rb', line 48 def set_pep(pep) @pep = pep end |
#set_spec_prob(prob) ⇒ Object
set the spectral probability
50 |
# File 'lib/mzid/psm.rb', line 50 def set_spec_prob(prob) @spec_prob = prob end |
#to_s ⇒ Object
output PSM as string
58 |
# File 'lib/mzid/psm.rb', line 58 def to_s() "[#{@spec_num}; Pep: #{@pep}; SpecProb: #{@spec_prob}; Mods #{@mods.to_s}]" end |