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

xpip output almost done

parent 9393c31c
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,9 @@ const QVariant PeptideMatch::getParam(PeptideMatchParam param) const {
return QVariant();
}
}
const std::map<PeptideMatchParam, QVariant> & PeptideMatch::getParamList() const {
return _params;
}
std::size_t PeptideMatch::getHashPeptideMassSample() const {
return PeptideMatch::_hash_fn (QString("%1 %2").arg(_peptide_sp.get()->toAbsoluteString()).arg(_msrunid_sp->getXmlId()).toStdString());
......
......@@ -66,6 +66,8 @@ public :
/** \brief get specific parameter value
*/
virtual const QVariant getParam(PeptideMatchParam param) const;
const std::map<PeptideMatchParam, QVariant> & getParamList() const;
/** @brief set start position of this peptide inside the protein sequence
......
......@@ -233,14 +233,20 @@ void Xpip::writeProteinList() {
_output_stream->writeStartElement("protein");
_output_stream->writeAttribute("acc",p_protein->getAccession());
_output_stream->writeAttribute("description",p_protein->getDescription());
_output_stream->writeAttribute("is_decoy","false");
if (p_protein->isDecoy()) {
_output_stream->writeAttribute("is_decoy","true");
}
_output_stream->writeAttribute("is_contaminant","false");
else {
_output_stream->writeAttribute("is_decoy","false");
}
if (p_protein->isContaminant()) {
_output_stream->writeAttribute("is_contaminant","true");
}
else {
_output_stream->writeAttribute("is_contaminant","false");
}
_output_stream->writeStartElement("sequence");
_output_stream->writeCharacters(p_protein->getSequence());
......@@ -362,8 +368,54 @@ void Xpip::writeIdentificationGroup(const IdentificationGroup * p_identification
//std::vector<ProteinMatch *> & getProteinMatchList()
_output_stream->writeStartElement("protein_match");
_output_stream->writeAttribute("acc", p_protein_match->getProteinXtpSp().get()->getAccession());
if (p_protein_match->isChecked()) {
_output_stream->writeAttribute("checked","true");
}
else {
_output_stream->writeAttribute("checked","false");
}
for (const PeptideMatch * p_peptide_match : p_protein_match->getPeptideMatchList()) {
writePeptideMatch(p_peptide_match);
}
_output_stream->writeEndElement();// protein_match
}
_output_stream->writeEndElement(); //protein_match_list
qDebug() << "Xpip::writeIdentificationGroup end";
}
void Xpip::writePeptideMatch(const PeptideMatch * p_peptide_match) {
qDebug() << "Xpip::writePeptideMatch begin";
_output_stream->writeStartElement("peptide_match");
_output_stream->writeAttribute("source_id",p_peptide_match->getIdentificationDataSource()->getXmlId());
//_output_stream->writeAttribute("ms_id",p_peptide_match->getMsRunP()->getXmlId());
_output_stream->writeAttribute("peptide_id",_map_peptides.at( p_peptide_match->getPeptideXtpSp().get()));
_output_stream->writeAttribute("scan",QString("%1").arg(p_peptide_match->getScan()));
writeDoubleAttribute("rt",p_peptide_match->getRetentionTime());
writeDoubleAttribute("evalue",p_peptide_match->getEvalue());
writeDoubleAttribute("exp_mass",p_peptide_match->getExperimentalMass());
_output_stream->writeAttribute("start",QString("%1").arg(p_peptide_match->getStart()));
_output_stream->writeAttribute("charge",QString("%1").arg(p_peptide_match->getCharge()));
if (p_peptide_match->isChecked()) {
_output_stream->writeAttribute("checked","true");
}
else {
_output_stream->writeAttribute("checked","false");
}
const std::map<PeptideMatchParam, QVariant> & params = p_peptide_match->getParamList();
//if (params.size() > 0) {
// _output_stream->writeStartElement("stats");
for (const std::pair<PeptideMatchParam, QVariant> param_pair: params) {
_output_stream->writeStartElement("param");
_output_stream->writeAttribute("key",QString("%1").arg(static_cast<std::int8_t>(param_pair.first)));
_output_stream->writeAttribute("value",param_pair.second.toString());
_output_stream->writeEndElement();
}
// _output_stream->writeEndElement();
//}
_output_stream->writeEndElement(); //protein_match_list
qDebug() << "Xpip::writePeptideMatch end";
}
......@@ -59,6 +59,7 @@ private :
void writeLabelingMethod();
void writeIdentificationGroupList();
void writeIdentificationGroup(const IdentificationGroup * p_identification_group);
void writePeptideMatch(const PeptideMatch * p_peptide_match);
QString getPeptideId(std::size_t crc_peptide) const;
......
......@@ -53,8 +53,8 @@ enum class IdentificationEngine: std::int8_t {
/** \def PeptideMatchParam peptide match specific parameters
*
*/
enum class PeptideMatchParam {
tandem_hyperscore ///< X!Tandem hyperscore
enum class PeptideMatchParam: std::int8_t {
tandem_hyperscore=0 ///< X!Tandem hyperscore
};
/** \def IdentificationEngineParam identification engine parameters
......
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