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

WIP: Mascot parser

parent 80d20985
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,8 @@
#include "mimeparser.h"
#include <QDebug>
#include <pappsomspp/pappsoexception.h>
#include <pappsomspp/peptide/peptide.h>
#include "../../core/peptidextp.h"
#include "../../core/proteinmatch.h"
MascotDatParser::MascotDatParser(Project * p_project, IdentificationGroup * p_identification_group,
IdentificationDataSource * p_identification_data_source) {
......@@ -120,6 +121,7 @@ void MascotDatParser::parseHeaderLine(const QString & header_line) {
else if (header_list[1].startsWith("queries")) {
qDebug() << "queries=" << header_list[2];
_number_of_queries = header_list[2].toUInt();
_query_peptide_results.resize(_number_of_queries);
}
//min_peaks_for_homology=6
//max_hits=50
......@@ -150,6 +152,8 @@ void MascotDatParser::parseHeaderLine(const QString & header_line) {
void MascotDatParser::saveAndClearPeptide() {
qDebug() << "MascotDatParser::saveAndClearPeptide begin";
if (_current_peptide.query_index > 0) {
// save
_query_peptide_results[_current_peptide.query_index-1].push_back(_current_peptide);
//parse and save
QString peptide_str =_current_peptide.peptide_string_list.at(4);
......@@ -161,7 +165,9 @@ void MascotDatParser::saveAndClearPeptide() {
peptide_str = peptide_str.replace(subst_list.at(0+i).toInt()-1,1,subst_list.at(2+i));
}
}
pappso::Peptide peptide(peptide_str);
PeptideXtpSp peptide_sp;
peptide_sp = PeptideXtp(peptide_str).makePeptideXtpSp();
peptide_sp = _p_project->getPeptideStore().getInstance(peptide_sp);
if (_current_peptide.protein_string_list.size() != _current_peptide.fasta_file_list.size()) {
throw pappso::PappsoException(QObject::tr("ERROR (_current_peptide.protein_string_list.size() != _current_peptide.fasta_file_list.size()) %1").arg(_current_peptide.protein_string_list.join(",\"")));
......@@ -178,6 +184,24 @@ void MascotDatParser::saveAndClearPeptide() {
}
unsigned int start = position_list.at(1).toUInt();
unsigned int stop = position_list.at(2).toUInt();
ProteinXtp protein;
protein.setAccession(accession);
ProteinMatch * p_protein_match = _p_identification_group->getProteinMatchInstance(protein.getAccession());
if (p_protein_match == nullptr) {
throw pappso::PappsoException(QObject::tr("ERROR (p_protein_match == nullptr) %1").arg(str));
}
ProteinXtpSp sp_xtp_protein = protein.makeProteinXtpSp();
p_protein_match->setProteinXtpSp(_p_project->getProteinStore().getInstance(sp_xtp_protein));
p_protein_match->setChecked(true);
PeptideMatch peptide_match;
peptide_match.setStart(start);
//peptide_match.setPeptideEvidenceSp();
p_protein_match->addPeptideMatch(peptide_match);
}
}
......
......@@ -71,6 +71,8 @@ private:
PeptideLine _current_peptide;
std::vector<std::vector<PeptideLine>> _query_peptide_results;
};
......
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