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());
138 QStringList aa_string_list;
139 for(
auto code : code_list)
141 aa_string_list << decode(code);
143 return aa_string_list;
154 mass += m_aaCode.getMass((uint8_t)(code % m_base));
162std::vector<CodeToMass>
164 std::size_t size)
const
166 std::vector<CodeToMass> llc_list;
169 std::vector<uint8_t> model;
170 for(uint8_t p = 1; p <= size; p++)
174 for(uint8_t i = 1; i < m_base; i++)
179 llc_list.push_back(generateCodeMassFromModel(model));
183 recGenerateModel(llc_list, model, 1);
191std::vector<CodeToMass>
193 std::size_t size)
const
195 std::vector<CodeToMass> llc_list;
198 std::vector<uint8_t> model;
199 model.resize(size, 0);
201 for(uint8_t i = 1; i < m_base; i++)
204 recGenerateModel(llc_list, model, 1);
211 std::vector<uint8_t> &model,
212 std::size_t position)
const
214 if(position == model.size())
217 if(position == model.size() - 1)
219 uint8_t
max = model[position - 1];
220 for(uint8_t i = 1; i <=
max; i++)
223 glist.push_back(generateCodeMassFromModel(model));
228 uint8_t
max = model[position - 1];
229 for(uint8_t i = 1; i <=
max; i++)
232 recGenerateModel(glist, model, position + 1);
239 const std::vector<uint8_t> &model)
const
243 for(
auto aacode : model)
245 code_mass.
mass += m_aaCode.getMass(aacode);
247 code_mass.
code += (uint32_t)aacode * m_units[pos];
260 std::size_t code = 0;
261 for(std::size_t pos = 0; pos < size; pos++)
263 code += (std::size_t)(m_base - 1) * (std::size_t)m_units[pos];
270 const std::vector<uint8_t> &aa_ok)
const
275 if(std::find(aa_ok.begin(), aa_ok.end(), (uint8_t)(code % m_base)) ==
293 if(aa_ok == (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
code and decode amino acid string sequence to unique integer
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
bool uniqueCodeContainsAminoAcid(uint32_t code, uint8_t aa_ok, int times) const
tell if a unique code only contains one amino acid 1 or n times
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
tell if a code only contains a list of amino acid
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