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

compute corrected Evalue for proteins

parent b530a62b
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,8 @@ void ProteinMatch::setEvalue(pappso::pappso_double evalue) {
}
pappso::pappso_double ProteinMatch::getEvalue() const {
return _evalue;
pappso::MsRunIdSp sp_msrun_id;
return getEvalue(sp_msrun_id);
}
void ProteinMatch::setProteinXtpSp(ProteinXtpSp protein_sp) {
_protein_sp = protein_sp;
......@@ -181,6 +182,45 @@ unsigned int ProteinMatch::countValidAndCheckedPeptideMassCharge(const pappso::M
return sequence_list.size();
}
pappso::pappso_double ProteinMatch::getEvalue(const pappso::MsRunIdSp & sp_msrun_id) const {
std::map<QString, pappso::pappso_double> map_sequence_evalue;
for (auto & p_peptide_match : _peptide_match_list) {
if (p_peptide_match->isValidAndChecked()) {
QString sequence(p_peptide_match->getPeptideXtpSp().get()->getSequence());
pappso::pappso_double evalue = p_peptide_match->getEvalue();
if(sp_msrun_id.get() != nullptr) {
//within sample
if (p_peptide_match->getMsRunIdSp().get() == sp_msrun_id.get()) {
auto ret = map_sequence_evalue.insert(std::pair<QString, pappso::pappso_double>(sequence, evalue));
if (ret.second == false) {
if (ret.first->second < evalue) {//get best evalue for sequence
ret.first->second = evalue;
}
}
}
}
else {
//overall samples
auto ret = map_sequence_evalue.insert(std::pair<QString, pappso::pappso_double>(sequence, evalue));
if (ret.second == false) {
if (ret.first->second < evalue) {//get best evalue for sequence
ret.first->second = evalue;
}
}
}
}
}
pappso::pappso_double evalue_prot = 1;
for (auto && peptide_pair: map_sequence_evalue) {
//evalue_prot += std::log10(peptide_pair.second);
evalue_prot *= peptide_pair.second;
}
//return (std::pow ((double) 10.0,evalue_prot));
return (evalue_prot);
}
pappso::pappso_double ProteinMatch::getPAI() const {
pappso::MsRunIdSp sp_msrun_id;
......
......@@ -37,26 +37,37 @@ class IdentificationGroup;
class ProteinMatch
{
friend IdentificationGroup;
friend IdentificationGroup;
public:
ProteinMatch();
~ProteinMatch();
const ProteinXtpSp & getProteinXtpSp() const;
void setEvalue(pappso::pappso_double evalue);
/** @brief compute protein Evalue overall samples
* */
pappso::pappso_double getEvalue() const;
pappso::pappso_double getCoverage() const;
/** @brief compute Protein Abundance Index (PAI)
* overall sample PAI computation (Rappsilber et al. 2002)
* */
/** @brief compute protein Evalue within samples
* */
pappso::pappso_double getEvalue(const pappso::MsRunIdSp & sp_msrun_id) const;
/** @brief protein coverage overall samples
* */
pappso::pappso_double getCoverage() const;
/** @brief compute Protein Abundance Index (PAI)
* overall sample PAI computation (Rappsilber et al. 2002)
* */
pappso::pappso_double getPAI() const;
/** @brief compute Protein Abundance Index (PAI) within sample
* PAI computation (Rappsilber et al. 2002)
* */
pappso::pappso_double getPAI(const pappso::MsRunIdSp & sp_msrun_id) const;
void setProteinXtpSp(ProteinXtpSp protein_sp);
void addPeptideMatch(PeptideMatch * peptide_match);
std::vector<PeptideMatch *> & getPeptideMatchList();
......@@ -81,17 +92,20 @@ public:
const pappso::GrpProteinSp & getGrpProteinSp() const;
const GroupingGroupSp & getGroupingGroupSp() const;
protected :
/** @brief validate or invalidate peptides and proteins based automatic filters and manual checks
* */
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
void setGroupingExperiment(GroupingExperiment * p_grp_experiment);
void setGroupInstance(GroupStore & group_store);
private :
unsigned int countValidAndCheckedPeptideMassCharge(const pappso::MsRunIdSp & sp_msrun_id) const;
private:
pappso::GrpProteinSp _sp_grp_protein;
GroupingGroupSp _sp_group;
......@@ -106,7 +120,6 @@ private:
/** @brief automatic filter result (false by default)
*/
bool _proxy_valid = false;
unsigned int countValidAndCheckedPeptideMassCharge(const pappso::MsRunIdSp & sp_msrun_id) const;
};
......
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