OpenMS
Loading...
Searching...
No Matches
MessagePasserFactory< Label > Class Template Reference

#include <OpenMS/ANALYSIS/ID/MessagePasserFactory.h>

Collaboration diagram for MessagePasserFactory< Label >:
[legend]

Public Member Functions

evergreen::TableDependency< Label > createProteinFactor (Label id, int nrMissingPeps=0)
 Protein Factor initialized with model prior (missing peps are experimental)
 
evergreen::TableDependency< Label > createProteinFactor (Label id, double prior, int nrMissingPeps=0)
 Protein Factor initialized with user prior (missing peps are experimental)
 
evergreen::TableDependency< Label > createPeptideEvidenceFactor (Label id, double prob)
 
evergreen::TableDependency< Label > createRegularizingSumEvidenceFactor (size_t nr_parents, Label id, Label pep_id)
 
evergreen::TableDependency< Label > createSumEvidenceFactor (size_t nr_parents, Label id, Label pep_id)
 
evergreen::TableDependency< Label > createSumFactor (size_t nr_parents, Label nId)
 
evergreen::TableDependency< Label > createReplicateFactor (Label seqId, Label repId)
 
evergreen::TableDependency< Label > createChargeFactor (Label repId, Label chargeId, int chg)
 
evergreen::AdditiveDependency< Label > createPeptideProbabilisticAdderFactor (const std::set< Label > &parentProteinIDs, Label nId)
 To sum up distributions for the number of parent proteins of a peptide with convolution trees.
 
evergreen::AdditiveDependency< Label > createPeptideProbabilisticAdderFactor (const std::vector< Label > &parentProteinIDs, Label nId)
 To sum up distributions for the number of parent proteins of a peptide with convolution trees.
 
evergreen::PseudoAdditiveDependency< Label > createBFPeptideProbabilisticAdderFactor (const std::set< Label > &parentProteinIDs, Label nId, const std::vector< evergreen::TableDependency< Label > > &deps)
 To sum up distributions for the number of parent proteins of a peptide brute-force.
 
 MessagePasserFactory (double alpha, double beta, double gamma, double p, double pep_prior)
 Constructor.
 
void fillVectorsOfMessagePassers (const std::vector< Label > &protIDs, const std::vector< std::vector< Label > > &parentsOfPeps, const std::vector< double > &pepEvidences, evergreen::InferenceGraphBuilder< Label > &igb)
 Works on a vector of protein indices (potentially not consecutive)
 

Private Member Functions

double notConditionalGivenSum (unsigned long summ)
 

Private Attributes

double alpha_
 the model parameters
 
double beta_
 
double gamma_
 
double p_
 
double pepPrior_
 
std::map< int, double > chgLLhoods = {{1, 0.7}, {2, 0.9}, {3, 0.7}, {4, 0.5}, {5, 0.5}}
 

Detailed Description

template<typename Label>
class OpenMS::Internal::MessagePasserFactory< Label >

Produces MessagePassers (nodes in a factor graph = bayesian network) for use with Evergreen library, based on a parameterization of the Protein-Peptide Bayesian network. Those MessagePassers can be tables or convolution trees. Labels are used to associate the variables they are working on. They can be integers (for speed) or strings (for readability/debug)

Constructor & Destructor Documentation

◆ MessagePasserFactory()

template<typename Label >
MessagePasserFactory ( double  alpha,
double  beta,
double  gamma,
double  p,
double  pep_prior 
)

Constructor.

Parameters
[in]alphaPeptide emission probability
[in]betaSpurious peptide emission probability
[in]gammaProtein prior
[in]pMarginalization norm
[in]pep_priorPeptide prior (defines at which evidence probability, additional evidence is beneficial)

Member Function Documentation

◆ createBFPeptideProbabilisticAdderFactor()

template<typename Label >
evergreen::PseudoAdditiveDependency< Label > createBFPeptideProbabilisticAdderFactor ( const std::set< Label > &  parentProteinIDs,
Label  nId,
const std::vector< evergreen::TableDependency< Label > > &  deps 
)

To sum up distributions for the number of parent proteins of a peptide brute-force.

◆ createChargeFactor()

template<typename Label >
evergreen::TableDependency< Label > createChargeFactor ( Label  repId,
Label  chargeId,
int  chg 
)

