本文整理汇总了C++中Topology::ResetPDBinfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Topology::ResetPDBinfo方法的具体用法?C++ Topology::ResetPDBinfo怎么用?C++ Topology::ResetPDBinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Topology
的用法示例。
在下文中一共展示了Topology::ResetPDBinfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// ----- M A I N ---------------------------------------------------------------
int main(int argc, char** argv) {
SetWorldSilent(true); // No STDOUT output from cpptraj routines.
std::string topname, crdname, title, bres, pqr, sybyltype, writeconect;
std::string aatm(" pdbatom"), ter_opt(" terbyres"), box(" sg \"P 1\"");
TrajectoryFile::TrajFormatType fmt = TrajectoryFile::PDBFILE;
bool ctr_origin = false;
bool useExtendedInfo = false;
int res_offset = 0;
int debug = 0;
int numSoloArgs = 0;
for (int i = 1; i < argc; ++i) {
std::string arg( argv[i] );
if (arg == "-p" && i+1 != argc && topname.empty()) // Topology
topname = std::string( argv[++i] );
else if (arg == "-c" && i+1 != argc && crdname.empty()) // Coords
crdname = std::string( argv[++i] );
else if (arg == "-tit" && i+1 != argc && title.empty()) // Title
title = " title " + std::string( argv[++i] );
else if (arg == "-offset" && i+1 != argc) // Residue # offset
res_offset = convertToInteger( argv[++i] );
else if ((arg == "-d" || arg == "--debug") && i+1 != argc) // Debug level
debug = convertToInteger( argv[++i] );
else if (arg == "-h" || arg == "--help") { // Help
Help(argv[0], true);
return 0;
} else if (arg == "-v" || arg == "--version") { // Version info
WriteVersion();
return 0;
} else if (arg == "-aatm") // Amber atom names, include extra pts
aatm.assign(" include_ep");
else if (arg == "-sybyl") // Amber atom types to SYBYL
sybyltype.assign(" sybyltype");
else if (arg == "-conect") // Write CONECT records from bond info
writeconect.assign(" conect");
else if (arg == "-ep") // PDB atom names, include extra pts
aatm.append(" include_ep");
else if (arg == "-bres") // PDB residue names
bres.assign(" pdbres");
else if (arg == "-ext") // Use extended PDB info from Topology
useExtendedInfo = true;
else if (arg == "-ctr") // Center on origin
ctr_origin = true;
else if (arg == "-noter") // No TER cards
ter_opt.assign(" noter");
else if (arg == "-nobox") // No CRYST1 record
box.assign(" nobox");
else if (arg == "-pqr") { // Charge/Radii in occ/bfactor cols
pqr.assign(" dumpq");
++numSoloArgs;
} else if (arg == "-mol2") { // output as mol2
fmt = TrajectoryFile::MOL2FILE;
++numSoloArgs;
} else if (Unsupported(arg)) {
mprinterr("Error: Option '%s' is not yet supported.\n\n", arg.c_str());
return 1;
} else {
mprinterr("Error: Unrecognized option '%s'\n", arg.c_str());
Help(argv[0], false);
return 1;
}
}
if (debug > 0) WriteVersion();
// Check command line for errors.
if (topname.empty()) topname.assign("prmtop");
if (debug > 0 && crdname.empty())
mprinterr("| Reading Amber restart from STDIN\n");
if (numSoloArgs > 1) {
mprinterr("Error: Only one alternate output format option may be specified (found %i)\n",
numSoloArgs);
Help(argv[0], true);
return 1;
}
if (!sybyltype.empty() && fmt != TrajectoryFile::MOL2FILE) {
mprinterr("Warning: -sybyl is only valid for MOL2 file output.\n");
sybyltype.clear();
}
if (debug > 0) {
mprinterr("Warning: debug is %i; debug info will be written to STDOUT.\n", debug);
SetWorldSilent(false);
}
// Topology
ParmFile pfile;
Topology parm;
if (pfile.ReadTopology(parm, topname, debug)) {
if (topname == "prmtop") Help(argv[0], false);
return 1;
}
if (!useExtendedInfo)
parm.ResetPDBinfo();
if (res_offset != 0)
for (int r = 0; r < parm.Nres(); r++)
parm.SetRes(r).SetOriginalNum( parm.Res(r).OriginalResNum() + res_offset );
ArgList trajArgs;
// Input coords
Frame TrajFrame;
CoordinateInfo cInfo;
if (!crdname.empty()) {
Trajin_Single trajin;
if (trajin.SetupTrajRead(crdname, trajArgs, &parm)) return 1;
//.........这里部分代码省略.........