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

WIP mascot parser

parent c2619415
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,11 @@ void MascotDatParser::parse(QIODevice * in_stream) {
parseHeaderLine( mime_parser.getCurrentTextStream().readLine());
}
}
else if (mime_parser.getCurrentFileName() == "peptides") {
while(!mime_parser.getCurrentTextStream().atEnd()) {
parsePeptidesLine( mime_parser.getCurrentTextStream().readLine());
}
}
}
mime_parser.close();
......@@ -130,3 +135,48 @@ void MascotDatParser::parseHeaderLine(const QString & header_line) {
//taskid=151758718701
}
}
void MascotDatParser::parsePeptidesLine(const QString & peptide_line) {
QRegExp regexp_header_line("^([a-z,0-9,_]+)=(.*)$");
if (regexp_header_line.exactMatch(peptide_line)) {
QStringList header_list = regexp_header_line.capturedTexts();
QString index = header_list[1];
QString value = header_list[2];
QStringList index_list = index.split("_");
if (index_list.size() == 3) {
if (index_list[2] == "db") {
_peptides_fasta_file_list.clear();
while(value.size() > 0) {
_peptides_fasta_file_list.push_back( _fasta_file_list[value.left(2).toInt()-1]);
value = value.mid(2);
}
}
}
else if (index_list.size() == 2) {
QString query = index_list[0];
QString peptide = index_list[1];
}
/*
q1_p1_db=02
q1_p1=0,597.302322,0.997884,2,GAWHK,9,0000000,7.97,0000012000000000000,0,0;"sp|O95006|OR2F2_HUMAN":0:299:303:1
q1_p1_terms=K,L
q1_p2_db=02
q1_p2=1,598.296219,0.003987,2,KEEPP,11,0000000,1.32,0002000000000000000,0,0;"tr|E9PNM8|E9PNM8_HUMAN":0:134:138:1
q1_p2_terms=R,-
q2_p1_db=02
q2_p1=1,598.380234,-0.000316,3,KAGVPK,13,00000000,17.13,0002011000000000000,0,0;"tr|H7C1P9|H7C1P9_HUMAN":0:945:950:2
q2_p1_terms=K,K
q2_p2_db=0202
q2_p2=1,598.380234,-0.000316,2,KQPVK,9,0000000,9.54,0002011000000000000,0,0;"sp|P33527|MRP1_HUMAN":0:270:274:1,"tr|I3L4X2|I3L4X2_HUMAN":0:169:173:1
q2_p2_terms=R,V:R,V
q2_p3_db=02
q2_p3=1,598.380234,-0.000316,2,KAVPGK,13,00000000,7.03,0002001000000000000,0,0;"sp|Q13061|TRDN_HUMAN":0:440:445:2
q2_p3_terms=K,K
q2_p4_db=0202
q2_p4=1,598.380234,-0.000316,2,IPGGKK,14,00000000,1.26,0002001000000000000,0,0;"sp|Q9Y2I7|FYV1_HUMAN":0:670:675:2,"tr|E9PDH4|E9PDH4_HUMAN":0:614:619:2
q2_p4_terms=K,F:K,F
*/
}
}
......@@ -42,6 +42,7 @@ public:
private:
void parseProteinLine(const QString & protein_line);
void parseHeaderLine(const QString & protein_line);
void parsePeptidesLine(const QString & peptide_line);
private:
Project * _p_project;
IdentificationGroup * _p_identification_group;
......@@ -50,6 +51,8 @@ private:
ProteinXtp _current_protein;
std::vector<FastaFileSp> _fasta_file_list;
std::vector<FastaFileSp> _peptides_fasta_file_list;
};
#endif // MASCOTDATPARSER_H
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