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

WIP : proticdbml writer, test xpip

parent ef42c5bf
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,7 @@ void IdentificationXtandemFile::parseTo(Project* p_project) {
}
}
identification_group_p->addMsRunSp(msrun_sp);
identification_group_p->addIdentificationDataSourceP(this);
XtandemSaxHandler * parser = new XtandemSaxHandler(p_project, identification_group_p, this);
QXmlSimpleReader simplereader;
......
......@@ -149,6 +149,14 @@ bool IdentificationGroup::contains (const MsRun * p_msrun) const {
}
return false;
}
void IdentificationGroup::addIdentificationDataSourceP(IdentificationDataSource * p_identification_source) {
addMsRunSp(p_identification_source->getMsRunSp());
auto it = std::find (_id_source_list.begin() ,_id_source_list.end(),p_identification_source);
if (it == _id_source_list.end()) {
_id_source_list.push_back(p_identification_source);
}
}
void IdentificationGroup::addMsRunSp(MsRunSp ms_run_sp) {
auto it = std::find (_ms_run_list.begin() ,_ms_run_list.end(),ms_run_sp);
if (it == _ms_run_list.end()) {
......
......@@ -48,7 +48,7 @@ public:
const GroupStore & getGroupStore() const;
void addProteinMatch(ProteinMatch * protein_match);
std::vector<ProteinMatch *> & getProteinMatchList();
void addMsRunSp(MsRunSp ms_run_sp);
void addIdentificationDataSourceP(IdentificationDataSource * p_identification_source);
/** @brief count groups
* */
......@@ -102,6 +102,9 @@ public:
void collectMhDelta(std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const;
private :
void addMsRunSp(MsRunSp ms_run_sp);
private :
GroupingExperiment * _p_grp_experiment= nullptr;
Project * _p_project;
......@@ -111,6 +114,7 @@ private :
std::vector<ProteinMatch *> _protein_match_list;
std::vector<MsRunSp> _ms_run_list;
std::vector<IdentificationDataSource *> _id_source_list;
std::map<QString, ProteinMatch *> _cache_accession_protein_match;
};
......
......@@ -189,7 +189,7 @@ bool XpipSaxHandler::startElement_sample(QXmlAttributes attributes) {
MsRunSp ms_run = _p_project->getMsRunStore().getInstance(attributes.value("value").simplified());
ms_run.get()->setFilename(attributes.value("value").simplified());
_current_identification_group_p->addMsRunSp(ms_run);
//_current_identification_group_p->addMsRunSp(ms_run);
qDebug() << "startElement_sample end" ;
return true;
}
......@@ -255,6 +255,7 @@ bool XpipSaxHandler::startElement_peptide(QXmlAttributes attributes) {
if (p_identification_data_source->getMsRunSp().get() != ms_run_id.get()) {
throw pappso::PappsoException(QObject::tr("p_identification_data_source->getMsRunSp().get() != ms_run_id.get()"));
}
_current_identification_group_p->addIdentificationDataSourceP(p_identification_data_source);
p_identification_data_source->addFastaFile(_current_fasta_file_sp);
_p_peptide_match->setChecked(false);
if (attributes.value("validate").simplified().toLower() == "true") {
......
......@@ -270,12 +270,12 @@ void ProticdbMl::writeMsRuns() {
}
void ProticdbMl::writeIdentificationRun(Identification identification) {
writer.writeAttribute("ident_method_id", "m1");
writer.writeAttribute("customdb_id", "customdb0");
void ProticdbMl::writeIdentificationRun(IdentificationGroup * p_identification) {
_output_stream->writeAttribute("ident_method_id", "m1");
_output_stream->writeAttribute("customdb_id", "customdb0");
writer.writeStartElement("description");
writer.writeStartElement("admin");
_output_stream->writeStartElement("description");
_output_stream->writeStartElement("admin");
// writer.writeStartElement("contact");
// writer.writeStartElement("email");
// writer.writeCharacters("valot@moulon.inra.fr");
......@@ -285,24 +285,25 @@ void ProticdbMl::writeIdentificationRun(Identification identification) {
// writer.writeCharacters("Valot Benoit");
// writer.writeEndElement();// name
// writer.writeEndElement();// contact
/*
this.xpipFile = XtandemPipelineSession.getInstance()
.getCurrentXpipFile();
writer.writeStartElement("sourceFile");
writer.writeStartElement("nameOfFile");
_output_stream->writeStartElement("sourceFile");
_output_stream->writeStartElement("nameOfFile");
// TODO
// get the loaded xpip file name
writer.writeCharacters(this.xpipFile.getName());
writer.writeEndElement();// nameOfFile
writer.writeStartElement("pathToFile");
writer.writeCharacters(this.xpipFile.getAbsolutePath());
writer.writeEndElement();// pathToFile
writer.writeStartElement("fileType");
writer.writeCharacters("XPIP file");
writer.writeEndElement();// fileType
writer.writeEndElement();// sourceFile
writer.writeEndElement();// admin
_output_stream->writeCharacters(this.xpipFile.getName());
_output_stream->writeEndElement();// nameOfFile
_output_stream->writeStartElement("pathToFile");
_output_stream->writeCharacters(this.xpipFile.getAbsolutePath());
_output_stream->writeEndElement();// pathToFile
_output_stream->writeStartElement("fileType");
_output_stream->writeCharacters("XPIP file");
_output_stream->writeEndElement();// fileType
_output_stream->writeEndElement();// sourceFile
*/
_output_stream->writeEndElement();// admin
// if we can retrieve original informations in xml xtandem results
HashSet<IdentificationXtandemFile> xtSourceFiles = Utils
......@@ -345,7 +346,7 @@ void ProticdbMl::writeIdentificationRun(Identification identification) {
writer.writeStartElement("processingMethod");
// cvParams
this.writeCvParam("PROTICdbO:0000323", ""
writeCvParam("PROTICdbO:0000323", ""
+ XtandemPipelineSession.getInstance().getConfig()
.get_protein_evalue(),
"X!TandemPipeline filter on protein evalue (log)");
......
......@@ -55,6 +55,7 @@ private :
void writeIdentMethod();
void writeSamples();
void writeMsRuns();
void writeIdentificationRun(IdentificationGroup * p_identification);
private :
QFile * _output_file;
......
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