本文整理汇总了C++中PeakSpectrum::getIntegerDataArrays方法的典型用法代码示例。如果您正苦于以下问题:C++ PeakSpectrum::getIntegerDataArrays方法的具体用法?C++ PeakSpectrum::getIntegerDataArrays怎么用?C++ PeakSpectrum::getIntegerDataArrays使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PeakSpectrum
的用法示例。
在下文中一共展示了PeakSpectrum::getIntegerDataArrays方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mergeAnnotatedSpectra
PeakSpectrum theo_spec_1, theo_spec_2, exp_spec_1, exp_spec_2;
specGen.getCommonIonSpectrum(exp_spec_1, AASequence::fromString("PEPTIDE"), 2, true, 3);
specGen.getCommonIonSpectrum(exp_spec_2, AASequence::fromString("PEPTEDI"), 3, true, 3);
param.setValue("add_metainfo", "true");
specGen.setParameters(param);
specGen.getCommonIonSpectrum(theo_spec_1, AASequence::fromString("PEPTIDE"), 3, true, 3);
specGen.getCommonIonSpectrum(theo_spec_2, AASequence::fromString("PEPTEDI"), 4, true, 3);
START_SECTION(static PeakSpectrum mergeAnnotatedSpectra(PeakSpectrum & first_spectrum, PeakSpectrum & second_spectrum))
PeakSpectrum merged_spec = OPXLSpectrumProcessingAlgorithms::mergeAnnotatedSpectra(theo_spec_1, theo_spec_2);
TEST_EQUAL(merged_spec.size(), 36)
TEST_EQUAL(merged_spec.getIntegerDataArrays().size(), 1)
TEST_EQUAL(merged_spec.getIntegerDataArrays()[0].size(), 36)
TEST_EQUAL(merged_spec.getStringDataArrays()[0].size(), 36)
TEST_EQUAL(merged_spec.getIntegerDataArrays()[0][10], 3)
TEST_EQUAL(merged_spec.getStringDataArrays()[0][10], "[alpha|ci$y2]")
TEST_EQUAL(merged_spec.getIntegerDataArrays()[0][20], 2)
TEST_EQUAL(merged_spec.getStringDataArrays()[0][20], "[alpha|ci$y2]")
TEST_REAL_SIMILAR(merged_spec[10].getMZ(), 83.04780)
TEST_REAL_SIMILAR(merged_spec[20].getMZ(), 132.04732)
for (Size i = 0; i < merged_spec.size()-1; ++i)
{
TEST_EQUAL(merged_spec[i].getMZ() <= merged_spec[i+1].getMZ(), true)
}
END_SECTION
示例2: String
String XQuestResultXMLFile::getxQuestBase64EncodedSpectrum_(const PeakSpectrum& spec, String header)
{
std::vector<String> in_strings;
StringList sl;
double precursor_mz = 0;
double precursor_z = 0;
if (spec.getPrecursors().size() > 0)
{
precursor_mz = Math::roundDecimal(spec.getPrecursors()[0].getMZ(), -9);
precursor_z = spec.getPrecursors()[0].getCharge();
}
// header lines
if (!header.empty()) // common or xlinker spectrum will be reported
{
sl.push_back(header + "\n"); // e.g. GUA1372-S14-A-LRRK2_DSS_1A3.03873.03873.3.dta,GUA1372-S14-A-LRRK2_DSS_1A3.03863.03863.3.dta
sl.push_back(String(precursor_mz) + "\n");
sl.push_back(String(precursor_z) + "\n");
}
else // light or heavy spectrum will be reported
{
sl.push_back(String(precursor_mz) + "\t" + String(precursor_z) + "\n");
}
PeakSpectrum::IntegerDataArray charges;
if (spec.getIntegerDataArrays().size() > 0)
{
charges = spec.getIntegerDataArrays()[0];
}
// write peaks
for (Size i = 0; i != spec.size(); ++i)
{
String s;
s += String(Math::roundDecimal(spec[i].getMZ(), -9)) + "\t";
s += String(spec[i].getIntensity()) + "\t";
if (charges.size() > 0)
{
s += String(charges[i]);
}
else
{
s += "0";
}
s += "\n";
sl.push_back(s);
}
String out;
out.concatenate(sl.begin(), sl.end(), "");
in_strings.push_back(out);
String out_encoded;
Base64().encodeStrings(in_strings, out_encoded, false, false);
String out_wrapped;
wrap_(out_encoded, 76, out_wrapped);
return out_wrapped;
}
示例3: min
ptr->load();
ptr->simulate(spec, peptide, rnd_gen, 1);
PeakMap exp;
MzMLFile mz_file;
#if OPENMS_BOOST_VERSION_MINOR < 56
mz_file.load(OPENMS_GET_TEST_DATA_PATH("SvmTheoreticalSpectrumGenerator_test.mzML"),exp);
TEST_EQUAL(spec.size(), 7);
#else
mz_file.load(OPENMS_GET_TEST_DATA_PATH("SvmTheoreticalSpectrumGenerator_test_boost58.mzML"),exp);
TEST_EQUAL(spec.size(), 8);
// the extra peak:
TEST_EQUAL(spec.getStringDataArrays()[0][2], "YIon 0++") // TODO: ion_nr is always zero, its actually y4++
TEST_EQUAL(spec.getIntegerDataArrays()[0][2], 2)
#endif
TEST_EQUAL(exp.size(), 1);
if(exp.size())
{
TEST_EQUAL(spec.size(), exp[0].size());
Size min_size = min(spec.size(), exp[0].size());
for(Size i = 0; i<min_size; ++i)
{
TEST_REAL_SIMILAR(spec[i].getPosition()[0],(exp[0][i]).getPosition()[0]);
TEST_REAL_SIMILAR(spec[i].getIntensity(),(exp[0][i]).getIntensity());
}
}
END_SECTION