Commit a7db2457 authored by Olivier Langella's avatar Olivier Langella
Browse files

testing labelled peptides

parent d8e02443
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<masschroq>
<rawdata>
<rawdata><!-- time_values_dir="directory" to read retention time corrections-->
<data_file format="mzxml" id="samp0" path="BSA_LTQ_1.mzXML" type="centroid"/>
<data_file format="mzxml" id="samp1" path="BSA_LTQ_2.mzXML" type="centroid"/>
</rawdata>
......@@ -240,7 +240,7 @@
<alignments>
<alignment_methods>
<alignment_method id="ms2_1">
<ms2>
<ms2><!-- write_time_values_output_dir="directory" to write retention time corrections -->
<ms2_tendency_halfwindow>5</ms2_tendency_halfwindow>
<ms2_smoothing_halfwindow>7</ms2_smoothing_halfwindow>
<ms1_smoothing_halfwindow>0</ms1_smoothing_halfwindow>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<masschroq>
<rawdata>
<data_file format="mzxml" id="samp0" path="BSA_Orbitrap.mzXML" type="centroid"/>
</rawdata>
<groups>
<group data_ids="samp0" id="G1"/>
</groups>
<peptide_files_list>
<peptide_file data="samp0" path="peptides_BSA_Orbitrap.txt"/>
</peptide_files_list>
<quantification_methods>
<quantification_method id="quant1">
<xic_extraction xic_type="max">
<ppm_range max="10" min="10"/>
</xic_extraction>
<xic_filters>
<anti_spike half="5"/>
</xic_filters>
<peak_detection>
<detection_zivy>
<mean_filter_half_edge>1</mean_filter_half_edge>
<minmax_half_edge>3</minmax_half_edge>
<maxmin_half_edge>2</maxmin_half_edge>
<detection_threshold_on_max>5000</detection_threshold_on_max>
<detection_threshold_on_min>3000</detection_threshold_on_min>
</detection_zivy>
</peak_detection>
</quantification_method>
</quantification_methods>
<quantification>
<quantification_results>
<quantification_result format="tsv" output_file="results/Result_orbitrap_ni"/>
<quantification_result format="ods" output_file="results/Result_orbitrap_ni"/>
<compar_result format="ods" output_file="results/Result_orbitrap_compar_ni"/>
</quantification_results>
<quantify id="q1" quantification_method_id="quant1" withingroup="G1">
<peptides_in_peptide_list mode="post_matching" ni_min_abundance="0.8"/>
</quantify>
</quantification>
</masschroq>
......@@ -1844,7 +1844,7 @@ created in this directory. The traces file names contain information
about the group, the MS run, the peptide id, the mz, and the rt of the
traced item.
A trace file is always and by default in \ttt{tsv} format (the
A trace file is always and by default in \ttt{ods} format (the
\ttt{format} attribute is optional). It contains from left to right order:
\bi
\item a header giving the precise mz, rt and peptide id information.
......
......@@ -68,7 +68,7 @@ Peptide::setPappsoPeptideSp(const pappso::PeptideSp & peptide) {
}
void Peptide::setPeptideRtSp(PeptideRtSp peptide_rt_sp) {
_peptide_rt_sp = peptide_rt_sp;
_peptide_rt_sp = peptide_rt_sp;
}
void
......@@ -298,3 +298,25 @@ Peptide::getCharges(const msRunHashGroup & group) const {
delete (observed_in_group);
return s_charges;
}
const std::vector<PeptideObservedIn *> & Peptide::getObservedInList() const {
return _observed_in_list;
}
const IsotopeLabel * Peptide::getIsotopeLabel() const {
return NULL;
}
const std::vector<const Protein *> & Peptide::getProteinList() const {
return (_v_p_protein);
}
const pappso::PeptideSp & Peptide::getPappsoPeptideSp() const {
return (_peptide_sp);
}
const PeptideRtSp & Peptide::getPeptideRtSp() const {
return (_peptide_rt_sp);
}
......@@ -67,23 +67,15 @@ public:
return _peptide_xml_id;
}
virtual const IsotopeLabel * getIsotopeLabel() const {
return NULL;
}
virtual const IsotopeLabel * getIsotopeLabel() const ;
virtual const std::vector<const Protein *> & getProteinList() const {
return (_v_p_protein);
}
virtual const std::vector<const Protein *> & getProteinList() const;
virtual void printInfos(QTextStream & out) const;
const pappso::PeptideSp & getPappsoPeptideSp() const {
return (_peptide_sp);
}
virtual const pappso::PeptideSp & getPappsoPeptideSp() const;
const PeptideRtSp & getPeptideRtSp() const {
return (_peptide_rt_sp);
}
virtual const PeptideRtSp & getPeptideRtSp() const ;
virtual const QString & getMods() const;
......@@ -161,8 +153,8 @@ public:
*/
virtual std::vector< PeptideObservedIn *> *
getObservedInGroup(const msRunHashGroup & group) const;
virtual const std::vector<PeptideObservedIn *> & getObservedInList() const {return _observed_in_list;};
virtual const std::vector<PeptideObservedIn *> & getObservedInList() const ;
/**
* \fn getCharges(const msRunHashGroup & group)
......@@ -172,7 +164,7 @@ public:
*/
virtual std::set<unsigned int> *
getCharges(const msRunHashGroup & group) const;
const QString getSequence() const;
......@@ -181,7 +173,7 @@ protected:
pappso::PeptideSp _peptide_sp;
QString _mods;
PeptideRtSp _peptide_rt_sp = nullptr;
private:
......@@ -191,7 +183,7 @@ private:
std::vector<const Protein *> _v_p_protein;
std::vector<PeptideObservedIn *> _observed_in_list;
static pappso::PrecisionP _set_mh_precision;
};
......
......@@ -13,9 +13,10 @@ PeptideIsotope::PeptideIsotope(const Peptide * p_peptide_original,
Peptide(p_peptide_original->getXmlId()), _p_peptide_original(
p_peptide_original), _p_label(p_label) {
_peptide_sp = p_label->getPeptideSpTagged(p_peptide_original->getPappsoPeptideSp());
_peptide_rt_sp = p_peptide_original->getPeptideRtSp();
/*
_peptide_sp = p_label->getPeptideSpTagged(p_peptide_original->getPappsoPeptideSp());
_peptide_rt_sp = p_peptide_original->getPeptideRtSp();
/*
pappso::Peptide pappso_peptide(*p_peptide_original->getPappsoPeptideSp().get());
pappso::AaModificationP modification = pappso::AaModification::getInstanceCustomizedMod(p_label->getMassDelta(p_peptide_original->getPappsoPeptideSp().get()->getSequence()));
......@@ -86,3 +87,18 @@ void PeptideIsotope::printInfos(QTextStream & out) const {
out << "_sequence = " << _peptide_sp.get()->getSequence() << endl;
out << "_mass = " << _peptide_sp.get()->getMass() << endl;
}
const std::vector<PeptideObservedIn *> & PeptideIsotope::getObservedInList() const {
return _p_peptide_original->getObservedInList();
}
const pappso::PeptideSp & PeptideIsotope::getPappsoPeptideSp() const {
return _peptide_sp;
}
const PeptideRtSp & PeptideIsotope::getPeptideRtSp() const {
return _p_peptide_original->getPeptideRtSp();
}
......@@ -36,45 +36,52 @@
class PeptideIsotope : public Peptide {
public:
PeptideIsotope(const Peptide * p_peptide_original,
const IsotopeLabel * p_label);
virtual ~PeptideIsotope();
virtual const IsotopeLabel * getIsotopeLabel() const;
virtual void observed_in(const Msrun * p_msrun,
const int scan_num,
unsigned int z);
virtual bool isObservedIn(const msRunHashGroup & group) const;
virtual bool isObservedIn(const QString & msRunID) const;
virtual const QString & getMods() const;
virtual std::vector<PeptideObservedIn *> *
public:
PeptideIsotope(const Peptide * p_peptide_original,
const IsotopeLabel * p_label);
virtual ~PeptideIsotope();
virtual const IsotopeLabel * getIsotopeLabel() const override;
virtual void observed_in(const Msrun * p_msrun,
const int scan_num,
unsigned int z);
virtual bool isObservedIn(const msRunHashGroup & group) const;
virtual bool isObservedIn(const QString & msRunID) const;
virtual const QString & getMods() const;
virtual std::vector<PeptideObservedIn *> *
getObservedInGroup(const msRunHashGroup & group) const;
virtual std::set<unsigned int> *
virtual std::set<unsigned int> *
getCharges(const msRunHashGroup & group) const;
virtual mcq_double getObservedBestRtForMsRun(const Msrun * p_msrun,
const msRunHashGroup & group) const;
virtual mcq_double getMeanBestRt(const msRunHashGroup & group) const;
virtual const std::vector<const Protein *> & getProteinList() const;
virtual void printInfos(QTextStream & out) const override;
private:
const Peptide * _p_peptide_original;
const IsotopeLabel * _p_label;
virtual mcq_double getObservedBestRtForMsRun(const Msrun * p_msrun,
const msRunHashGroup & group) const;
virtual mcq_double getMeanBestRt(const msRunHashGroup & group) const;
virtual const std::vector<const Protein *> & getProteinList() const override;
virtual void printInfos(QTextStream & out) const override;
virtual const std::vector<PeptideObservedIn *> & getObservedInList() const override;
virtual const pappso::PeptideSp & getPappsoPeptideSp() const override;
virtual const PeptideRtSp & getPeptideRtSp() const override;
private:
const Peptide * _p_peptide_original;
const IsotopeLabel * _p_label;
};
#endif /* PEPTIDE_ISOTOPE_H_ */
......@@ -108,6 +108,7 @@ void PeptideRt::computeRetentionTimeReferences(McqMatchingMode matching_mode)
//compute peptide retention time references :
if ((matching_mode == McqMatchingMode::mean) || ( matching_mode == McqMatchingMode::real_or_mean) || ( matching_mode == McqMatchingMode::post_matching)) {
//sort observations by ms runs, with the most intense last
qDebug() << "PeptideRt::computeRetentionTimeReferences sort " << _msms_observation_list.size();
std::sort(_msms_observation_list.begin(), _msms_observation_list.end(), [](const MsMsObservation & a, const MsMsObservation & b) {
if (a._p_msrun == b._p_msrun) {
return (a.intensity < b.intensity);
......@@ -119,8 +120,7 @@ void PeptideRt::computeRetentionTimeReferences(McqMatchingMode matching_mode)
_accumulator.clear();
qDebug() << "PeptideRt::computeRetentionTimeReferences best observation mean ";
//gest best observation for each mz in each msrun, compute the mean of best observations inside an msrun
//MsMsObservation first(nullptr);
std::vector<MsMsObservation>::iterator it_last = _msms_observation_list.begin();
......@@ -160,6 +160,8 @@ void PeptideRt::computeRetentionTimeReferences(McqMatchingMode matching_mode)
}
}
else {
qDebug() << "PeptideRt::computeRetentionTimeReferences accumulate" << _accumulator.size();
_aligned_rt = std::accumulate(_accumulator.begin(),_accumulator.end(),0.0) / _accumulator.size();
}
qDebug() << "PeptideRt::computeRetentionTimeReferences end " << _aligned_rt<< " " << _accumulator.size() << " " << std::accumulate(_accumulator.begin(),_accumulator.end(),0.0);
......
......@@ -98,27 +98,31 @@ void Quantificator::computeRetentionTimeReferences() {
for (const Peptide * p_peptide:*_p_peptide_list) {
PeptideRt * _p_peptide_rt = p_peptide->getPeptideRtSp().get();
_peptide_rt_list.push_back(_p_peptide_rt);
// auto it_new = _map_peptides_2_retention_times.insert(std::pair<const Peptide *, std::map< const Msrun * , std::vector< MsMsRtIntensity > > >(p_peptide,std::map< const Msrun * , std::vector< MsMsRtIntensity > >())).first;
//auto it_charge_new = map_peptides_charge_set.insert(std::pair<const Peptide *, std::set<unsigned int>>(p_peptide, std::set<unsigned int>())).first;
for (auto & pair : *_group_to_quantify) {
const Msrun * p_msrun = pair.second;
//auto it_rt_list = it_new->second.insert(std::pair<const Msrun * , std::vector< MsMsRtIntensity >>
// (p_msrun, std::vector< MsMsRtIntensity >())).first;
for (auto && obs_in:p_peptide->getObservedInList()) {
if(obs_in->getPmsRun() == p_msrun) {
MsMsObservation observation(p_msrun);
observation.intensity = obs_in->getIntensity();
observation.rt = obs_in->getRt();
observation.z = obs_in->getZ();
observation.mz = p_peptide->getMz(observation.z);
//it_rt_list->second.push_back(observation);
//it_charge_new->second.insert(observation.z);
_p_peptide_rt->addMsMsRtIntensity(observation);
auto find_it = std::find(_peptide_rt_list.begin(),_peptide_rt_list.end(), _p_peptide_rt);
if (find_it == _peptide_rt_list.end()) {
_peptide_rt_list.push_back(_p_peptide_rt);
// auto it_new = _map_peptides_2_retention_times.insert(std::pair<const Peptide *, std::map< const Msrun * , std::vector< MsMsRtIntensity > > >(p_peptide,std::map< const Msrun * , std::vector< MsMsRtIntensity > >())).first;
//auto it_charge_new = map_peptides_charge_set.insert(std::pair<const Peptide *, std::set<unsigned int>>(p_peptide, std::set<unsigned int>())).first;
for (auto & pair : *_group_to_quantify) {
const Msrun * p_msrun = pair.second;
//auto it_rt_list = it_new->second.insert(std::pair<const Msrun * , std::vector< MsMsRtIntensity >>
// (p_msrun, std::vector< MsMsRtIntensity >())).first;
//qDebug() << "Quantificator::computeRetentionTimeReferences getObservedInList size" << p_peptide->getObservedInList().size();
for (auto && obs_in:p_peptide->getObservedInList()) {
if(obs_in->getPmsRun() == p_msrun) {
MsMsObservation observation(p_msrun);
observation.intensity = obs_in->getIntensity();
observation.rt = obs_in->getRt();
observation.z = obs_in->getZ();
observation.mz = p_peptide->getMz(observation.z);
//it_rt_list->second.push_back(observation);
//it_charge_new->second.insert(observation.z);
_p_peptide_rt->addMsMsRtIntensity(observation);
}
}
}
}
......@@ -367,16 +371,16 @@ void Quantificator::quantify() {
if (_matching_mode == McqMatchingMode::post_matching) {
//compute new rt references
mcqout() << "post matching : computing retention time references " << endl;
mcqout() << "post matching : computing retention time references " << endl;
QFuture<void> res = QtConcurrent::map(_peptide_rt_list.begin(), _peptide_rt_list.end(), [] (PeptideRt * p_peptide_rt) {
p_peptide_rt->computePostMatchingTimeReferences();
});
res.waitForFinished();
//rematch peaks stored in quanti items
mcqout() << "post matching : trying to match peaks using new retention time references " << endl;
MonitorSpeedInterface * p_monitor_speed = _p_monitor_speed;
res = QtConcurrent::map(_quanti_items->begin(), _quanti_items->end(), [p_monitor_speed] (QuantiItemBase * p_quanti_item) {
mcqout() << "post matching : trying to match peaks using new retention time references " << endl;
MonitorSpeedInterface * p_monitor_speed = _p_monitor_speed;
res = QtConcurrent::map(_quanti_items->begin(), _quanti_items->end(), [p_monitor_speed] (QuantiItemBase * p_quanti_item) {
p_quanti_item->doPostMatching(*p_monitor_speed);
});
res.waitForFinished();
......
Supports Markdown
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