本文整理汇总了C++中Spectrum::get_peptide方法的典型用法代码示例。如果您正苦于以下问题:C++ Spectrum::get_peptide方法的具体用法?C++ Spectrum::get_peptide怎么用?C++ Spectrum::get_peptide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spectrum
的用法示例。
在下文中一共展示了Spectrum::get_peptide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: learn_prm_normalizer_values
void AdvancedScoreModel::learn_prm_normalizer_values(const FileManager& fm)
{
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(regional_breakage_score_models.size());
int c;
for (c=0; c<regional_breakage_score_models.size(); c++)
{
regional_prm_normalizers[c].resize(regional_breakage_score_models[c].size());
int s;
for (s=0; s<regional_breakage_score_models[c].size(); s++)
regional_prm_normalizers[c][s].resize(regional_breakage_score_models[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;
FileSet fs;
BasicSpecReader bsr;
fs.select_files_in_mz_range(fm,min_mass/c,max_mass/c,c);
fs.randomly_reduce_ssfs(2000);
vector< vector< NodeType > > all_prms;
const vector<SingleSpectrumFile *>& all_ssf = fs.get_ssf_pointers();
if (fs.get_total_spectra()<50)
{
cout << "Insufficient number of spectra... skipping" << endl;
continue;
}
int sc;
for (sc=0; sc<all_ssf.size(); sc++)
{
PrmGraph prm;
static vector<QCPeak> peaks;
SingleSpectrumFile *ssf = all_ssf[sc];
if (peaks.size()<ssf->num_peaks)
{
int new_size = ssf->num_peaks*2;
if (new_size<2500)
new_size=2500;
peaks.resize(new_size);
}
const int num_peaks = bsr.read_basic_spec(&config,fm,ssf,&peaks[0]);
if (num_peaks<5)
continue;
// convert peak list ot a spectrum with charge (if original charge ==0)
// the spectrum gets charge 2, but the true charge is computed from the data
Spectrum s;
s.init_from_QCPeaks(&config,&peaks[0],num_peaks,ssf);
vector<mass_t> pms_with_19;
vector<int> charges;
pms_with_19.clear();
charges.clear();
BasicSpectrum bs;
bs.ssf = ssf;
bs.peaks = &peaks[0];
bs.num_peaks = num_peaks;
// output m/z and prob values for the different charge states
select_pms_and_charges(&config,bs,pms_with_19,charges);
if (pms_with_19.size()<=0)
continue;
s.set_charge(charges[0]);
init_model_for_scoring_spectrum(&s);
prm.create_graph_from_spectrum(this,&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.get_peptide().calc_expected_breakage_masses(&config,exp_masses);
//.........这里部分代码省略.........