Commit 963e1067 authored by Olivier Langella's avatar Olivier Langella
Browse files

building API to trace peptides

parent d872fd9a
......@@ -2,7 +2,7 @@ Source: masschroq
Section: science
Priority: optional
Maintainer: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Uploaders: Edlira Nano <edlira.nano@moulon.inra.fr>, Olivier Langella <olivier.langella@moulon.inra.fr>
Uploaders: Olivier Langella <olivier.langella@moulon.inra.fr>
DM-Upload-Allowed: yes
Standards-Version: 3.9.1.0
Build-Depends: debhelper (>= 5), cmake (>= 2.6), libx11-dev, libc6-dev, libqt4-dev (>= 4.6.3), libqwt5-qt4-dev (>=5.2.0), texlive-latex-extra, texlive-latex-recommended, texlive-fonts-recommended, texlive-science, hevea, inkscape, doxygen
......
......@@ -718,10 +718,9 @@ MassChroq::setResults(MonitorSpeedInterface * p_results)
_p_quantif_results = p_results;
}
void
MassChroq::debriefing()
{
qDebug() << "MassChroq::debriefing begin " ;
_p_quantif_results->debriefing();
qDebug() << "MassChroq::debriefing end " ;
void MassChroq::setTracesDirectory(QDir QDir, McqTsvFormat tsv_format) {
}
void MassChroq::addPeptideTrace(const Peptide* peptide) {
}
......@@ -48,142 +48,142 @@
* else
* This class launches the parsing of the XML input file and keeps track of
all of the elements parsed : msruns, groups, peptides, and of all of the
all of the elements parsed : msruns, groups, peptides, and of all of the
parameters on them : alignment methods, quantification methods.
*/
class MassChroq {
public:
/// Temporary working directory static variable
static QDir tmp_dir;
/// set the temporary working directory
static void setTmpDir(QString tmpDirName);
/// get the temporary working directory's absolute path name
static const QString getTmpDirName();
/// masschroq's beginning of execution date and time static variable
static QDateTime begin_date_time;
/// set the masschroq's beginning date and time static variable
static void setBeginDateTime(const QDateTime & dt_begin);
static QDateTime getBeginDateTime();
MassChroq();
virtual ~MassChroq();
/// set the input XML filename
void setXmlFilename(QString &);
const QString getXmlFilename() {
return _param_file_info.filePath();
};
/// Temporary working directory static variable
static QDir tmp_dir;
/// set the temporary working directory
static void setTmpDir(QString tmpDirName);
/// get the temporary working directory's absolute path name
static const QString getTmpDirName();
/// masschroq's beginning of execution date and time static variable
static QDateTime begin_date_time;
/// set the masschroq's beginning date and time static variable
static void setBeginDateTime(const QDateTime & dt_begin);
static QDateTime getBeginDateTime();
MassChroq();
virtual ~MassChroq();
/// set the input XML filename
void setXmlFilename(QString &);
const QString getXmlFilename() {
return _param_file_info.filePath();
};
/// validation of the XSD schema and of the XML input file against it
void validateXmlFile();
/// parse the XML input file with Dom to look for peptide_files_list tag
void runDomParser();
/// parsing of the XML input file
void runXmlFile();
void setResults(MonitorSpeedInterface * p_results);
void setPeptideListInMsruns() const;
const IsotopeLabel * getIsotopeLabel(const QString & label_id);
/// creates and sets an msrun
void setMsRun(const QString & idname, const QFileInfo & fielInfo, const RawDataFormat raw_data_format,
const bool read_time_values, const QString & time_dir);
void addMsRun(Msrun * p_msrun);
void addAlignmentMethod(const QString & method_id,
AlignmentBase * alignment_method);
void addQuantificationMethod(QuantificationMethod * quantification_method);
void addQuantificator(Quantificator * quantificator);
void deleteQuantificator(const QString & quantify_id);
Quantificator * findQuantificator(const QString & quantify_id) const;
void setQuantificatorMatchMode(const QString & quantify_id, McqMatchingMode match_mode);
void addQuantificatorPeptideItems(const QString & quantify_id, const QStringList & isotope_labels_list, mcq_double ni_minimum_abundance);
void addQuantificatorMzrtItem(const QString & quantify_id, const QString & mz, const QString & rt);
void addQuantificatorMzItems(const QString & quantify_id, const QStringList & mz_list);
void addIsotopeLabel(const IsotopeLabel * p_isotope_label);
void addPeptideInPeptideList(Peptide * p_peptide);
const Peptide * getPeptide(const QString pepid) const;
void addProtein(const Protein * p_protein);
void newMsRunGroup(const QString & idname,
const QStringList & list_msrun_ids);
PeptideList * newPeptideListInGroup(const QString & group_xml_id) const;
Msrun * findMsRun(const QString & msrun_id) const;
msRunHashGroup * findGroup(const QString & group_id) const;
const Protein * findProtein(const QString & protein_id) const;
void alignGroup(const QString & group_id,
const QString & method_id,
const QString & ref_msrun_id);
const pappso::XicFilterInterface * getXicFilters() const;
void executeQuantification(const QString & quantify_id);
AlignmentBase * findAlignmentMethod(const QString & method_id) const;
QuantificationMethod * findQuantificationMethod(const QString & method_id) const;
void setMasschroqDir(const QString & masschroq_dir_path);
void debriefing();
protected:
QFileInfo _param_file_info;
msRunHashGroup _ms_run_collection;
//QTextStream * _output_stream;
///
std::map<QString, msRunHashGroup *> _groups;
std::map<const QString, AlignmentBase *> _alignment_methods;
std::map<const QString, QuantificationMethod *> _quantification_methods;
std::map<const QString, Quantificator *> _quantificators;
MonitorSpeedInterface * _p_quantif_results=nullptr;
PeptideList _peptide_list;
std::map<QString, const IsotopeLabel *> _map_p_isotope_labels;
std::map<QString, const Protein *> _p_proteins;
QString _masschroq_dir_path;
void validateXmlFile();
/// parse the XML input file with Dom to look for peptide_files_list tag
void runDomParser();
/// parsing of the XML input file
void runXmlFile();
void setResults(MonitorSpeedInterface * p_results);
void setPeptideListInMsruns() const;
const IsotopeLabel * getIsotopeLabel(const QString & label_id);
/// creates and sets an msrun
void setMsRun(const QString & idname, const QFileInfo & fielInfo, const RawDataFormat raw_data_format,
const bool read_time_values, const QString & time_dir);
void addMsRun(Msrun * p_msrun);
void addAlignmentMethod(const QString & method_id,
AlignmentBase * alignment_method);
void addQuantificationMethod(QuantificationMethod * quantification_method);
void addQuantificator(Quantificator * quantificator);
void deleteQuantificator(const QString & quantify_id);
Quantificator * findQuantificator(const QString & quantify_id) const;
void setQuantificatorMatchMode(const QString & quantify_id, McqMatchingMode match_mode);
void addQuantificatorPeptideItems(const QString & quantify_id, const QStringList & isotope_labels_list, mcq_double ni_minimum_abundance);
void addQuantificatorMzrtItem(const QString & quantify_id, const QString & mz, const QString & rt);
void addQuantificatorMzItems(const QString & quantify_id, const QStringList & mz_list);
void addIsotopeLabel(const IsotopeLabel * p_isotope_label);
void addPeptideInPeptideList(Peptide * p_peptide);
const Peptide * getPeptide(const QString pepid) const;
void addProtein(const Protein * p_protein);
void newMsRunGroup(const QString & idname,
const QStringList & list_msrun_ids);
PeptideList * newPeptideListInGroup(const QString & group_xml_id) const;
Msrun * findMsRun(const QString & msrun_id) const;
msRunHashGroup * findGroup(const QString & group_id) const;
const Protein * findProtein(const QString & protein_id) const;
void alignGroup(const QString & group_id,
const QString & method_id,
const QString & ref_msrun_id);
const pappso::XicFilterInterface * getXicFilters() const;
void executeQuantification(const QString & quantify_id);
AlignmentBase * findAlignmentMethod(const QString & method_id) const;
QuantificationMethod * findQuantificationMethod(const QString & method_id) const;
void setMasschroqDir(const QString & masschroq_dir_path);
void setTracesDirectory(QDir QDir, McqTsvFormat tsv_format);
void addPeptideTrace(const Peptide* peptide);
protected:
QFileInfo _param_file_info;
msRunHashGroup _ms_run_collection;
//QTextStream * _output_stream;
///
std::map<QString, msRunHashGroup *> _groups;
std::map<const QString, AlignmentBase *> _alignment_methods;
std::map<const QString, QuantificationMethod *> _quantification_methods;
std::map<const QString, Quantificator *> _quantificators;
MonitorSpeedInterface * _p_quantif_results=nullptr;
PeptideList _peptide_list;
std::map<QString, const IsotopeLabel *> _map_p_isotope_labels;
std::map<QString, const Protein *> _p_proteins;
QString _masschroq_dir_path;
};
......
......@@ -36,9 +36,6 @@ public:
void writeQuantifyBegin(const Quantificator * p_quantificator) override;
void writeQuantifyEnd() override;
void debriefing() override {};
protected:
MonitorOdsInterfaceOutput();
......
......@@ -47,7 +47,6 @@ public:
virtual void writeQuantifyBegin(const Quantificator * p_quantificator) = 0;
virtual void writeQuantifyEnd() = 0;
virtual void debriefing() = 0;
virtual void logMissedObservedRealXic(const QuantiItemBase * p_quanti_item,const pappso::Xic* p_xic, const std::vector< MsMsRtIntensity >* p_real_rt, const std::vector<pappso::XicPeakSp> * p_log_peaks);
protected :
......
......@@ -52,13 +52,6 @@ void MonitorSpeedList::writeQuantifyEnd() {
}
}
void MonitorSpeedList::debriefing() {
qDebug() << "MonitorSpeedList::debriefing";
for (auto && p_monitor : _monitor_list) {
p_monitor->debriefing();
}
}
void MonitorSpeedList::addMonitor(MonitorSpeedInterface* p_monitor_speed) {
_monitor_list.push_back(p_monitor_speed);
}
......
......@@ -37,7 +37,6 @@ public:
void writeQuantifyBegin(const Quantificator * p_quantificator) override;
void writeQuantifyEnd() override;
void debriefing() override;
protected :
void privWriteMatchedPeak(const Msrun * p_msrun, const QuantiItemBase * p_quanti_item, const AlignedXicPeak * peak) override;
......
......@@ -33,7 +33,7 @@ PeptideList::getPeptide(const QString & pepid) const {
if ( (*it)->getXmlId() == pepid )
return *it;
}
return (NULL);
return (nullptr);
}
/// tests if the PeptideList contains a given peptide or not
......
......@@ -93,6 +93,12 @@ enum class RawDataFormat {
mzxml, mzml
};
enum class McqTsvFormat {
tsv, ods
};
/** \def TMP_FILENAME_PREFIX "masschroq_tmp_file";
\brief template filename prefix for the temporary files generated by masschroq
*/
......
......@@ -1289,10 +1289,22 @@ MasschroqmlParser::startElement_peptide_traces(const QXmlAttributes & attributes
format != "tsv")
{
_errorStr
= QObject::tr("the value '%1' of the format attribute in peptide_traces tag is not suported.\n Supported formats are : 'tsv'(default).");
= QObject::tr("the value '%1' of the format attribute in peptide_traces tag is not suported.\n Supported formats are : 'tsv'(default).").arg(format);
return false;
}
_p_my_chroq->setTracesDirectory(QDir(output_dir), McqTsvFormat::ods);
QStringList list_peptide_ids = peptides.split(" ", QString::SkipEmptyParts);
foreach (const QString &peptide_id, list_peptide_ids) {
const Peptide* peptide = _p_my_chroq->getPeptide(peptide_id);
if (peptide == nullptr) {
_errorStr
= QObject::tr("the peptide '%1' is not defined.").arg(peptide_id);
return false;
}
_p_my_chroq->addPeptideTrace(peptide);
}
//TsvPepListXics * p_results = new TsvPepListXics(output_dir);
return true;
}
......@@ -1324,6 +1336,7 @@ MasschroqmlParser::startElement_mz_traces(const QXmlAttributes & attributes)
return false;
}
return true;
}
......@@ -1556,7 +1569,7 @@ MasschroqmlParser::endElement_quantification()
{
// calls debriefing method in the results/monitors
// so the result file is finished writing
_p_my_chroq->debriefing();
//_p_my_chroq->debriefing();
return true;
}
......
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