本文整理汇总了C++中Spectrum::getPeptide方法的典型用法代码示例。如果您正苦于以下问题:C++ Spectrum::getPeptide方法的具体用法?C++ Spectrum::getPeptide怎么用?C++ Spectrum::getPeptide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spectrum
的用法示例。
在下文中一共展示了Spectrum::getPeptide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: learnPrmNormalizerValue
void PrmNodeScoreModel::learnPrmNormalizerValue(void* allScoreModelsVoidPointer, const SpectraAggregator& sa)
{
AllScoreModels* allScoreModels = static_cast<AllScoreModels*>(allScoreModelsVoidPointer);
const float step = 0.5;
const float min_delta = -1.0;
const float max_delta = 7.0;
const float target_mid_ratio = 0.96;
const float target_side_ratio = 0.94;
config_->set_use_spectrum_charge(1);
regional_prm_normalizers.resize(RegionalPrmNodeScoreModels_.size());
int c;
for (c=0; c<RegionalPrmNodeScoreModels_.size(); c++)
{
regional_prm_normalizers[c].resize(RegionalPrmNodeScoreModels_[c].size());
int s;
for (s=0; s<RegionalPrmNodeScoreModels_[c].size(); s++)
regional_prm_normalizers[c][s].resize(RegionalPrmNodeScoreModels_[c][s].size(),0);
}
const vector< vector<mass_t> >& mass_threshes = config_->get_size_thresholds();
for (c=1; c<regional_prm_normalizers.size(); c++)
{
int s;
for (s=0; s<regional_prm_normalizers[c].size(); s++)
{
const mass_t min_mass = (s == 0 ? 0 : mass_threshes[c][s-1]);
const mass_t max_mass = mass_threshes[c][s];
const int num_regions = regional_prm_normalizers[c][s].size();
cout << "Finding normalizers for charge " << c << " size " << s << " (masses " << min_mass << " - " <<
max_mass << ")" << endl;
SpectraList sl(sa);
sl.selectHeaders(min_mass/c,max_mass/c,c,c);
sl.randomlyReduceListToSize(2000);
if (sl.getNumHeaders()<50)
{
cout << "Insufficient number of spectra... skipping" << endl;
continue;
}
vector< vector< NodeType > > all_prms;
int sc;
for (sc=0; sc<sl.getNumHeaders(); sc++)
{
const SingleSpectrumHeader* header = sl.getSpectrumHeader(sc);
PrmGraph prm;
Spectrum s;
if (! s.readSpectrum(sa, header))
continue;
vector<mass_t> pms_with_19;
vector<int> charges;
// output m/z and prob values for the different charge states
allScoreModels->selectPrecursorMassesAndCharges(config_, s, pms_with_19, charges);
if (pms_with_19.size()<=0)
continue;
s.setCharge(charges[0]);
prm.create_graph_from_spectrum(allScoreModels, &s,pms_with_19[0]);
vector<NodeType> spec_prms;
vector<mass_t> exp_masses;
const mass_t true_mass_with_19 = s.get_true_mass_with_19();
s.getPeptide().calc_expected_breakage_masses(config_,exp_masses);
int i;
for (i=1; i<prm.get_num_nodes()-1; i++)
{
const Node& node = prm.get_node(i);
if (node.score == 0)
continue;
NodeType nt;
nt.type = 0;
int j;
for (j=0; j<exp_masses.size(); j++)
if (fabs(exp_masses[j]-node.mass)<config_->getTolerance())
{
nt.type=1;
break;
}
if (nt.type<=0)
{
int j;
for (j=0; j<exp_masses.size(); j++)
if (fabs(true_mass_with_19 - exp_masses[j] -node.mass-MASS_PROTON)<config_->getTolerance())
{
nt.type=2;
break;
}
//.........这里部分代码省略.........