1use std::collections::HashMap;
2
3pub fn amino_acids() -> HashMap<&'static str, &'static str> {
22 let mut map = HashMap::new();
23 map.insert("Lysine", "K");
24 map.insert("Alanine", "A");
25 map.insert("Glycine", "G");
26 map.insert("Valine", "V");
27 map.insert("Tyrosine", "Y");
28 map.insert("Arginine", "R");
29 map.insert("Glutamic Acid", "E");
30 map.insert("Phenylalanine", "F");
31 map.insert("Tryptophan", "W");
32 map.insert("Leucine", "L");
33 map.insert("Threonine", "T");
34 map.insert("Cysteine", "C");
35 map.insert("Serine", "S");
36 map.insert("Glutamine", "Q");
37 map.insert("Methionine", "M");
38 map.insert("Isoleucine", "I");
39 map.insert("Asparagine", "N");
40 map.insert("Proline", "P");
41 map.insert("Histidine", "H");
42 map.insert("Aspartic Acid", "D");
43 map.insert("Selenocysteine", "U");
44 map
45}
46
47
48pub fn amino_acid_masses() -> HashMap<&'static str, f64> {
67 let mut map = HashMap::new();
68 map.insert("A", 71.037114);
69 map.insert("R", 156.101111);
70 map.insert("N", 114.042927);
71 map.insert("D", 115.026943);
72 map.insert("C", 103.009185);
73 map.insert("E", 129.042593);
74 map.insert("Q", 128.058578);
75 map.insert("G", 57.021464);
76 map.insert("H", 137.058912);
77 map.insert("I", 113.084064);
78 map.insert("L", 113.084064);
79 map.insert("K", 128.094963);
80 map.insert("M", 131.040485);
81 map.insert("F", 147.068414);
82 map.insert("P", 97.052764);
83 map.insert("S", 87.032028);
84 map.insert("T", 101.047679);
85 map.insert("W", 186.079313);
86 map.insert("Y", 163.063329);
87 map.insert("V", 99.068414);
88 map.insert("U", 168.053);
89 map
90}
91
92pub fn amino_acid_composition() -> HashMap<char, HashMap<&'static str, i32>> {
112
113 let mut composition: HashMap<char, HashMap<&'static str, i32>> = HashMap::new();
114
115 composition.insert('G', HashMap::from([("C", 2), ("H", 3), ("N", 1), ("O", 1)])); composition.insert('A', HashMap::from([("C", 3), ("H", 5), ("N", 1), ("O", 1)])); composition.insert('S', HashMap::from([("C", 3), ("H", 5), ("N", 1), ("O", 2)])); composition.insert('P', HashMap::from([("C", 5), ("H", 7), ("N", 1), ("O", 1)])); composition.insert('V', HashMap::from([("C", 5), ("H", 9), ("N", 1), ("O", 1)])); composition.insert('T', HashMap::from([("C", 4), ("H", 7), ("N", 1), ("O", 2)])); composition.insert('C', HashMap::from([("C", 3), ("H", 5), ("N", 1), ("O", 1), ("S", 1)])); composition.insert('I', HashMap::from([("C", 6), ("H", 11), ("N", 1), ("O", 1)])); composition.insert('L', HashMap::from([("C", 6), ("H", 11), ("N", 1), ("O", 1)])); composition.insert('N', HashMap::from([("C", 4), ("H", 6), ("N", 2), ("O", 2)])); composition.insert('D', HashMap::from([("C", 4), ("H", 5), ("N", 1), ("O", 3)])); composition.insert('Q', HashMap::from([("C", 5), ("H", 8), ("N", 2), ("O", 2)])); composition.insert('K', HashMap::from([("C", 6), ("H", 12), ("N", 2), ("O", 1)])); composition.insert('E', HashMap::from([("C", 5), ("H", 7), ("N", 1), ("O", 3)])); composition.insert('M', HashMap::from([("C", 5), ("H", 9), ("N", 1), ("O", 1), ("S", 1)])); composition.insert('H', HashMap::from([("C", 6), ("H", 7), ("N", 3), ("O", 1)])); composition.insert('F', HashMap::from([("C", 9), ("H", 9), ("N", 1), ("O", 1)])); composition.insert('R', HashMap::from([("C", 6), ("H", 12), ("N", 4), ("O", 1)])); composition.insert('Y', HashMap::from([("C", 9), ("H", 9), ("N", 1), ("O", 2)])); composition.insert('W', HashMap::from([("C", 11), ("H", 10), ("N", 2), ("O", 1)])); composition.insert('U', HashMap::from([("C", 3), ("H", 5), ("N", 1), ("O", 1), ("Se", 1)])); composition
138}