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


C++ PDBFile::bad方法代码示例

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


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

示例1: main

int main(int argc, char** argv)
{

    if (argc != 3)
    {
        Log << "Usage:" << argv[0] << " <PDB infile> <PDB outfile> [<amber parameter file>]" << endl;

        return 1;
    }

    System system;

    PDBFile f;
    f.open(argv[1]);
    if (f.bad())
    {
        Log.error() << "cannot read PDB file " << argv[1] << endl;
        return 2;
    }
    f >> system;
    f.close();

    FragmentDB db("");

    // ResidueChecker check(db);
    // system.apply(check);


    db.normalize_names.setNamingStandard("Amber");
    system.apply(db.normalize_names);

    system.apply(db.build_bonds);

    Size cyx_counter = 0;
    Size hip_counter = 0;

    ResidueIterator it = system.beginResidue();
    for (; +it; ++it)
    {
        if (it->getFullName() == "CYS-S")
        {
            it->setName("CYX");
            cyx_counter++;
        }
        if (it->getFullName() == "HIS")
        {
            it->setName("HIP");
            hip_counter++;
        }
    }

    if (cyx_counter > 0)
    {
        Log.info() << "Renamed " << cyx_counter << " residues from CYS-S to CYX"
                   << endl;
    }

    if (hip_counter > 0)
    {
        Log.info() << "Renamed " << hip_counter << " residues from HIS to HIP"
                   << endl;
    }

    PDBFile g;
    g.open(argv[2], ios::out);
    if (g.bad())
    {
        Log.error() << "cannot write PDB file " << argv[2] << endl;
        return 2;
    }


    g << system;
    g.close();

    Log.info()
            << endl
            << "Conversion to AMBER naming scheme done. Please note that you might"
            << endl
            << "have to edit the resulting file by hand (if there are HIS or CYS"
            << endl
            << "residues in the original file, e. g.)"
            << endl
            << endl
            << "Good luck."
            << endl;

}
开发者ID:pbrach,项目名称:ball,代码行数:88,代码来源:pdb2amber_naming.C


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