◆ createPeptideEvidenceFactor()

template<typename Label >
evergreen::TableDependency< Label > createPeptideEvidenceFactor ( Label  id,
double  prob 
)

Peptide Factor initialized with:

Parameters
[in]idID for the LabeledPMF
[in]probpeptide evidence probability

◆ createPeptideProbabilisticAdderFactor() [1/2]

template<typename Label >
evergreen::AdditiveDependency< Label > createPeptideProbabilisticAdderFactor ( const std::set< Label > &  parentProteinIDs,
Label  nId 
)

To sum up distributions for the number of parent proteins of a peptide with convolution trees.

◆ createPeptideProbabilisticAdderFactor() [2/2]

template<typename Label >
evergreen::AdditiveDependency< Label > createPeptideProbabilisticAdderFactor ( const std::vector< Label > &  parentProteinIDs,
Label  nId 
)

To sum up distributions for the number of parent proteins of a peptide with convolution trees.

◆ createProteinFactor() [1/2]

template<typename Label >
evergreen::TableDependency< Label > createProteinFactor ( Label  id,
double  prior,
int  nrMissingPeps = 0 
)

Protein Factor initialized with user prior (missing peps are experimental)

◆ createProteinFactor() [2/2]

template<typename Label >
evergreen::TableDependency< Label > createProteinFactor ( Label  id,
int  nrMissingPeps = 0 
)

Protein Factor initialized with model prior (missing peps are experimental)

◆ createRegularizingSumEvidenceFactor()

template<typename Label >
evergreen::TableDependency< Label > createRegularizingSumEvidenceFactor ( size_t  nr_parents,
Label  id,
Label  pep_id 
)

Conditional probability table of peptide given number of parent proteins, based on model params. Additionally regularizes on the amount of parent proteins.

Parameters
[in]nr_parents(maximum) number of parent proteins
[in]idID for the LabeledPMF
[in]pep_idID for the LabeledPMF

◆ createReplicateFactor()

template<typename Label >
evergreen::TableDependency< Label > createReplicateFactor ( Label  seqId,
Label  repId 
)

◆ createSumEvidenceFactor()

template<typename Label >
evergreen::TableDependency< Label > createSumEvidenceFactor ( size_t  nr_parents,
Label  id,
Label  pep_id 
)

Conditional probability table of peptide given number of parent proteins, based on model params.

Parameters
[in]nr_parents(maximum) number of parent proteins
[in]idID for the LabeledPMF
[in]pep_idID for the LabeledPMF

◆ createSumFactor()

template<typename Label >
evergreen::TableDependency< Label > createSumFactor ( size_t  nr_parents,
Label  nId 
)

◆ fillVectorsOfMessagePassers()

template<typename Label >
void fillVectorsOfMessagePassers ( const std::vector< Label > &  protIDs,
const std::vector< std::vector< Label > > &  parentsOfPeps,
const std::vector< double > &  pepEvidences,
evergreen::InferenceGraphBuilder< Label > &  igb 
)

Works on a vector of protein indices (potentially not consecutive)

◆ notConditionalGivenSum()

template<typename Label >
double notConditionalGivenSum ( unsigned long  summ)
inlineprivate

to fill the noisy-OR table for a peptide given parent proteins TODO pre-compute for like a hundred parent proteins TODO introduce special case for alpha or beta = 1. The log formula does not work otherwise.

References MessagePasserFactory< Label >::alpha_, and MessagePasserFactory< Label >::beta_.

Member Data Documentation

◆ alpha_

template<typename Label >
double alpha_
private

the model parameters

Referenced by MessagePasserFactory< Label >::notConditionalGivenSum().

◆ beta_

template<typename Label >
double beta_
private

◆ chgLLhoods

template<typename Label >
std::map<int, double> chgLLhoods = {{1, 0.7}, {2, 0.9}, {3, 0.7}, {4, 0.5}, {5, 0.5}}
private

Likelihoods for the charge states given presence of the peptide sequence (

Todo:
could be calculated from IDPEP if we do per charge state fitting) or empirically estimated from the input PSMs

◆ gamma_

template<typename Label >
double gamma_
private

◆ p_

template<typename Label >
double p_
private

◆ pepPrior_

template<typename Label >
double pepPrior_
private