本文整理汇总了C++中DistanceMatrix::getAtomVector方法的典型用法代码示例。如果您正苦于以下问题:C++ DistanceMatrix::getAtomVector方法的具体用法?C++ DistanceMatrix::getAtomVector怎么用?C++ DistanceMatrix::getAtomVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DistanceMatrix
的用法示例。
在下文中一共展示了DistanceMatrix::getAtomVector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printCompareInfo
//must add segID
void DistanceMatrix::printCompareInfo(DistanceMatrix &_distMat, pair<vector<int>, double> _result, int choice){
//retrieve values from the pair
vector<int> mwIndex(2, 0.0);
mwIndex= _result.first;
double minLikeness = _result.second;
//retrieve the winning Matrix Windows
vector<MatrixWindow*> listMW2 = _distMat.getMatrixWindows();
MatrixWindow *minWindow1 = listMW[mwIndex[0]];
MatrixWindow *minWindow2 = listMW2[mwIndex[1]];
//print information
int i1 = (*minWindow1).getLeftR();
int j1 = (*minWindow1).getLeftC();
int i2 = (*minWindow2).getLeftR();
int j2 = (*minWindow2).getLeftC();
string i1ID = atomVec[i1]->getSegID().c_str();
string j1ID = atomVec[j1]->getSegID().c_str();
string i2ID = _distMat.getAtomVector()[i2]->getSegID().c_str();
string j2ID = _distMat.getAtomVector()[j2]->getSegID().c_str();
if(i1ID=="" || j1ID=="" || i2ID=="" ||j2ID==""){
i1ID = atomVec[i1]->getChainId().c_str();
j1ID = atomVec[j1]->getChainId().c_str();
i2ID = _distMat.getAtomVector()[i2]->getChainId().c_str();
j2ID = _distMat.getAtomVector()[j2]->getChainId().c_str();
}
int i1res = atomVec[i1]->getResidueNumber();
int j1res = atomVec[j1]->getResidueNumber();
int i2res = _distMat.getAtomVector()[i2]->getResidueNumber();
int j2res = _distMat.getAtomVector()[j2]->getResidueNumber();
string PDBname= getFileName(PDBid);
string PDBnameShort = PDBname.substr(0,17);
string PDBname2 = getFileName(_distMat.getPDBid());
string PDBnameShort2 = PDBname2.substr(0,17);
cout<<"Comparing PDBs "<<PDBnameShort<<", "<<PDBnameShort2<<endl;
switch(choice){
case standard:
fprintf(stdout, "Standard compare:\t\tWindow1 %3d,%3d (Residues: %1s%3d, %1s%3d)\tWindow2 %3d,%3d (Residues: %1s%3d, %1s%3d)\t%8.3f\n", i1, j1, i1ID.c_str(), i1res, j1ID.c_str(), j1res, i2, j2, i2ID.c_str(), i2res, j2ID.c_str(), j2res, minLikeness);
break;
case diag:
fprintf(stdout, "Diagonal compare: \t\tWindow1 %3d,%3d (Residues: %1s%3d, %1s%3d)\tWindow2 %3d,%3d (Residues: %1s%3d, %1s%3d)\t%8.3f\n", i1, j1, i1ID.c_str(), i1res, j1ID.c_str(), j1res, i2, j2, i2ID.c_str(), i2res, j2ID.c_str(), j2res, minLikeness);
break;
case doubleDiag:
fprintf(stdout, "Double Diagonal compare: \tWindow1 %3d,%3d (Residues: %1s%3d, %1s%3d)\tWindow2 %3d,%3d (Residues: %1s%3d, %1s%3d)\t%8.3f\n", i1, j1, i1ID.c_str(), i1res, j1ID.c_str(), j1res, i2, j2, i2ID.c_str(), i2res, j2ID.c_str(), j2res, minLikeness);
break;
case minDist:
fprintf(stdout, "Minimum Distance compare: \tWindow1 %3d,%3d (Residues: %1s%3d, %1s%3d)\tWindow2 %3d,%3d (Residues: %1s%3d, %1s%3d)\t%8.3f\n", i1, j1, i1ID.c_str(), i1res, j1ID.c_str(), j1res, i2, j2, i2ID.c_str(), i2res, j2ID.c_str(), j2res, minLikeness);
break;
case minDistRow:
fprintf(stdout, "Minimum Distance Row compare: \tWindow1 %3d,%3d (Residues: %1s%3d, %1s%3d)\tWindow2 %3d,%3d (Residues: %1s%3d, %1s%3d)\t%8.3f\n", i1, j1, i1ID.c_str(), i1res, j1ID.c_str(), j1res, i2, j2, i2ID.c_str(), i2res, j2ID.c_str(), j2res, minLikeness);
break;
case minDistCol:
fprintf(stdout, "Minimum Distance Column compare: \tWindow1 %3d,%3d (Residues: %1s%3d, %1s%3d)\tWindow2 %3d,%3d (Residues: %1s%3d, %1s%3d)\t%8.3f\n", i1, j1, i1ID.c_str(), i1res, j1ID.c_str(), j1res, i2, j2, i2ID.c_str(), i2res, j2ID.c_str(), j2res, minLikeness);
break;
default:
cout<<"Error. Incorrect int value (choice) in DistanceMatrix::printCompareInfo(...)"<<endl;
exit(334);
}//end switch
}
示例2: currentResult
vector<DistanceMatrixResult> DistanceMatrix::multiCompareAllWindows(DistanceMatrix &_distMat, int choice, int _numCompare){
/*
//which chains to skip:
map<string, bool> forbiddenIDMat1;
map<string, bool> forbiddenIDMat2;
// Maintain the proper spacing between residues of different matrix window pairs.
map<string,int> properRegisterRow;
map<string,int> properRegisterCol;
map<string,int>::iterator findRegistry;
*/
//get list of MWs to compare
vector<MatrixWindow*> listOther = _distMat.getMatrixWindows();
int length = listMW.size();
int lengthOther = listOther.size();
//vector of objects to return
vector<DistanceMatrixResult> returnVec;
//loop over number of times to compare all
for(int k=0; k<_numCompare; k++){
//minimum windows and indices
MatrixWindow *minWindow1 = NULL;
MatrixWindow *minWindow2 = NULL;
double minLikeness = 1000000;
int minIndex1=0;
int minIndex2=0;
//IDs to skip in the future
string i1IDWin;
string j1IDWin;
string i2IDWin;
string j2IDWin;
//which chains to skip:
map<string, bool> forbiddenIDMat1;
map<string, bool> forbiddenIDMat2;
// Maintain the proper spacing between residues of different matrix window pairs.
map<string,int> properRegisterRow;
map<string,int> properRegisterCol;
map<string,int>::iterator findRegistry;
for (int i =0; i<length; i++){//loops through listMW to get compare
MatrixWindow *win1 = listMW[i];
for (int j=0; j<lengthOther; j++){//loops through listOther to get comparor
MatrixWindow *win2 = listOther[j];
//get the ID (seg or chain) so we can filter ones we want to skip
int i1 = win1->getLeftR();
int j1 = win1->getLeftC();
int i2 = win2->getLeftR();
int j2 = win2->getLeftC();
string i1ID = atomVec[i1]->getSegID();
string j1ID = atomVec[j1]->getSegID();
string i2ID = _distMat.getAtomVector()[i2]->getSegID();
string j2ID = _distMat.getAtomVector()[j2]->getSegID();
if(i1ID=="" || j1ID=="" || i2ID=="" ||j2ID==""){
i1ID = atomVec[i1]->getChainId();
j1ID = atomVec[j1]->getChainId();
i2ID = _distMat.getAtomVector()[i2]->getChainId();
j2ID = _distMat.getAtomVector()[j2]->getChainId();
}//end if
// Skip if both chains are forbidden within a matrix
if (forbiddenIDMat1.find(i1ID+":"+j1ID)!=forbiddenIDMat1.end() || forbiddenIDMat2.find(i2ID+":"+j2ID)!=forbiddenIDMat2.end()) continue;
// Skip if both inter-matrix segids found and if difference in residue number is not the same.
findRegistry = properRegisterRow.find(i1ID+":"+i2ID);
double diffInResidueNumber = atomVec[i1]->getResidueNumber() - _distMat.getAtomVector()[i2]->getResidueNumber();
if (findRegistry != properRegisterRow.end() && findRegistry->second != diffInResidueNumber) continue;
findRegistry = properRegisterCol.find(j1ID+":"+j2ID);
diffInResidueNumber = atomVec[j1]->getResidueNumber() - _distMat.getAtomVector()[j2]->getResidueNumber();
if (findRegistry != properRegisterCol.end() && findRegistry->second != diffInResidueNumber) continue;
double likeness;
//decides which compare method from MatrixWindow to call
switch(choice){
case standard:
likeness = (*win1).compare((*win2));
break;
case diag:
likeness = (*win1).compareDiagonal((*win2));
break;
case doubleDiag:
likeness = (*win1).compareDoubleDiagonal((*win2));
break;
case minDist:
//.........这里部分代码省略.........