Class: Ms::Ident::ProteinHit

Inherits:
Protein
  • Object
show all
Defined in:
lib/ms/ident/protein_hit.rb

Instance Attribute Summary collapse

Attributes inherited from Protein

#description, #id, #seq

Instance Method Summary collapse

Constructor Details

#initialize(id = nil, peptide_hits = []) ⇒ ProteinHit

Returns a new instance of ProteinHit.



10
11
12
13
# File 'lib/ms/ident/protein_hit.rb', line 10

def initialize(id=nil, peptide_hits=[])
  @peptide_hits = peptide_hits
  @id = id
end

Instance Attribute Details

#peptide_hitsObject

Returns the value of attribute peptide_hits.



8
9
10
# File 'lib/ms/ident/protein_hit.rb', line 8

def peptide_hits
  @peptide_hits
end

Instance Method Details

#gene_idObject

if the GN=(+) regexp is found in the description, returns the first match, or nil if not found



17
18
19
# File 'lib/ms/ident/protein_hit.rb', line 17

def gene_id
  description.andand.match(/ GN=(\w+) ?/)[1]
end