Commit 84e6eebf authored by Olivier Langella's avatar Olivier Langella
Browse files

fix problem getting peptide traces on labeled peptides

parent ca63d566
......@@ -166,6 +166,12 @@ public:
getCharges(const msRunHashGroup & group) const;
const QString getSequence() const;
virtual const Peptide * getOriginalPeptidePointer() const {
return this;
};
protected:
......
......@@ -76,6 +76,10 @@ public:
virtual const PeptideRtSp & getPeptideRtSp() const override;
virtual const Peptide * getOriginalPeptidePointer() const {
return _p_peptide_original;
};
private:
const Peptide * _p_peptide_original;
......
......@@ -156,11 +156,19 @@ CalcWriterInterface * QuantiItemPeptide::newCalcWriterInterface(const Quantifica
QDir trace_dir(QString("%1/%2/%3").arg(quantificator->getTracesDirectory().absolutePath()).arg(this->getPeptide()->getXmlId()).arg(p_msrun->getXmlId()));
trace_dir.mkpath(trace_dir.absolutePath());
CalcWriterInterface * _p_writer=nullptr;
const IsotopeLabel * p_label = this->getPeptide()->getIsotopeLabel();
QString begin_path;
if (p_label == nullptr) {
begin_path = QString("%1/%2_%3-%4-z%5").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(this->_z);
}
else {
begin_path = QString("%1/%2_%3-%4-%5-z%6").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(p_label->getXmlId()).arg(this->_z);
}
if (quantificator->getTracesFormat() == McqTsvFormat::tsv) {
_p_writer = new TsvDirectoryWriter(QString("%1/%2_%3-%4-z%5.d").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(this->_z));
_p_writer = new TsvDirectoryWriter(begin_path.append(".d"));
}
else {
_p_writer = new OdsDocWriter(QString("%1/%2_%3-%4-z%5.ods").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(this->_z));
_p_writer = new OdsDocWriter(begin_path.append(".ods"));
}
return _p_writer;
......
......@@ -120,11 +120,20 @@ CalcWriterInterface * QuantiItemPeptideNaturalIsotope::newCalcWriterInterface(co
QDir trace_dir(QString("%1/%2/%3").arg(quantificator->getTracesDirectory().absolutePath()).arg(this->getPeptide()->getXmlId()).arg(p_msrun->getXmlId()));
trace_dir.mkpath(trace_dir.absolutePath());
CalcWriterInterface * _p_writer=nullptr;
const IsotopeLabel * p_label = this->getPeptide()->getIsotopeLabel();
QString begin_path;
if (p_label == nullptr) {
begin_path = QString("%1/%2_%3-%4-z%5-%6-%7").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(this->_z).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeNumber()).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeRank());
}
else {
begin_path = QString("%1/%2_%3-%4-%5-z%6-%7-%8").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(p_label->getXmlId()).arg(this->_z).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeNumber()).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeRank());
}
if (quantificator->getTracesFormat() == McqTsvFormat::tsv) {
_p_writer = new TsvDirectoryWriter(QString("%1/%2_%3-%4-z%5-%6-%7.d").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(this->_z).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeNumber()).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeRank()));
_p_writer = new TsvDirectoryWriter(begin_path.append(".d"));
}
else {
_p_writer = new OdsDocWriter(QString("%1/%2_%3-%4-z%5-%6-%7.ods").arg(trace_dir.absolutePath()).arg(prefix).arg(quantificator->getXmlId()).arg(this->getPeptide()->getXmlId()).arg(this->_z).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeNumber()).arg(this->getPeptideNaturalIsotopeAverageSp()->getIsotopeRank()));
_p_writer = new OdsDocWriter(begin_path.append(".ods"));
}
return _p_writer;
......
......@@ -162,7 +162,8 @@ void Quantificator::add_peptide_quanti_items(
++itpep, debug_i++) {
mcqout() << "Quantificator::add_peptide_quanti_items for " << debug_i << " " << isotope_peptides.size() << endl;
bool trace_peptide = false;
if (std::find(trace_peptide_list.begin(), trace_peptide_list.end(), *itpep) != trace_peptide_list.end()) {
const Peptide * original_peptide_p = (*itpep)->getOriginalPeptidePointer();
if (std::find(trace_peptide_list.begin(), trace_peptide_list.end(), original_peptide_p) != trace_peptide_list.end()) {
trace_peptide = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment