Class: AminoAcid
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AminoAcid
- Defined in:
- lib/msf/models/amino_acid.rb
Overview
ActiveRecord model of MSF AminoAcid
Example:
AminoAcid.find(1)
AminoAcid.first.monoisotopic_mass
AminoAcid.first.amino_acid_modifications.first.modification_name
Class Method Summary collapse
Instance Method Summary collapse
- #amino_acid_id ⇒ Object
- #amino_acid_name ⇒ Object
- #average_mass ⇒ Object
- #monoisotopic_mass ⇒ Object
- #one_letter_code ⇒ Object
- #sum_formula ⇒ Object
- #three_letter_code ⇒ Object
Class Method Details
.mass_for_one_letter_code(aa) ⇒ Object
16 17 18 |
# File 'lib/msf/models/amino_acid.rb', line 16 def self.mass_for_one_letter_code(aa) self.masses[aa] end |
.masses ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/msf/models/amino_acid.rb', line 9 def self.masses if @masses.nil? @masses = {} AminoAcid.select("OneLetterCode,MonoisotopicMass").where("OneLetterCode != ' '").map {|aa| @masses[aa.one_letter_code] = aa.monoisotopic_mass} end @masses end |
.primary_key ⇒ Object
22 23 24 |
# File 'lib/msf/models/amino_acid.rb', line 22 def self.primary_key :AminoAcidID end |
.table_name ⇒ Object
19 20 21 |
# File 'lib/msf/models/amino_acid.rb', line 19 def self.table_name :AminoAcids end |
Instance Method Details
#amino_acid_id ⇒ Object
25 26 27 |
# File 'lib/msf/models/amino_acid.rb', line 25 def amino_acid_id self.AminoAcidID end |
#amino_acid_name ⇒ Object
28 29 30 |
# File 'lib/msf/models/amino_acid.rb', line 28 def amino_acid_name self.AminoAcidName end |
#average_mass ⇒ Object
40 41 42 |
# File 'lib/msf/models/amino_acid.rb', line 40 def average_mass self.AverageMass end |
#monoisotopic_mass ⇒ Object
37 38 39 |
# File 'lib/msf/models/amino_acid.rb', line 37 def monoisotopic_mass self.MonoisotopicMass end |
#one_letter_code ⇒ Object
31 32 33 |
# File 'lib/msf/models/amino_acid.rb', line 31 def one_letter_code self.OneLetterCode end |
#sum_formula ⇒ Object
43 44 45 |
# File 'lib/msf/models/amino_acid.rb', line 43 def sum_formula self.SumFormula end |
#three_letter_code ⇒ Object
34 35 36 |
# File 'lib/msf/models/amino_acid.rb', line 34 def three_letter_code self.ThreeLetterCode end |