Class: Ms::Mascot::Dat::Summary::Id::Peptide

Inherits:
Object
  • Object
show all
Defined in:
lib/ms/mascot/dat/summary/id.rb

Constant Summary collapse

PEPTIDE_ATTS =
%w{
  ui0 calc_mr delta start end num_match seq rank ui8 score ui11 ui12 ui13 ui14 ui15 res_before res_after
}.map {|v| v.to_sym }
CASTING =
{
:calc_mr => 'to_f', 
:delta => 'to_f', 
:start => 'to_i', 
:end => 'to_i', 
:num_match => 'to_i', 
:rank => 'to_i', 
:score => 'to_f'}

Class Method Summary collapse

Class Method Details

.from_hash(hash) ⇒ Object



17
18
19
20
21
22
# File 'lib/ms/mascot/dat/summary/id.rb', line 17

def from_hash(hash)
  obj = self.new
  hash.each do |k,v|
    obj[k.to_sym] = v
  end
end

.from_strs(hit_string, hit_terms_string) ⇒ Object



11
12
13
14
15
# File 'lib/ms/mascot/dat/summary/id.rb', line 11

def from_strs(hit_string, hit_terms_string)
  vals = hit_string.split(',')
  vals.push( *(hit_terms_string.split(',')) )
  self.new(*vals)
end