本文整理汇总了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;
}