OpenMS  2.7.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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) More...
 
evergreen::TableDependency< Label > createProteinFactor (Label id, double prior, int nrMissingPeps=0)
 Protein Factor initialized with user prior (missing peps are experimental) More...
 
evergreen::TableDependency< Label > createPeptideEvidenceFactor (Label id, double prob)
 
evergreen::TableDependency< Label > createRegularizingSumEvidenceFactor (size_t nrParents, Label nId, Label pepId)
 
evergreen::TableDependency< Label > createSumEvidenceFactor (size_t nrParents, Label nId, Label pepId)
 
evergreen::TableDependency< Label > createSumFactor (size_t nrParents, 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. More...
 
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. More...
 
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. More...
 
 MessagePasserFactory (double alpha, double beta, double gamma, double p, double pep_prior)
 Constructor. More...
 
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) More...
 

Private Member Functions

double notConditionalGivenSum (unsigned long summ)
 

Private Attributes

double alpha_
 the model parameters More...
 
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()

MessagePasserFactory ( double  alpha,
double  beta,
double  gamma,
double  p,
double  pep_prior 
)

Constructor.

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

Member Function Documentation

◆ createBFPeptideProbabilisticAdderFactor()

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()

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

◆ createPeptideEvidenceFactor()

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

Peptide Factor initialized with:

Parameters
probpeptide evidence probability

◆ createPeptideProbabilisticAdderFactor() [1/2]

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]

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]

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

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

◆ createProteinFactor() [2/2]

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

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

◆ createRegularizingSumEvidenceFactor()

evergreen::TableDependency< Label > createRegularizingSumEvidenceFactor ( size_t  nrParents,
Label  nId,
Label  pepId 
)

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

Parameters
nrParents(maximum) number of parent proteins

◆ createReplicateFactor()

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

◆ createSumEvidenceFactor()

evergreen::TableDependency< Label > createSumEvidenceFactor ( size_t  nrParents,
Label  nId,
Label  pepId 
)

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

Parameters
nrParents(maximum) number of parent proteins

◆ createSumFactor()

evergreen::TableDependency< Label > createSumFactor ( size_t  nrParents,
Label  nId 
)

◆ fillVectorsOfMessagePassers()

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)

References seqan::find().

◆ notConditionalGivenSum()

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_

double alpha_
private

the model parameters

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

◆ beta_

double beta_
private

◆ chgLLhoods

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_

double gamma_
private

◆ p_

double p_
private

◆ pepPrior_

double pepPrior_
private