Class: Peptide
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Peptide
- Defined in:
- lib/msf/models/peptide.rb
Overview
ActiveRecord model of MSF Peptide
Example:
Peptide.find(1)
Peptide.first.sequence
Peptide.first.internal_modifications
Peptide.first.terminal_modification
Class Method Summary collapse
Instance Method Summary collapse
- #annotation ⇒ Object
- #confidence_level ⇒ Object
- #hidden ⇒ Object
- #isobar_sequence ⇒ Object
- #matched_ions_count ⇒ Object
- #missed_cleavages ⇒ Object
- #modified_sequence ⇒ Object
- #peptide_id ⇒ Object
- #processing_node_number ⇒ Object
- #search_engine_rank ⇒ Object
- #sequence ⇒ Object
- #spectrum_id ⇒ Object
- #theoretical_mass ⇒ Object
- #total_ions_count ⇒ Object
- #unique_peptide_sequence_id ⇒ Object
Class Method Details
.primary_key ⇒ Object
13 14 15 |
# File 'lib/msf/models/peptide.rb', line 13 def self.primary_key :PeptideID end |
.table_name ⇒ Object
10 11 12 |
# File 'lib/msf/models/peptide.rb', line 10 def self.table_name :Peptides end |
Instance Method Details
#annotation ⇒ Object
43 44 45 |
# File 'lib/msf/models/peptide.rb', line 43 def annotation self.Annotation end |
#confidence_level ⇒ Object
31 32 33 |
# File 'lib/msf/models/peptide.rb', line 31 def confidence_level self.ConfidenceLevel end |
#hidden ⇒ Object
37 38 39 |
# File 'lib/msf/models/peptide.rb', line 37 def hidden self.Hidden end |
#isobar_sequence ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/msf/models/peptide.rb', line 81 def nterm = '' unless self.terminal_modification.nil? nterm = "#{self.terminal_modification.modification_name}:" end sequence_amino_acids = self.sequence.split(//) = [] sequence_amino_acids.count.times { << ":"} self.peptides_amino_acid_modifications.each do |modification| [modification.position] = "#{modification.internal_modification.modification_name}_#{sequence_amino_acids[modification.position]}:" end nterm + .join("") end |
#matched_ions_count ⇒ Object
28 29 30 |
# File 'lib/msf/models/peptide.rb', line 28 def matched_ions_count self.MatchedIonsCount end |
#missed_cleavages ⇒ Object
49 50 51 |
# File 'lib/msf/models/peptide.rb', line 49 def missed_cleavages self.MissedCleavages end |
#modified_sequence ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/msf/models/peptide.rb', line 67 def modified_sequence nterm = '' cterm = '-COOH' if self.terminal_modification.nil? nterm = "NH2-" else nterm = "#{self.terminal_modification.modification_name}-" end sequence_amino_acids = self.sequence.split(//) self.peptides_amino_acid_modifications.each do |modification| sequence_amino_acids[modification.position] = "#{sequence_amino_acids[modification.position]}<#{modification.internal_modification.modification_name}>" end nterm + sequence_amino_acids.join("") + cterm end |
#peptide_id ⇒ Object
19 20 21 |
# File 'lib/msf/models/peptide.rb', line 19 def peptide_id self.PeptideID end |
#processing_node_number ⇒ Object
16 17 18 |
# File 'lib/msf/models/peptide.rb', line 16 def processing_node_number self.ProcessingNodeNumber end |
#search_engine_rank ⇒ Object
34 35 36 |
# File 'lib/msf/models/peptide.rb', line 34 def search_engine_rank self.SearchEngineRank end |
#sequence ⇒ Object
40 41 42 |
# File 'lib/msf/models/peptide.rb', line 40 def sequence self.Sequence end |
#spectrum_id ⇒ Object
22 23 24 |
# File 'lib/msf/models/peptide.rb', line 22 def spectrum_id self.SpectrumID end |
#theoretical_mass ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/msf/models/peptide.rb', line 52 def theoretical_mass mass = 0 charge = self.spectrum.spectrum_header.charge self.sequence.split(//).each do |aa| mass += AminoAcid.mass_for_one_letter_code(aa) end self.peptides_amino_acid_modifications.each do |modification| mass += modification.internal_modification.delta_mass end unless self.terminal_modification.nil? mass += self.terminal_modification.delta_mass end mass += 1.007825 + 15.994910 + 1.007825 mass = (mass + (charge * 1.007825)) / charge end |
#total_ions_count ⇒ Object
25 26 27 |
# File 'lib/msf/models/peptide.rb', line 25 def total_ions_count self.TotalIonsCount end |
#unique_peptide_sequence_id ⇒ Object
46 47 48 |
# File 'lib/msf/models/peptide.rb', line 46 def unique_peptide_sequence_id self.UniquePeptideSequenceID end |