本文整理汇总了C++中DistanceMatrix::setGeneralWinSize方法的典型用法代码示例。如果您正苦于以下问题:C++ DistanceMatrix::setGeneralWinSize方法的具体用法?C++ DistanceMatrix::setGeneralWinSize怎么用?C++ DistanceMatrix::setGeneralWinSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DistanceMatrix
的用法示例。
在下文中一共展示了DistanceMatrix::setGeneralWinSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]){
// Option Parser
Options opt = setupOptions(argc,argv);
ifstream fs2;
//create system and dm for first PDB
PDBReader reader;
reader.open(opt.inputPDB);
reader.read();
reader.close();
System *constSys = new System(reader.getAtoms());
DistanceMatrix constDM;
//add CA atoms to the atom vectors
for (int j=0; j<constSys->residueSize(); j++){
Residue &tempRes=constSys->getResidue(j);
if (tempRes.exists("CA")){
constDM.addAtom(tempRes("CA"));
}
}//end for on j
//fill the DistanceMatrix and set window size
constDM.setGeneralWinSize(opt.windowSize);
constDM.createDistanceMatrix();
constDM.setIntraChain(opt.intraChainCompare);
constDM.setPDBid(opt.inputPDB);
constDM.setDebug(opt.debug);
//create matrix windows
constDM.createMatrixWindows();
delete(constSys);
if (constDM.getMatrixWindows().size()==0){
cout<<"Uh-oh.All the windows got filtered in the PDB you wanted to compare against."<<endl;
exit(111);
}
// COMMMENT OUT BEGINS
/*
//read in list of PDBs to compare to first PDB
vector<string> list;
ifstream fs;
fs.open(opt.pdbList.c_str());
if (fs.fail()){
cerr<<"Cannot open file "<<opt.pdbList<<endl;
exit(1);
}
while(true){
string line;
getline(fs, line);
if(fs.fail()){
//no more lines to read, quite the while.
break;
}
if(line==""){
continue;
}
list.push_back(line);
}
fs.close();
// List of distance matrices, one for each PDB
vector<DistanceMatrix> DMVec(list.size());
// A system object for each PDB
vector<System*> sysVec(list.size(), NULL);
// Create DistanceMatrix and System Objects for list of PDBs
for(int i=0; i<list.size(); i++){
cout<<i<<"create sys and dm."<<endl;
PDBReader rAv;
rAv.open(list[i]);
rAv.read();
rAv.close();
sysVec[i] =new System(rAv.getAtoms());
//add CA atoms to the atom vectors
for (int j=0; j<sysVec[i]->residueSize(); j++){
Residue &tempRes=sysVec[i]->getResidue(j);
if (tempRes.exists("CA")){
//only add CA if it is on a helix
string segID = tempRes("CA").getSegID();
//if(segID == "" || segID.at(0) == 'H'){
//.........这里部分代码省略.........