class MzID::PSM

class to represent a single peptide-spectrum match (PSM)

Public Class Methods

new(h={}) click to toggle source
# 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

Public Instance Methods

add_pep_ev(pep_ev) click to toggle source

add the peptide evidence

# 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() click to toggle source

get ID

# File lib/mzid/psm.rb, line 25
def get_id() @id end
get_mods() click to toggle source

get modifications

# File lib/mzid/psm.rb, line 37
def get_mods() @mods end
get_pass_threshold() click to toggle source

get pass threshold flag

# File lib/mzid/psm.rb, line 41
def get_pass_threshold() @pass_thresh end
get_pep() click to toggle source

get peptide sequence

# File lib/mzid/psm.rb, line 27
def get_pep() @pep end
get_pep_ev() click to toggle source

get peptide evidence

# File lib/mzid/psm.rb, line 39
def get_pep_ev() @pep_evidence end
get_pep_ref() click to toggle source

get peptide reference

# File lib/mzid/psm.rb, line 31
def get_pep_ref() @peptide_ref end
get_spec_num() click to toggle source

get spectrum number

# File lib/mzid/psm.rb, line 35
def get_spec_num() @spec_num end
get_spec_prob() click to toggle source

get spectral probability

# File lib/mzid/psm.rb, line 29
def get_spec_prob() @spec_prob end
get_spec_ref() click to toggle source

get spectrum reference

# File lib/mzid/psm.rb, line 33
def get_spec_ref() @spec_ref end
set_pep(pep) click to toggle source

set the peptide sequence

# File lib/mzid/psm.rb, line 48
def set_pep(pep) @pep = pep end
set_spec_prob(prob) click to toggle source

set the spectral probability

# File lib/mzid/psm.rb, line 50
def set_spec_prob(prob) @spec_prob = prob end
to_s() click to toggle source

output PSM as string

# File lib/mzid/psm.rb, line 58
def to_s() "[#{@spec_num}; Pep: #{@pep}; SpecProb: #{@spec_prob}; Mods #{@mods.to_s}]" end