当前位置: 首页>>代码示例>>C++>>正文


C++ System::String方法代码示例

本文整理汇总了C++中System::String方法的典型用法代码示例。如果您正苦于以下问题:C++ System::String方法的具体用法?C++ System::String怎么用?C++ System::String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System的用法示例。


在下文中一共展示了System::String方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test

void test()
{
    unit_assert_operator_equal(Site::Any, unimod::site('x'));
    unit_assert_operator_equal(Site::Any, unimod::site('X'));
    unit_assert_operator_equal(Site::NTerminus, unimod::site('n'));
    unit_assert_operator_equal(Site::CTerminus, unimod::site('c'));
    unit_assert_operator_equal(Site::Alanine, unimod::site('A'));
    unit_assert_operator_equal(Site::Tyrosine, unimod::site('Y'));
    unit_assert_operator_equal((Site::Asparagine | Site::AsparticAcid), unimod::site('B'));
    unit_assert_operator_equal((Site::Glutamine | Site::GlutamicAcid), unimod::site('Z'));
    unit_assert_throws_what(unimod::site('1'), ArgumentException, "[unimod::site] invalid symbol");
    unit_assert_throws_what(unimod::site('z'), ArgumentException, "[unimod::site] invalid symbol");


    //unit_assert_operator_equal(Position::Anywhere, unimod::position());
    unit_assert_operator_equal(Position::AnyNTerminus, unimod::position(CVID::MS_modification_specificity_N_term));
    unit_assert_operator_equal(Position::AnyCTerminus, unimod::position(CVID::MS_modification_specificity_C_term));
    unit_assert_throws_what(unimod::position(CVID::MS_ion_trap), ArgumentException, "[unimod::position] invalid cvid");


    //if (os_) *os_ << "Unimod entries: " << modifications()->Count << endl;
    unit_assert(unimod::modifications()->Count > 500);


    Modification^ acetyl = unimod::modification("Acetyl");
    unit_assert_operator_equal(CVID::UNIMOD_Acetyl, acetyl->cvid);
    //unit_assert_operator_equal(&acetyl, &unimod::modification(CVID::UNIMOD_Acetyl));
    unit_assert_string_operator_equal(gcnew String("Acetyl"), acetyl->name);
    unit_assert(acetyl->approved);
    unit_assert_string_operator_equal(gcnew String("C2H2O1"), acetyl->deltaComposition->formula());
    unit_assert_operator_equal(8, acetyl->specificities->Count);

    unit_assert_operator_equal(Site::Lysine, acetyl->specificities->default[0]->site);
    unit_assert_operator_equal(Position::Anywhere, acetyl->specificities->default[0]->position);
    unit_assert_operator_equal(false, acetyl->specificities->default[0]->hidden);
    unit_assert_operator_equal(Classification::Multiple, acetyl->specificities->default[0]->classification);

    unit_assert_operator_equal(Site::NTerminus, acetyl->specificities->default[1]->site);
    unit_assert_operator_equal(Position::AnyNTerminus, acetyl->specificities->default[1]->position);
    unit_assert_operator_equal(false, acetyl->specificities->default[1]->hidden);
    unit_assert_operator_equal(Classification::Multiple, acetyl->specificities->default[1]->classification);

    unit_assert_operator_equal(Site::Cysteine, acetyl->specificities->default[2]->site);
    unit_assert_operator_equal(Position::Anywhere, acetyl->specificities->default[2]->position);
    unit_assert_operator_equal(true, acetyl->specificities->default[2]->hidden);
    unit_assert_operator_equal(Classification::PostTranslational, acetyl->specificities->default[2]->classification);

    unit_assert_operator_equal(Site::NTerminus, acetyl->specificities->default[4]->site);
    unit_assert_operator_equal(Position::ProteinNTerminus, acetyl->specificities->default[4]->position);
    unit_assert_operator_equal(false, acetyl->specificities->default[4]->hidden);
    unit_assert_operator_equal(Classification::PostTranslational, acetyl->specificities->default[4]->classification);

    unit_assert_operator_equal(CVID::UNIMOD_Acetyl, unimod::modifications(filter(acetyl->deltaMonoisotopicMass, 0))->default[0]->cvid);
    unit_assert_operator_equal(CVID::UNIMOD_Acetyl, unimod::modifications(filter(acetyl->deltaAverageMass, 0, false, indeterminate))->default[0]->cvid);

    // test a position-only filter
    unit_assert_operator_equal(1, unimod::modifications(filter(acetyl->deltaMonoisotopicMass, 0.5,
                                                               indeterminate, indeterminate,
                                                               Site::Any, Position::AnyNTerminus))->Count);
    unit_assert_operator_equal(CVID::UNIMOD_Acetyl, unimod::modifications(filter(acetyl->deltaMonoisotopicMass, 0.5,
                                                                                 indeterminate, indeterminate,
                                                                                 Site::Any, Position::AnyNTerminus))->default[0]->cvid);


    Modification^ hse = unimod::modification("Met->Hse");
    unit_assert_operator_equal(CVID::UNIMOD_Met__Hse, hse->cvid);
    unit_assert_string_operator_equal(gcnew String("Met->Hse"), hse->name);
    unit_assert(hse->approved);
    unit_assert_string_operator_equal(gcnew String("C-1H-2O1S-1"), hse->deltaComposition->formula());
    unit_assert_operator_equal(Site::Methionine, hse->specificities->default[0]->site);
    unit_assert_operator_equal(Position::AnyCTerminus, hse->specificities->default[0]->position);
    unit_assert_operator_equal(false, hse->specificities->default[0]->hidden);
    unit_assert_operator_equal(Classification::ChemicalDerivative, hse->specificities->default[0]->classification);


    Modification^ oxidation = unimod::modification(CVID::UNIMOD_Oxidation);

    // 3 mods have the same mass as oxidation
    unit_assert_operator_equal(3, unimod::modifications(filter(oxidation->deltaMonoisotopicMass, 0,
                                                               true, indeterminate))->Count);
    unit_assert_operator_equal(3, unimod::modifications(filter(oxidation->deltaAverageMass, 0,
                                                               false, indeterminate))->Count);

    // only one of those mods happen on Methionine
    unit_assert_operator_equal(1, unimod::modifications(filter(oxidation->deltaMonoisotopicMass, 0, true, indeterminate, Site::Methionine, Position::Anywhere))->Count);
    unit_assert_operator_equal(1, unimod::modifications(filter(oxidation->deltaAverageMass, 0, false, indeterminate, Site::Methionine, Position::Anywhere))->Count);

    // oxidation also happens on Proline (test multi-bit Site mask)
    unit_assert_operator_equal(1, unimod::modifications(filter(oxidation->deltaAverageMass, 0, false, indeterminate, Site::Methionine | Site::Proline, Position::Anywhere))->Count);

    // add Alanine as a site and it could be a substitution
    unit_assert_operator_equal(2, unimod::modifications(filter(oxidation->deltaAverageMass, 0, false, indeterminate, Site::Methionine | Site::Alanine, Position::Anywhere))->Count);


    // 18 mods are 28 +/- 1 (but 1 of them is an isotope label not yet supported)
    unit_assert_operator_equal(17, unimod::modifications(filter(28, 1, true, indeterminate))->Count);

    // only two of those mods happen post-translationally on protein N-termini
    unit_assert_operator_equal(2, unimod::modifications(filter(28, 1, true, indeterminate, Site::Any,
                                                               Position::ProteinNTerminus,
//.........这里部分代码省略.........
开发者ID:zjjyyang,项目名称:ftdr,代码行数:101,代码来源:UnimodTest.cpp


注:本文中的System::String方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。