33AaStringCodec::AaStringCodec(
const AaCode &aaCode) : m_aaCode(aaCode)
47 : m_aaCode(other.m_aaCode)
64 for(
auto &aa_char : aa_str)
66 code += m_aaCode.getAaCode(aa_char.toLatin1()) * m_units[pos];
75 std::vector<uint8_t> llc_vec;
77 for(
auto &aa_char : aa_str)
79 llc_vec.push_back(m_aaCode.getAaCode(aa_char.toLatin1()));
81 std::sort(llc_vec.begin(), llc_vec.end(), std::greater<uint8_t>());
86 for(
auto &aa_code : llc_vec)
88 code += (uint32_t)aa_code * m_units[pos];
96 std::size_t size)
const
98 std::vector<uint8_t> llc_vec;
100 for(std::size_t i = 0; i < size; i++)
102 llc_vec.push_back(*it_begin);
105 std::sort(llc_vec.begin(), llc_vec.end(), std::greater<uint8_t>());
110 for(
auto &aa_code : llc_vec)
112 code += (uint32_t)aa_code * m_units[pos];
126 aa_suite.append(m_aaCode.getAa((uint8_t)(code % m_base)).getLetter());
142 mass += m_aaCode.getMass((uint8_t)(code % m_base));
150std::vector<CodeToMass>
152 std::size_t size)
const
154 std::vector<CodeToMass> llc_list;
157 std::vector<uint8_t> model;
158 for(uint8_t p = 1; p <= size; p++)
162 for(uint8_t i = 1; i < m_base; i++)
167 llc_list.push_back(generateCodeMassFromModel(model));
171 recGenerateModel(llc_list, model, 1);
179std::vector<CodeToMass>
181 std::size_t size)
const
183 std::vector<CodeToMass> llc_list;
186 std::vector<uint8_t> model;
187 model.resize(size, 0);
189 for(uint8_t i = 1; i < m_base; i++)
192 recGenerateModel(llc_list, model, 1);
199 std::vector<uint8_t> &model,
200 std::size_t position)
const
202 if(position == model.size())
205 if(position == model.size() - 1)
207 uint8_t
max = model[position - 1];
208 for(uint8_t i = 1; i <=
max; i++)
211 glist.push_back(generateCodeMassFromModel(model));
216 uint8_t
max = model[position - 1];
217 for(uint8_t i = 1; i <=
max; i++)
220 recGenerateModel(glist, model, position + 1);
227 const std::vector<uint8_t> &model)
const
231 for(
auto aacode : model)
233 code_mass.
mass += m_aaCode.getMass(aacode);
235 code_mass.
code += (uint32_t)aacode * m_units[pos];
248 std::size_t code = 0;
249 for(std::size_t pos = 0; pos < size; pos++)
251 code += (std::size_t)(m_base - 1) * (std::size_t)m_units[pos];
258 const std::vector<uint8_t> &aa_ok)
const
263 if(std::find(aa_ok.begin(), aa_ok.end(), (uint8_t)(code % m_base)) ==
code and decodefrom amino acid string to integer
collection of integer code for each amino acid 0 => null 1 to 20 => amino acid sorted by there mass (...
std::size_t getSize() const
std::size_t getLimitMax(std::size_t size) const
get the maximum code number for a given peptide size
double getMass(uint32_t code) const
const AaCode & getAaCode() const
QString decode(uint32_t code) const
uint32_t codeLlc(const QString &aa_str) const
get the lowest common denominator integer from amino acide suite string
void recGenerateModel(std::vector< CodeToMass > &glist, std::vector< uint8_t > &model, std::size_t position) const
recursive method to generate models
std::vector< uint32_t > m_units
uint32_t code(const QString &aa_str) const
get integer from amino acide suite string
CodeToMass generateCodeMassFromModel(const std::vector< uint8_t > &model) const
AaStringCodec(const AaCode &aaCode)
std::vector< CodeToMass > generateLlcCodeListByMaxPeptideSize(std::size_t size) const
generates all possible combination of llc code mass llc : the lowest common code denominator for a gi...
bool codeOnlyContains(uint32_t code, const std::vector< uint8_t > &aa_ok) const
std::vector< CodeToMass > generateLlcCodeListUpToMaxPeptideSize(std::size_t size) const
generates all possible combination of llc code mass llc : the lowest common code denominator for a gi...
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
@ max
maximum of intensities