Skip to content
Snippets Groups Projects
Commit e9b7ae2b authored by Olivier Langella's avatar Olivier Langella
Browse files

solved modification string

parent 91793213
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
#include "peptidextp.h"
#include <QStringList>
PeptideXtp::PeptideXtp(const QString & pepstr):pappso::Peptide(pepstr)
{
......@@ -39,11 +40,35 @@ PeptideXtp::~PeptideXtp()
}
const QString PeptideXtp::getModifString() const {
QStringList modif_list;
unsigned int i=1;
for (const pappso::Aa & amino_acid:_aa_vec) {
std::list<pappso::AaModificationP> aa_modif_list = amino_acid.getModificationList();
QStringList aamodif;
for (auto && aa_modif : aa_modif_list) {
if (!aa_modif->isInternal()) {
aamodif << QString::number(aa_modif->getMass(), 'f', 2);
}
}
QString mod_str(aamodif.join("|"));
if (!mod_str.isEmpty()) {
modif_list << QString("%1%2:%3").arg(i).arg(amino_acid.getLetter()).arg(mod_str);
}
i++;
}
//return QString ("%1 %2").arg(modif_list.join(" ")).arg(this->toAbsoluteString());
return modif_list.join(" ");
}
PeptideXtpSp PeptideXtp::makePeptideXtpSp() const {
return std::make_shared<PeptideXtp>(*this);
}
pappso::mz PeptideXtp::getGroupingMass() const {
return getMass();
if (_sp_native_peptide.get() == nullptr) {
return getMass();
}
return _sp_native_peptide.get()->getMass();
}
......@@ -45,6 +45,16 @@ public:
* peptide with taget modification is a light, inter or heavy version of the same peptide
*/
pappso::mz getGroupingMass() const;
/** \brief human readable string that contains modifications
* */
const QString getModifString() const;
private:
/** \brief if the peptide is tagged, this is the native peptide without tags
*/
pappso::PeptideSp _sp_native_peptide = nullptr;
};
......
......@@ -98,7 +98,7 @@ int PeptideTableModel::rowCount(const QModelIndex &parent ) const {
return 0;
}
int PeptideTableModel::columnCount(const QModelIndex &parent ) const {
return 7;
return 8;
}
QVariant PeptideTableModel::headerData(int section, Qt::Orientation orientation, int role) const
{
......@@ -121,6 +121,8 @@ QVariant PeptideTableModel::headerData(int section, Qt::Orientation orientation,
return QString("charge");
case 6:
return QString("sequence");
case 7:
return QString("modifs");
}
}
}
......@@ -179,6 +181,9 @@ QVariant PeptideTableModel::data(const QModelIndex &index, int role ) const {
if (col ==6) {
return _p_protein_match->getPeptideMatchList().at(row)->getPeptideXtpSp().get()->getSequence();
}
if (col ==7) {
return _p_protein_match->getPeptideMatchList().at(row)->getPeptideXtpSp().get()->getModifString();
}
}
return QString("Row%1, Column%2")
.arg(index.row() + 1)
......
......@@ -270,8 +270,8 @@ bool XpipSaxHandler::startElement_modif(QXmlAttributes attributes) {
//<modifs><modif aa="M" modvalue="15.99491" posi="17" posi_in_prot="49"/>
qDebug() << "startElement_modif ";
pappso::AaModificationP modif = _map_massstr_aamod[attributes.value("modvalue").simplified()];
unsigned int position = attributes.value("modvalue").simplified().toUInt();
_current_peptide_sp.get()->addAaModification(modif, position);
unsigned int position = attributes.value("posi").simplified().toUInt();
_current_peptide_sp.get()->addAaModification(modif, position-1);
qDebug() << "startElement_modif end" ;
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment