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

first evalue filter

parent 6dede07c
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
******************************************************************************/
#include "identificationgroup.h"
#include "project.h"
IdentificationGroup::IdentificationGroup(Project * project)
{
......@@ -38,7 +39,8 @@ IdentificationGroup::~IdentificationGroup()
}
bool IdentificationGroup::isValid(ProteinMatch* p_protein_match) const {
return true;
return _p_project->isValid(p_protein_match);
}
void IdentificationGroup::addProteinMatch(ProteinMatch * protein_match) {
......
......@@ -35,6 +35,9 @@ void PeptideMatch::setEvalue(pappso::pappso_double evalue) {
_evalue = evalue;
}
pappso::pappso_double PeptideMatch::getEvalue() const {
return _evalue;
}
void PeptideMatch::setExperimentalMass(pappso::pappso_double exp_mass) {
_exp_mass =exp_mass;
}
......
......@@ -48,6 +48,7 @@ public :
pappso::pappso_double getRetentionTime() const;
unsigned int getCharge() const;
pappso::PeptideSp getPeptideSp() const;
pappso::pappso_double getEvalue() const;
private :
pappso::MsRunIdSp _msrunid_sp;
......
......@@ -23,6 +23,7 @@
#include "project.h"
#include "../input/xpipsaxhandler.h"
#include "peptidematch.h"
#include "proteinmatch.h"
Project::Project()
{
......@@ -42,6 +43,19 @@ ProjectSp Project::makeProjectSp() const {
return std::make_shared<Project>(*this);
}
void Project::setFilterPeptideEvalue( pappso::pappso_double evalue) {
_filter_minimum_peptide_evalue = evalue;
}
void Project::setFilterProteinEvalue( pappso::pappso_double evalue) {
_filter_minimum_protein_evalue = evalue;
}
void Project::setFilterMinimumPeptidePerMatch(unsigned int number) {
_filter_minimum_peptide_per_match = number;
}
void Project::setFilterCrossSamplePeptideNumber(bool cross) {
_filter_is_cross_sample_peptide_number = cross;
}
IdentificationGroup* Project::newIdentificationGroup() {
_p_current_identification_group = new IdentificationGroup(this);
......@@ -83,5 +97,15 @@ IdentificationGroup* Project::getCurrentIdentificationGroupP() const {
}
bool Project::isValid(PeptideMatch* p_peptide_match) const {
if (p_peptide_match->getEvalue() > _filter_minimum_peptide_evalue) {
return false;
}
return true;
}
bool Project::isValid(ProteinMatch* p_protein_match) const {
if (p_protein_match->getEvalue() > _filter_minimum_protein_evalue) {
return false;
}
return true;
}
......@@ -25,11 +25,13 @@
#include<memory>
#include "identificationgroup.h"
#include <pappsomspp/types.h>
class Project;
typedef std::shared_ptr<Project> ProjectSp;
class PeptideMatch;
class ProteinMatch;
class Project
{
......@@ -44,10 +46,23 @@ public:
/** @brief is it valid regarding threshold and project rules
*/
bool isValid(PeptideMatch* p_peptide_match) const;
/** @brief is it valid regarding threshold and project rules
*/
bool isValid(ProteinMatch* p_protein_match) const;
void setFilterPeptideEvalue( pappso::pappso_double evalue);
void setFilterProteinEvalue( pappso::pappso_double evalue);
void setFilterMinimumPeptidePerMatch(unsigned int number);
void setFilterCrossSamplePeptideNumber(bool cross);
private :
std::vector<IdentificationGroup *> _identification_goup_list;
IdentificationGroup* _p_current_identification_group = nullptr;
pappso::pappso_double _filter_minimum_peptide_evalue=1;
pappso::pappso_double _filter_minimum_protein_evalue=1;
unsigned int _filter_minimum_peptide_per_match=1;
bool _filter_is_cross_sample_peptide_number=false;
};
#endif // PROJECT_H
......@@ -23,6 +23,7 @@
#include "xpipsaxhandler.h"
#include <pappsomspp/msrun/msrunid.h>
#include <pappsomspp/exception/exceptionnotfound.h>
#include <cmath>
XpipSaxHandler::XpipSaxHandler(Project * p_project):_p_project(p_project)
{
......@@ -133,6 +134,13 @@ bool XpipSaxHandler::startElement_filter_params(QXmlAttributes attributes) {
//<filter_params pep_evalue="0.01" prot_evalue="-2.0" pep_number="1" filter_to_all="false" database_filter="contaminants_standarts.fasta"/>
qDebug() << "startElement_filter_params ";
_p_project->setFilterPeptideEvalue( attributes.value("pep_evalue").simplified().toDouble());
_p_project->setFilterProteinEvalue( std::pow ((double) 10.0,attributes.value("prot_evalue").simplified().toDouble()));
_p_project->setFilterMinimumPeptidePerMatch( attributes.value("pep_number").simplified().toUInt());
_p_project->setFilterCrossSamplePeptideNumber(false);
if (attributes.value("filter_to_all").simplified() == "true") {
_p_project->setFilterCrossSamplePeptideNumber(true);
}
qDebug() << "startElement_filter_params end" ;
return true;
}
......@@ -201,15 +209,15 @@ bool XpipSaxHandler::startElement_protein(QXmlAttributes attributes) {
qDebug() << "startElement_protein ";
/*
* <protein peptide_number="268" evalue="-432.77353" URL="Genome_Z_mays_5a.fasta"
* description="GRMZM2G083841_P01 P04711 Phosphoenolpyruvate carboxylase 1 (PEPCase 1)(PEPC 1)(EC 4.1.1.31)
* <protein peptide_number="268" evalue="-432.77353" URL="Genome_Z_mays_5a.fasta"
* description="GRMZM2G083841_P01 P04711 Phosphoenolpyruvate carboxylase 1 (PEPCase 1)(PEPC 1)(EC 4.1.1.31)
* seq=translation; coord=9:61296279..61301686:1; parent_transcript=GRMZM2G083841_T01; parent_gene=GRMZM2G083841">
<protein_evalue evalue="-399.36093" sample="20120906_balliau_extract_1_A02_urzb-1"/>
<protein_evalue evalue="-384.54382" sample="20120906_balliau_extract_1_A01_urnb-1"/>
<sequence>MASTKAPGPGEKHHSIDAQLRQLVPGKVSEDDKLIEYDALLVDRFLNILQDLHGPSLREFVQECYEVSADYEGKGDTTKLGELGAKLTGLAPADAILVASSILHMLNLANLAEEVQIAHRRRNSKLKKGGFADEGSATTESDIEETLKRLVSEVGKSPEEVFEALKNQTVDLVFTAHPTQSARRSLLQKNARIRNCLTQLNAKDITDDDKQELDEALQREIQAAFRTDEIRRAQPTPQDEMRYGMSYIHETVWKGVPKFLRRVDTALKNIGINERLPYNVSLIRFSSWMGGDRDGNPRVTPEVTRDVCLLARMMAANLYIDQIEELMFELSMWRCNDELRVRAEELHSSSGSKVTKYYIEFWKQIPPNEPYRVILGHVRDKLYNTRERARHLLASGVSEISAESSFTSIEEFLEPLELCYKSLCDCGDKAIADGSLLDLLRQVFTFGLSLVKLDIRQESERHTDVIDAITTHLGIGSYREWPEDKRQEWLLSELRGKRPLLPPDLPQTDEIADVIGAFHVLAELPPDSFGPYIISMATAPSDVLAVELLQRECGVRQPLPVVPLFERLADLQSAPASVERLFSVDWYMDRIKGKQQVMVGYSDSGKDAGRLSAAWQLYRAQEEMAQVAKRYGVKLTLFHGRGGTVGRGGGPTHLAILSQPPDTINGSIRVTVQGEVIEFCFGEEHLCFQTLQRFTAATLEHGMHPPVSPKPEWRKLMDEMAVVATEEYRSVVVKEARFVEYFRSATPETEYGRMNIGSRPAKRRPGGGITTLRAIPWIFSWTQTRFHLPVWLGVGAAFKFAIDKDVRNFQVLKEMYNEWPFFRVTLDLLEMVFAKGDPGIAGLYDELLVAEELKPFGKQLRDKYVETQQLLLQIAGHKDILEGDPFLKQGLVLRNPYITTLNVFQAYTLKRIRDPNFKVTPQPPLSKEFADENKPAGLVKLNPASEYPPGLEDTLILTMKGIAAGMQNTG</sequence>
</protein>
*/
_p_protein_match->setEvalue(attributes.value("evalue").toDouble());
_p_protein_match->setEvalue(std::pow ((double) 10.0, attributes.value("evalue").toDouble()));
_current_protein.setDescription(attributes.value("description").simplified());
_current_protein.setAccession(_current_protein.getDescription().split(" ").at(0));
qDebug() << "startElement_protein 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