|
OpenMS
2.5.0
|
Go to the documentation of this file.
65 std::map<Int, std::map<Int, SampleAbundances>>
abundances;
127 n_samples(0), quant_proteins(0), too_few_peptides(0),
128 quant_peptides(0), total_peptides(0), quant_features(0),
129 total_features(0), blank_features(0), ambig_features(0) {}
157 void readQuantData(std::vector<ProteinIdentification>& proteins,
158 std::vector<PeptideIdentification>& peptides,
170 void quantifyPeptides(
const std::vector<PeptideIdentification>& peptides =
171 std::vector<PeptideIdentification>());
183 const Statistics& getStatistics();
186 const PeptideQuant& getPeptideResults();
189 const ProteinQuant& getProteinResults();
192 static void annotateQuantificationsToProteins(
193 const ProteinQuant& protein_quants,
195 const UInt n_samples);
215 PeptideHit getAnnotation_(std::vector<PeptideIdentification>& peptides);
238 const std::map<
Int, std::map<Int, SampleAbundances>> & peptide_abundances,
239 std::pair<size_t, size_t> & best)
241 size_t best_n_quant(0);
242 double best_abundance(0);
243 best = std::make_pair(0,0);
245 for (
auto & fa : peptide_abundances)
247 for (
auto & ca : fa.second)
249 const Int & fraction = fa.first;
250 const Int & charge = ca.first;
252 double current_abundance = std::accumulate(
253 std::begin(ca.second),
256 [] (
int value,
const SampleAbundances::value_type& p)
257 { return value + p.second; }
260 if (current_abundance <= 0) {
continue; }
262 const size_t current_n_quant = ca.second.size();
263 if (current_n_quant > best_n_quant)
265 best_abundance = current_abundance;
266 best_n_quant = current_n_quant;
267 best = std::make_pair(fraction, charge);
269 else if (current_n_quant == best_n_quant
270 && current_abundance > best_abundance)
272 best_abundance = current_abundance;
273 best = std::make_pair(fraction, charge);
277 return best_abundance > 0.;
285 template <
typename T>
286 void orderBest_(
const std::map<T, SampleAbundances> & abundances,
287 std::vector<T>& result)
289 typedef std::pair<Size, double> PairType;
290 std::multimap<PairType, T, std::greater<PairType> > order;
291 for (
typename std::map<T, SampleAbundances>::const_iterator ab_it =
292 abundances.begin(); ab_it != abundances.end(); ++ab_it)
295 for (SampleAbundances::const_iterator samp_it = ab_it->second.begin();
296 samp_it != ab_it->second.end(); ++samp_it)
298 total += samp_it->second;
300 if (total <= 0.0)
continue;
301 PairType key = std::make_pair(ab_it->second.size(), total);
302 order.insert(std::make_pair(key, ab_it->first));
305 for (
typename std::multimap<PairType, T, std::greater<PairType> >::
306 iterator ord_it = order.begin(); ord_it != order.end(); ++ord_it)
308 result.push_back(ord_it->second);
317 void normalizePeptides_();
331 String getAccession_(
const std::set<String>& pep_accessions,
332 std::map<String, String>& accession_to_leader);
339 void countPeptides_(std::vector<PeptideIdentification>& peptides);
342 void updateMembers_()
override;
ProteinData()
constructor
Definition: PeptideAndProteinQuant.h:97
Representation of the Experimental Design in OpenMS. Instances can be loaded via the ExperimentalDesi...
Definition: ExperimentalDesign.h:85
Statistics for processing summary.
Definition: PeptideAndProteinQuant.h:105
Statistics()
constructor
Definition: PeptideAndProteinQuant.h:126
ProteinQuant prot_quant_
Protein quantification data.
Definition: PeptideAndProteinQuant.h:206
SampleAbundances total_abundances
mapping: sample -> total abundance
Definition: PeptideAndProteinQuant.h:68
PeptideQuant pep_quant_
Peptide quantification data.
Definition: PeptideAndProteinQuant.h:203
A more convenient string class.
Definition: String.h:58
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
SampleAbundances total_abundances
mapping: sample -> total abundance
Definition: PeptideAndProteinQuant.h:91
~PeptideAndProteinQuant() override
Destructor.
Definition: PeptideAndProteinQuant.h:136
std::set< String > accessions
protein accessions for this peptide
Definition: PeptideAndProteinQuant.h:71
Size total_features
Definition: PeptideAndProteinQuant.h:123
Size n_samples
number of samples (or assays in mzTab terms)
Definition: PeptideAndProteinQuant.h:108
Representation of a protein identification run.
Definition: ProteinIdentification.h:71
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Size n_ms_files
number of MS files
Definition: PeptideAndProteinQuant.h:114
PeptideData()
constructor
Definition: PeptideAndProteinQuant.h:77
std::map< Int, std::map< Int, SampleAbundances > > abundances
mapping: fraction -> charge -> sample -> abundance
Definition: PeptideAndProteinQuant.h:65
std::map< UInt64, double > SampleAbundances
Mapping: sample ID -> abundance.
Definition: PeptideAndProteinQuant.h:59
Quantitative and associated data for a protein.
Definition: PeptideAndProteinQuant.h:85
void orderBest_(const std::map< T, SampleAbundances > &abundances, std::vector< T > &result)
Order keys (charges/peptides for peptide/protein quantification) according to how many samples they a...
Definition: PeptideAndProteinQuant.h:286
A container for consensus elements.
Definition: ConsensusMap.h:79
Size id_count
total number of identifications (of peptides mapping to this protein)
Definition: PeptideAndProteinQuant.h:94
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Size n_fractions
number of fractions
Definition: PeptideAndProteinQuant.h:111
A container for features.
Definition: FeatureMap.h:95
Representation of a Peak2D, RichPeak2D or Feature .
Definition: FeatureHandle.h:57
bool getBest_(const std::map< Int, std::map< Int, SampleAbundances >> &peptide_abundances, std::pair< size_t, size_t > &best)
Determine fraction and charge state of a peptide with the highest number of abundances.
Definition: PeptideAndProteinQuant.h:237
Size id_count
number of identifications
Definition: PeptideAndProteinQuant.h:74
Size too_few_peptides
Definition: PeptideAndProteinQuant.h:117
Statistics stats_
Processing statistics for output in the end.
Definition: PeptideAndProteinQuant.h:200
std::map< String, ProteinData > ProteinQuant
Mapping: protein accession -> protein data.
Definition: PeptideAndProteinQuant.h:102
Quantitative and associated data for a peptide.
Definition: PeptideAndProteinQuant.h:62
Size total_peptides
Definition: PeptideAndProteinQuant.h:120
std::map< AASequence, PeptideData > PeptideQuant
Mapping: peptide sequence (modified) -> peptide data.
Definition: PeptideAndProteinQuant.h:82
Representation of a peptide hit.
Definition: PeptideHit.h:54
Helper class for peptide and protein quantification based on feature data annotated with IDs.
Definition: PeptideAndProteinQuant.h:53
std::map< String, SampleAbundances > abundances
mapping: peptide (unmodified) -> sample -> abundance
Definition: PeptideAndProteinQuant.h:88