Exemple #1
0
void DistanceMatrix::printCompareInfo(vector<double> _inputVec1, vector<double> _inputVec2, pair<int, double> _result, int choice){
    //retrieve values from the pair
    int index = _result.first;
    double minLikeness = _result.second;

   
    //retrieve the winning Matrix Window from listMW
    MatrixWindow *mw = listMW[index];

    //retrieve and print relevent info
    int i = mw->getLeftR();
    int j = mw->getLeftC();
   
    string iID = atomVec[i]->getSegID().c_str();
    string jID = atomVec[j]->getSegID().c_str();
    
    if(atomVec[i]->getSegID()==""){
	iID = atomVec[i]->getChainId().c_str();
	jID = atomVec[j]->getChainId().c_str();
    }
    
    int ires = atomVec[i]->getResidueNumber();
    int jres = atomVec[j]->getResidueNumber();

    string PDBname= getFileName(PDBid);
    string PDBnameShort = PDBname.substr(0,17);

	
    cout<<"Comparing with PDB "<<PDBnameShort<<endl;

    switch(choice){
	    case minRowWeighted: 
		fprintf(stdout, "MinRowWeighted compare: \tWindow %3d,%3d (Residues: %1s %3d, %1s %3d)\t%8.3f\n", i, j, iID.c_str(), ires, jID.c_str(), jres, minLikeness);
		break;
	    case minRowAndColWeighted:
		fprintf(stdout, "MinRowAndColWeighted compare: \tWindow %3d,%3d (Residues: %1s %3d, %1s %3d)\t%8.3f\n", i, j, iID.c_str(), ires, jID.c_str(), jres, minLikeness);
		break;
	    case correlation: 
		fprintf(stdout, "Correlation compare: \tWindow %3d,%3d (Residues: %1s %3d, %1s %3d)\t%8.3f\n", i, j, iID.c_str(), ires, jID.c_str(), jres, minLikeness);
		break;
	    case correlationRowCol:
		fprintf(stdout, "CorrelationRowCol compare: \tWindow %3d,%3d (Residues: %1s %3d, %1s %3d)\t%8.3f\n", i, j, iID.c_str(), ires, jID.c_str(), jres, minLikeness);
		break;
	    case correlationHeteroRowCol:
		fprintf(stdout, "CorrelationHeteroRowCol compare: \tWindow %3d,%3d (Residues: %1s %3d, %1s %3d)\t%8.3f\n", i, j, iID.c_str(), ires, jID.c_str(), jres, minLikeness);
		break;
	    default:
		cout<<"you suck! You f****d up printCompareInfo in DistanceMatrix--the one that takes the vector. S******d."<<endl;
		exit(3334);
    }//end switch	
	
    
    //print out the vectors we compared

    string label = "Weights:  ";
    if(weight.size() != 0){
        fprintf(stdout, "%-20s", label.c_str());
	for (uint i = 0; i < weight.size();i++){
	fprintf(stdout, "%8.3f, ", weight[i]);
    }
    fprintf(stdout, "\n");

    }
    label = "DistVectRow: ";
    fprintf(stdout, "%-20s", label.c_str());
    for (uint i = 0; i < _inputVec1.size();i++){
	fprintf(stdout, "%8.3f, ", _inputVec1[i]);
    }
    fprintf(stdout, "\n");

    //print row vector and correlation
    label = "RowsVect:";
    fprintf(stdout, "%-20s", label.c_str());
    vector<double> minRowValues = mw->getMinRowValues();

    for (int i=0; i<minRowValues.size(); i++){
	fprintf(stdout, "%8.3f, ", minRowValues[i]);
    }
    fprintf(stdout,"\n");
    if(choice != correlation){//if choice is correlation, we already printed out the correlation...
	double correlateR = MslTools::correlate(minRowValues, _inputVec1);
	fprintf(stdout, "RowCorrelation: \t %8.3f, ", correlateR);
    }
    cout<<endl;

    //print col vector and correlation if choice is MinRowAndColWeighted
    if(choice==minRowAndColWeighted || choice == correlationRowCol){
	label = "ColsVect: ";
	fprintf(stdout, "%-20s", label.c_str());

	vector<double> minColValues = mw->getMinColValues();
	for (int i=0; i<minColValues.size(); i++){
	    fprintf(stdout, "%8.3f, ", minColValues[i]);
	}
	fprintf(stdout,"\n");
	double correlateC = MslTools::correlate(minColValues, _inputVec1);
	fprintf(stdout, "ColCorrelation: \t %8.3f, ", correlateC);
	cout<<endl;
    }

    if (choice == correlationHeteroRowCol){

	    label = "DistVectCol: ";
	    fprintf(stdout, "%-20s", label.c_str());
	    for (uint i = 0; i < _inputVec2.size();i++){
		    fprintf(stdout, "%8.3f, ", _inputVec2[i]);
	    }
	    fprintf(stdout, "\n");

	    label = "ColsVect: ";
	    fprintf(stdout, "%-20s", label.c_str());
	    vector<double> minColValues = mw->getMinColValues();
	    for (int i=0; i<minColValues.size(); i++){
		    fprintf(stdout, "%8.3f, ", minColValues[i]);
	    }
	    fprintf(stdout,"\n");
	    double correlateC = MslTools::correlate(minColValues, _inputVec2);
	    fprintf(stdout, "ColCorrelation: \t %8.3f, ", correlateC);
	    cout<<endl;
    }

   

}