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

update masschroq example files

parent 98314e85
......@@ -272,6 +272,7 @@
<quantification_results>
<quantification_result format="tsv" output_file="results/Result_LTQ"/>
<quantification_result format="masschroqml" output_file="results/Result_LTQ_masschroqml_output"/>
<compar_result format="ods" output_file="results/compar.ods"/>
</quantification_results>
<quantification_traces>
<peptide_traces format="tsv" output_dir="results/peplist_xics_traces/" peptide_ids="pep0 pep1 pep2 pep3 pep4"/>
......
......@@ -31,6 +31,8 @@
<quantification>
<quantification_results>
<quantification_result format="tsv" output_file="results/Result_orbitrap"/>
<quantification_result format="ods" output_file="results/Result_orbitrap"/>
<compar_result format="ods" output_file="results/Result_orbitrap_compar"/>
</quantification_results>
<quantify id="q1" quantification_method_id="quant1" withingroup="G1">
<peptides_in_peptide_list mode="real_or_mean"/>
......
......@@ -3,6 +3,7 @@
<masschroq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../schema/masschroq-1.2.xsd">
-->
<masschroq>
<rawdata><!-- time_values_dir="directory" to read retention time corrections-->
<data_file id="samp0" format="mzxml" path="bsa1.mzXML" type="centroid" />
<data_file id="samp1" format="mzxml" path="bsa2.mzXML" type="profile" />
......@@ -11,7 +12,8 @@
<data_file id="samp3" format="mzml" path="/home/user/bsa4.mzml"
type="profile" />
</rawdata>
<groups>
<groups>
<group data_ids="samp0 samp1" id="G1" />
<group data_ids="samp2 samp3" id="G2" />
</groups>
......
......@@ -36,7 +36,6 @@ MasschroqWriter::MasschroqWriter(
}
QString complete_out_filename = out_filename;
complete_out_filename.append(".xml");
_output_file = new QFile(complete_out_filename);
if (_output_file->exists())
{
......
......@@ -1201,6 +1201,7 @@ MasschroqmlParser::startElement_quantification_result(const QXmlAttributes &attr
}
else if (format == "ods")
{
output_file = ensureFileExtension(output_file, "ods");
MonitorSpeedInterface * p_monitor_speed = new MonitorOdsOutput(output_file);
_p_current_monitor_speed_list->addMonitor(p_monitor_speed);
return true;
......@@ -1208,7 +1209,7 @@ MasschroqmlParser::startElement_quantification_result(const QXmlAttributes &attr
}
else if (format == "tsv")
{
output_file = ensureFileExtension(output_file, "d");
MonitorSpeedInterface * p_monitor_speed = new MonitorTsvOutput(output_file);
_p_current_monitor_speed_list->addMonitor(p_monitor_speed);
return true;
......@@ -1230,7 +1231,7 @@ bool MasschroqmlParser::ensureFilePathExists(QString output_file) {
// qDebug()<< "MasschroqmlParser::ensureFilePathExists complete_path.dir()" << complete_path.dir().absolutePath() ;
// qDebug() << QFileInfo("~/examples/191697/main.cpp").dir().absolutePath();
// qDebug() << QFileInfo("~/examples/191697/main").dir().absolutePath();
// qDebug() << QFileInfo("~/examples/191697/main").dir().absolutePath();
QDir only_dir(complete_path.dir().absolutePath());
if (only_dir.exists()) {
return true;
......@@ -1271,6 +1272,7 @@ MasschroqmlParser::startElement_compar_result(const QXmlAttributes &attributes)
if (format == "ods")
{
output_file = ensureFileExtension(output_file, "ods");
MonitorSpeedInterface * p_monitor_speed = new MonitorComparOdsOutput(output_file);
_p_current_monitor_speed_list->addMonitor(p_monitor_speed);
return true;
......@@ -1278,6 +1280,7 @@ MasschroqmlParser::startElement_compar_result(const QXmlAttributes &attributes)
}
else if (format == "tsv")
{
output_file = ensureFileExtension(output_file, "d");
MonitorSpeedInterface * p_monitor_speed = new MonitorComparTsvOutput(output_file);
_p_current_monitor_speed_list->addMonitor(p_monitor_speed);
return true;
......@@ -1290,9 +1293,19 @@ MasschroqmlParser::startElement_compar_result(const QXmlAttributes &attributes)
return false;
}
QString MasschroqmlParser::ensureFileExtension(const QString & output_file, const QString & file_extension) {
QFileInfo filename(output_file);
if (filename.suffix().isEmpty()) {
return QString( output_file + "." +file_extension);
}
return output_file;
}
bool
MasschroqmlParser::startXmlResult(const QString output_file, const bool with_traces)
{
QString mcq_file = ensureFileExtension(output_file,"masschroqML");
MasschroqWriter * p_results;
QString input_file = _p_my_chroq->getXmlFilename();
if (input_file.isEmpty())
......@@ -1302,7 +1315,7 @@ MasschroqmlParser::startXmlResult(const QString output_file, const bool with_tra
}
try
{
p_results = new MasschroqWriter(input_file, output_file, with_traces);
p_results = new MasschroqWriter(input_file, mcq_file, with_traces);
} catch (mcqError& error)
{
_errorStr = QObject::tr("problem creating xml output results :\n%1").arg(error.what());
......
......@@ -276,6 +276,13 @@ private:
* \return true if path is ok, false otherwise
*/
bool ensureFilePathExists(QString output_file);
/** \brief if no file extension is given, then set the default extension has defined by argument
* \param output_file the orginal output filename
* \param file_extension the default file extension to use
* \return the filename to use
* */
QString ensureFileExtension(const QString & output_file, const QString & file_extension);
};
......
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