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

WIP: Mascot parser

parent a4ae5d55
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@
#include <pappsomspp/pappsoexception.h>
#include <QFileInfo>
#include "../../utils/readspectrum.h"
#include "../peptideevidence.h"
IdentificationDataSource::IdentificationDataSource(const QString resource_name)
{
......@@ -41,7 +42,7 @@ IdentificationDataSource::IdentificationDataSource(const IdentificationDataSourc
_params = other._params;
_param_stats = other._param_stats;
_fastafile_list = other._fastafile_list;
//PeptideEvidenceStore _peptide_evidence_store;
}
......@@ -155,3 +156,11 @@ const std::vector<FastaFileSp> & IdentificationDataSource::getFastaFileList() co
qDebug()<< "IdentificationDataSource::getFastaFileList begin" << _fastafile_list.size();
return _fastafile_list;
}
const bool IdentificationDataSource::isValid(const PeptideEvidence * p_peptide_evidence, const AutomaticFilterParameters & automatic_filter_parameters) const {
if (p_peptide_evidence->getEvalue() <= automatic_filter_parameters.getFilterPeptideEvalue()) {
return true;
}
return false;
}
......@@ -124,6 +124,7 @@ public:
*/
virtual const std::map<IdentificationEngineParam, QVariant> & getIdentificationEngineParamMap() const;
virtual const bool isValid(const PeptideEvidence * p_peptide_evidence, const AutomaticFilterParameters & automatic_filter_parameters) const;
protected :
QString _resource_name;
......
......@@ -98,3 +98,9 @@ void IdentificationMascotDatFile::parseTo(Project* p_project) {
qDebug() << "IdentificationMascotDatFile::parseTo end";
}
const bool IdentificationMascotDatFile::isValid(const PeptideEvidence * p_peptide_evidence, const AutomaticFilterParameters & automatic_filter_parameters) const {
return true;
}
......@@ -43,7 +43,9 @@ public:
virtual pappso::SpectrumSp getSpectrumSp(unsigned int scan_number) const override;
virtual void parseTo(Project* p_project) override;
virtual const bool isValid(const PeptideEvidence * p_peptide_evidence, const AutomaticFilterParameters & automatic_filter_parameters) const override;
private:
const QFileInfo _mascot_dat_file;
};
......
......@@ -159,6 +159,8 @@ void IdentificationGroup::updateAutomaticFilters(const AutomaticFilterParameters
for (IdentificationDataSource * p_identification_source_list:_id_source_list) {
p_identification_source_list->getPeptideEvidenceStore().updateAutomaticFilters(automatic_filter_parameters);
}
qDebug() << "IdentificationGroup::updateAutomaticFilters begin p_protein_match" ;
for (auto & p_protein_match : _protein_match_list) {
p_protein_match->updateAutomaticFilters(automatic_filter_parameters);
}
......
......@@ -66,9 +66,7 @@ PeptideEvidenceSp PeptideEvidence::makePeptideEvidenceSp() const {
void PeptideEvidence::updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters) {
_proxy_valid = false;
if (_evalue <= automatic_filter_parameters.getFilterPeptideEvalue()) {
_proxy_valid = true;
}
_proxy_valid = this->_p_identification_source->isValid(this, automatic_filter_parameters);
}
void PeptideEvidence::setRetentionTime(pappso::pappso_double rt) {
_rt = rt;
......
......@@ -73,6 +73,8 @@ void MascotDatParser::parse(QIODevice * in_stream) {
while(!mime_parser.getCurrentTextStream().atEnd()) {
parsePeptidesLine( mime_parser.getCurrentTextStream().readLine());
}
saveAndClearPeptide();
}
else if (mime_parser.getCurrentFileName().startsWith("query")) {
_current_query_index = mime_parser.getCurrentFileName().mid(5).toUInt();
......
......@@ -56,15 +56,18 @@ bool MimeParser::close() {
_priv_file_string = "";
if (_p_current_file_content != nullptr) {
delete _p_current_file_content;
_p_current_file_content = nullptr;
}
qDebug() << "MimeParser::close delete _real_in";
if (_real_in !=nullptr) {
delete _real_in;
_real_in =nullptr;
}
qDebug() << "MimeParser::close delete _p_inputstream";
if (_p_inputstream !=nullptr) {
_p_inputstream->close();
delete _p_inputstream;
//delete _p_inputstream;
_p_inputstream =nullptr;
}
qDebug() << "MimeParser::close end";
......
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