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

WIP: mcqprm

parent b3562c22
No related branches found
No related tags found
No related merge requests found
...@@ -72,76 +72,79 @@ void MassChroqPrm::write(ProjectSp sp_project) { ...@@ -72,76 +72,79 @@ void MassChroqPrm::write(ProjectSp sp_project) {
//<masschroq> //<masschroq>
_output_stream->writeStartElement("masschroqprm"); _output_stream->writeStartElement("masschroqprm");
/*
*
<parameters>
<parentIonMassTolerance>
<daltonPrecision value="1.5"/>
</parentIonMassTolerance>
<fragmentIonMassTolerance>
<daltonPrecision value="0.02"/>
</fragmentIonMassTolerance>
</parameters>
*/
_output_stream->writeStartElement("parameters");
_output_stream->writeStartElement("parentIonMassTolerance");
_output_stream->writeComment("choose dalton or ppm mass precision to select parent ions based on the precursor mass of each MS/MS spectrum");
_output_stream->writeStartElement("ppmPrecision");
_output_stream->writeAttribute("value", "10");
_output_stream->writeEndElement();
_output_stream->writeEndElement();
_output_stream->writeStartElement("fragmentIonMassTolerance");
_output_stream->writeComment("choose dalton or ppm mass precision to MS/MS fragment ion observed mass with theoretical mass");
_output_stream->writeStartElement("daltonPrecision");
_output_stream->writeAttribute("value", "0.02");
_output_stream->writeEndElement();
_output_stream->writeEndElement();
_output_stream->writeEndElement();
writePeptides();
} }
void MassChroqPrm::writePeptides(Identification ident) { void MassChroqPrm::writePeptides() {
/* /*
* *
* *
* <peptide seq="TCVADESHAGCEK" id="p1"> <psimod at="2" * <peptide seq="TCVADESHAGCEK" id="p1"> <psimod at="2"
* acc="MOD:00397"/> <psimod at="11" acc="MOD:00397"/> </peptide> * acc="MOD:00397"/> <psimod at="11" acc="MOD:00397"/> </peptide>
*/ */
try { try {
/*
* _output_stream->writeStartElement("peptideList");
<parameters>
<parentIonMassTolerance> for (IdentificationGroup * p_ident_group : _sp_project.get()->getIdentificationGroupList()) {
<daltonPrecision value="1.5"/> for () {
</parentIonMassTolerance> PeptideMassSet pepMassSet = new PeptideMassSet();
<fragmentIonMassTolerance>
<daltonPrecision value="0.02"/> logger.debug("pepMassSet size : " + pepMassSet.size());
</fragmentIonMassTolerance>
</parameters> logger.debug("pepMassSet numbering");
*/ pepMassSet.numberingGetPepMass2PeptideList(group);
_output_stream->writeStartElement("parameters");
_output_stream->writeStartElement("parentIonMassTolerance"); // iterated current pepid to write buffer peptide element
_output_stream->writeComment("choose dalton or ppm mass precision to select parent ions based on the precursor mass of each MS/MS spectrum"); for (PeptideMass pepMass : pepMassSet) {
_output_stream->writeStartElement("ppmPrecision"); _output_stream->writeStartElement("peptide");
_output_stream->writeAttribute("value", "10"); _output_stream->writeAttribute("id",
_output_stream->writeEndElement(); Utils.getPappsoPeptideMassId(group, pepMass));
_output_stream->writeEndElement(); Peptide bestPeptide = pepMass.getBestEvaluePeptide();
_output_stream->writeStartElement("fragmentIonMassTolerance"); _output_stream->writeAttribute("seq", bestPeptide.getSequence());
_output_stream->writeComment("choose dalton or ppm mass precision to MS/MS fragment ion observed mass with theoretical mass");
_output_stream->writeStartElement("daltonPrecision"); ArrayList<Modifs> arrModif = bestPeptide.get_Modifs();
_output_stream->writeAttribute("value", "0.02"); for (Modifs modif : arrModif) {
_output_stream->writeEndElement(); _output_stream->writeStartElement("psimod");
_output_stream->writeEndElement(); _output_stream->writeAttribute("at", "" + modif.get_posi());
_output_stream->writeEndElement();
_output_stream->writeAttribute("acc", ""
_output_stream->writeStartElement("peptideList"); + modif.getPsiMod().getAccession());
_output_stream->writeEndElement();
for (Group group : ident.getGrouping().getGroupList()) { }
PeptideMassSet pepMassSet = new PeptideMassSet(); _output_stream->writeEndElement();
}
logger.debug("pepMassSet size : " + pepMassSet.size());
}
logger.debug("pepMassSet numbering"); _output_stream->writeEndElement();
pepMassSet.numberingGetPepMass2PeptideList(group); }
catch (pappso::PappsoException &error)
// iterated current pepid to write buffer peptide element
for (PeptideMass pepMass : pepMassSet) {
_output_stream->writeStartElement("peptide");
_output_stream->writeAttribute("id",
Utils.getPappsoPeptideMassId(group, pepMass));
Peptide bestPeptide = pepMass.getBestEvaluePeptide();
_output_stream->writeAttribute("seq", bestPeptide.getSequence());
ArrayList<Modifs> arrModif = bestPeptide.get_Modifs();
for (Modifs modif : arrModif) {
_output_stream->writeStartElement("psimod");
_output_stream->writeAttribute("at", "" + modif.get_posi());
_output_stream->writeAttribute("acc", ""
+ modif.getPsiMod().getAccession());
_output_stream->writeEndElement();
}
_output_stream->writeEndElement();
}
}
_output_stream->writeEndElement();
}
catch (pappso::PappsoException &error)
{ {
throw pappso::PappsoException(QObject::tr("Error in MassChroqPrm::writePeptides :\n%1").arg(error.qwhat())); throw pappso::PappsoException(QObject::tr("Error in MassChroqPrm::writePeptides :\n%1").arg(error.qwhat()));
} }
...@@ -149,6 +152,6 @@ void MassChroqPrm::writePeptides(Identification ident) { ...@@ -149,6 +152,6 @@ void MassChroqPrm::writePeptides(Identification ident) {
{ {
throw pappso::PappsoException(QObject::tr("Error in MassChroqPrm::writePeptides stdex :\n%1").arg(error.what())); throw pappso::PappsoException(QObject::tr("Error in MassChroqPrm::writePeptides stdex :\n%1").arg(error.what()));
} }
} }
} }
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