]> git.donarmstrong.com Git - mothur.git/blobdiff - sensspeccommand.cpp
fixed bug with tree reading
[mothur.git] / sensspeccommand.cpp
index 0416dcb3954442e78a527f596dbca223d6fed332..c7f67b40b0e10ae14741600f9b8b3b8d7e0adaa2 100644 (file)
@@ -9,23 +9,68 @@
 
 #include "sensspeccommand.h"
 
+//**********************************************************************************************************************
+vector<string> SensSpecCommand::setParameters(){       
+       try {
+               CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(plist);
+               CommandParameter pphylip("phylip", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none",false,false); parameters.push_back(pphylip);
+               //CommandParameter pname("name", "InputTypes", "", "", "none", "none", "ColumnName",false,false); parameters.push_back(pname);
+               CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none",false,false); parameters.push_back(pcolumn);
+               CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
+               CommandParameter pcutoff("cutoff", "Number", "", "-1.00", "", "", "",false,false); parameters.push_back(pcutoff);
+               CommandParameter pprecision("precision", "Number", "", "100", "", "", "",false,false); parameters.push_back(pprecision);
+               CommandParameter phard("hard", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(phard);
+               CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
+               CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
+               
+               vector<string> myArray;
+               for (int i = 0; i < parameters.size(); i++) {   myArray.push_back(parameters[i].name);          }
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "setParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+string SensSpecCommand::getHelpString(){       
+       try {
+               string helpString = "";
+               helpString += "The sens.spec command....\n";
+               return helpString;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "getHelpString");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+SensSpecCommand::SensSpecCommand(){    
+       try {
+               abort = true; calledHelp = true; 
+               setParameters();
+               vector<string> tempOutNames;
+               outputTypes["sensspec"] = tempOutNames;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "SensSpecCommand");
+               exit(1);
+       }
+}
 //***************************************************************************************************************
 
 SensSpecCommand::SensSpecCommand(string option)  {
        try {
                
-               abort = false;
+               abort = false; calledHelp = false;   
                
                //allow user to run help
-               if(option == "help") { help(); abort = true; }
+               if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
                        string temp;
-
-                       //valid paramters for this command
-                       string AlignArray[] =  {"list", "phylip", "column", "name", "hard", "label", "cutoff", "outputdir", "inputdir"};
                        
-                       vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
+                       vector<string> myArray = setParameters();
                        
                        OptionParser parser(option);
                        map<string,string> parameters = parser.getParameters();
@@ -38,6 +83,10 @@ SensSpecCommand::SensSpecCommand(string option)  {
                                if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
                        }
                        
+                       //initialize outputTypes
+                       vector<string> tempOutNames;
+                       outputTypes["sensspec"] = tempOutNames;
+                       
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
                        string inputDir = validParameter.validFile(parameters, "inputdir", false);              
                        if (inputDir == "not found"){   inputDir = "";          }
@@ -46,7 +95,7 @@ SensSpecCommand::SensSpecCommand(string option)  {
                                it = parameters.find("list");
                                //user has given a template file
                                if(it != parameters.end()){ 
-                                       path = hasPath(it->second);
+                                       path = m->hasPath(it->second);
                                        //if the user has not given a path then, add inputdir. else leave path alone.
                                        if (path == "") {       parameters["list"] = inputDir + it->second;             }
                                }
@@ -54,7 +103,7 @@ SensSpecCommand::SensSpecCommand(string option)  {
                                it = parameters.find("phylip");
                                //user has given a template file
                                if(it != parameters.end()){ 
-                                       path = hasPath(it->second);
+                                       path = m->hasPath(it->second);
                                        //if the user has not given a path then, add inputdir. else leave path alone.
                                        if (path == "") {       parameters["phylip"] = inputDir + it->second;           }
                                }
@@ -62,47 +111,67 @@ SensSpecCommand::SensSpecCommand(string option)  {
                                it = parameters.find("column");
                                //user has given a template file
                                if(it != parameters.end()){ 
-                                       path = hasPath(it->second);
+                                       path = m->hasPath(it->second);
                                        //if the user has not given a path then, add inputdir. else leave path alone.
                                        if (path == "") {       parameters["column"] = inputDir + it->second;           }
                                }
                                
-                               it = parameters.find("name");
+                               //it = parameters.find("name");
                                //user has given a template file
-                               if(it != parameters.end()){ 
-                                       path = hasPath(it->second);
+                               //if(it != parameters.end()){ 
+                                       //path = m->hasPath(it->second);
                                        //if the user has not given a path then, add inputdir. else leave path alone.
-                                       if (path == "") {       parameters["name"] = inputDir + it->second;             }
-                               }
+                                       //if (path == "") {     parameters["name"] = inputDir + it->second;             }
+                               //}
                                
                        }
                        //check for required parameters
                        listFile = validParameter.validFile(parameters, "list", true);
-                       if (listFile == "not found") { m->mothurOut("list is a required parameter for the sens.spec command."); m->mothurOutEndLine(); abort = true; }
+                       if (listFile == "not found") {          
+                               listFile = m->getListFile(); 
+                               if (listFile != "") { m->mothurOut("Using " + listFile + " as input file for the list parameter."); m->mothurOutEndLine(); }
+                               else {  m->mothurOut("You have no current list file and the list parameter is required."); m->mothurOutEndLine(); abort = true; }
+                       }
                        else if (listFile == "not open") { abort = true; }      
                        
-                       distFile = validParameter.validFile(parameters, "column", true);
-                       format = "column";
-                       if(distFile == "not found")     {
-                               distFile = validParameter.validFile(parameters, "phylip", true);
-                               format = "phylip";      
-                       }
-                       if(distFile == "not found") { m->mothurOut("either column or phylip are required for the sens.spec command."); m->mothurOutEndLine(); abort = true; }
-                       else if (distFile == "not open") { abort = true; }      
-               
+                       phylipfile = validParameter.validFile(parameters, "phylip", true);
+                       if (phylipfile == "not found") { phylipfile = "";  }
+                       else if (phylipfile == "not open") { abort = true; }    
+                       else { distFile = phylipfile; format = "phylip";   }
+                       
+                       columnfile = validParameter.validFile(parameters, "column", true);
+                       if (columnfile == "not found") { columnfile = ""; }
+                       else if (columnfile == "not open") { abort = true; }    
+                       else { distFile = columnfile; format = "column";   }
+                       
+                       if ((phylipfile == "") && (columnfile == "")) { //is there are current file available for either of these?
+                               //give priority to column, then phylip
+                               columnfile = m->getColumnFile(); 
+                               if (columnfile != "") {  distFile = columnfile; format = "column";  m->mothurOut("Using " + columnfile + " as input file for the column parameter."); m->mothurOutEndLine(); }
+                               else { 
+                                       phylipfile = m->getPhylipFile(); 
+                                       if (phylipfile != "") {  distFile = phylipfile; format = "phylip"; m->mothurOut("Using " + phylipfile + " as input file for the phylip parameter."); m->mothurOutEndLine(); }
+                                       else { 
+                                               m->mothurOut("No valid current files. You must provide a phylip or column file."); m->mothurOutEndLine(); 
+                                               abort = true;
+                                       }
+                               }
+                       }else if ((phylipfile != "") && (columnfile != "")) { m->mothurOut("When executing a sens.spec command you must enter ONLY ONE of the following: phylip or column."); m->mothurOutEndLine(); abort = true; }
+                       
+                       
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);
                        if (outputDir == "not found"){  
                                outputDir = ""; 
-                               outputDir += hasPath(listFile); //if user entered a file with a path then preserve it   
+                               outputDir += m->hasPath(listFile); //if user entered a file with a path then preserve it        
                        }
 
                        //check for optional parameter and set defaults
                        // ...at some point should added some additional type checking...
                        temp = validParameter.validFile(parameters, "hard", false);
                        if (temp == "not found"){       hard = 0;       }
-                       else if(!isTrue(temp))  {       hard = 0;       }
-                       else if(isTrue(temp))   {       hard = 1;       }
+                       else if(!m->isTrue(temp))       {       hard = 0;       }
+                       else if(m->isTrue(temp))        {       hard = 1;       }
                        
 //                     temp = validParameter.validFile(parameters, "name", true);
 //                     if (temp == "not found")        {       nameFile = "";          }
@@ -110,59 +179,39 @@ SensSpecCommand::SensSpecCommand(string option)  {
 //                     else                                            {       nameFile = temp;        }
 //                     cout << "name:\t" << nameFile << endl;
 
-                       temp = validParameter.validFile(parameters, "cutoff", false);           if (temp == "not found") { temp = ""; }
+                       temp = validParameter.validFile(parameters, "cutoff", false);           if (temp == "not found") { temp = "-1.00"; }
                        convert(temp, cutoff);  
-                       cout << "cutoff:\t" << cutoff << endl;
+//                     cout << cutoff << endl;
                        
-//                     cutoff = 0.0349;
+                       temp = validParameter.validFile(parameters, "precision", false);        if (temp == "not found") { temp = "100"; }
+                       convert(temp, precision);  
+//                     cout << precision << endl;
                        
                        lineLabel = validParameter.validFile(parameters, "label", false);       if (lineLabel == "not found") { lineLabel = ""; }
                        
+                       sensSpecFileName = listFile.substr(0,listFile.find_last_of('.')) + ".sensspec";
                }
-               
        }
        catch(exception& e) {
                m->errorOut(e, "SensSpecCommand", "SensSpecCommand");
                exit(1);
        }
 }
-//**********************************************************************************************************************
-
-void SensSpecCommand::help(){
-       try {
-               m->mothurOut("The sens.spec command reads a fastaFile and creates .....\n");
-
-               
-               
-               m->mothurOut("Example sens.spec(...).\n");
-               m->mothurOut("Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n");
-               m->mothurOut("For more details please check out the wiki http://www.mothur.org/wiki/Trim.seqs .\n\n");
-               
-       }
-       catch(exception& e) {
-               m->errorOut(e, "SensSpecCommand", "help");
-               exit(1);
-       }
-}
-
-
-//***************************************************************************************************************
-
-SensSpecCommand::~SensSpecCommand(){   /*      do nothing      */      }
-
 //***************************************************************************************************************
 
 int SensSpecCommand::execute(){
        try{
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
+               setUpOutput();
+               outputNames.push_back(sensSpecFileName); outputTypes["sensspec"].push_back(sensSpecFileName);
                if(format == "phylip")          {       processPhylip();        }
-//             else if(format == "column")     {       processColumn(seqMap);  }
-               
-               
-//             string seqList;
-//             map<string, int> seqMap;
+               else if(format == "column")     {       processColumn();        }
                
+               m->mothurOutEndLine();
+               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut(sensSpecFileName); m->mothurOutEndLine();  
+               m->mothurOutEndLine();
                
                
                return 0;       
@@ -177,9 +226,16 @@ int SensSpecCommand::execute(){
 
 void SensSpecCommand::processPhylip(){
        try{
+               //probably need some checking to confirm that the names in the distance matrix are the same as those in the list file
+               
                ifstream inputListFile;
-               openInputFile(listFile, inputListFile);
-
+               m->openInputFile(listFile, inputListFile);
+               
+               string origCutoff = "";
+               bool getCutoff = 0;
+               if(cutoff == -1.00)     {       getCutoff = 1;                                                                                                                  }
+               else                            {       origCutoff = toString(cutoff);  cutoff += (0.49 / double(precision));   }
+               
                string label;
                int numOTUs;
 
@@ -205,112 +261,253 @@ void SensSpecCommand::processPhylip(){
                                }
                                seqMap[seqName] = i;
                        }
+                       m->gobble(inputListFile);
+               
+                       int lNumSeqs = seqMap.size();
+                       int pNumSeqs = 0;
+
+                       ifstream phylipFile;
+                       m->openInputFile(distFile, phylipFile);
+                       phylipFile >> pNumSeqs;
+                       if(pNumSeqs != lNumSeqs){       cout << "numSeq mismatch!" << endl;     }
+                       
+                       string seqName;
+                       double distance;
+                       vector<int> otuIndices(lNumSeqs, -1);
+                               
+                       truePositives = 0;
+                       falsePositives = 0;
+                       trueNegatives = 0;
+                       falseNegatives = 0;
+                       
+                       if(getCutoff == 1){
+                               if(label != "unique"){
+                                       origCutoff = label;
+                                       convert(label, cutoff);
+                                       if(hard == 0){  cutoff += (0.49 / double(precision));   }               
+                               }
+                               else{
+                                       origCutoff = "unique";
+                                       cutoff = 0.0000;
+                               }
+                       }
+                                  
+                       cout << label << endl;
+                       
+                       for(int i=0;i<lNumSeqs;i++){
+                               phylipFile >> seqName;
+                               otuIndices[i] = seqMap[seqName];
+                               
+                               for(int j=0;j<i;j++){
+                                       phylipFile >> distance;
+                                       
+                                       if(distance <= cutoff){
+                                               if(otuIndices[i] == otuIndices[j])      {       truePositives++;        }
+                                               else                                                            {       falseNegatives++;       }
+                                       }
+                                       else{
+                                               if(otuIndices[i] == otuIndices[j])      {       falsePositives++;       }
+                                               else                                                            {       trueNegatives++;        }
+                                       }
+                               }
+                       }
+                       phylipFile.close();
+                       
+                       outputStatistics(label, origCutoff);
                }
                inputListFile.close();
-               
-               int lNumSeqs = seqMap.size();
-               int pNumSeqs = 0;
 
-               ifstream phylipFile;
-               openInputFile(distFile, phylipFile);
-               phylipFile >> pNumSeqs;
-               if(pNumSeqs != lNumSeqs){       cout << "numSeq mismatch!" << endl;     }
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "processPhylip");
+               exit(1);
+       }
+}
+
+//***************************************************************************************************************
+
+void SensSpecCommand::processColumn(){
+       try{            
+               ifstream inputListFile;
+               m->openInputFile(listFile, inputListFile);
                
-               string seqName;
-               double distance;
-               vector<int> otuIndices(lNumSeqs, -1);
-                       
-               truePositives = 0;
-               falsePositives = 0;
-               trueNegatives = 0;
-               falseNegatives = 0;
+               string origCutoff = "";
+               bool getCutoff = 0;
+               if(cutoff == -1.00)     {       getCutoff = 1;                                                                                                                  }
+               else                            {       origCutoff = toString(cutoff);  cutoff += (0.49 / double(precision));   }
                
+               set<string> seqPairSet;
                
-               for(int i=0;i<lNumSeqs;i++){
-                       phylipFile >> seqName;
-                       otuIndices[i] = seqMap[seqName];
+               string label, seqList;
+               int numOTUs;
+               int numSeqs;
+               
+               while(inputListFile){
+                       numSeqs = 0;
                        
-                       for(int j=0;j<i;j++){
-                               phylipFile >> distance;
-                               if(distance <= cutoff){
-                                       if(otuIndices[i] == otuIndices[j]){
-                                               truePositives++;
+                       inputListFile >> label >> numOTUs;
+                       for(int i=0;i<numOTUs;i++){
+                               
+                               vector<string> seqNameVector;
+                               
+                               inputListFile >> seqList;
+                               int seqListLength = seqList.length();
+                               string seqName = "";
+                               for(int j=0;j<seqListLength;j++){
+                                       
+                                       if(seqList[j] == ','){
+                                               seqNameVector.push_back(seqName);
+                                               seqName = "";
                                        }
                                        else{
-                                               falseNegatives++;
+                                               seqName += seqList[j];
                                        }
                                }
+                               seqNameVector.push_back(seqName);
+
+                               numSeqs += seqNameVector.size();
+                               
+                               int numSeqsInOTU = seqNameVector.size();
+                               for(int j=0;j<numSeqsInOTU;j++){
+                                       string seqPairString = "";                              
+                                       for(int k=0;k<j;k++){
+                                               if(seqNameVector[j] < seqNameVector[k]) {       seqPairString = seqNameVector[j] + '\t' + seqNameVector[k];     }
+                                               else                                                                    {       seqPairString = seqNameVector[k] + '\t' + seqNameVector[j];     }
+                                               seqPairSet.insert(seqPairString);
+                                       }
+                               }
+                       }
+                       m->gobble(inputListFile);
+                       
+                       int numDists = (numSeqs * (numSeqs-1) / 2);
+
+                       ifstream columnFile;
+                       m->openInputFile(distFile, columnFile);
+                       string seqNameA, seqNameB, seqPairString;
+                       double distance;
+                       
+                       truePositives = 0;
+                       falsePositives = 0;
+                       trueNegatives = numDists;
+                       falseNegatives = 0;
+                       
+                       if(getCutoff == 1){
+                               if(label != "unique"){
+                                       origCutoff = label;
+                                       convert(label, cutoff);
+                                       if(hard == 0){  cutoff += (0.49 / double(precision));   }               
+                               }
                                else{
-                                       if(otuIndices[i] == otuIndices[j]){
-                                               falsePositives++;
+                                       origCutoff = "unique";
+                                       cutoff = 0.0000;
+                               }
+                       }
+                       
+                       cout << label << endl;
+                       
+                       while(columnFile){
+                               columnFile >> seqNameA >> seqNameB >> distance;
+                               if(seqNameA < seqNameB) {       seqPairString = seqNameA + '\t' + seqNameB;     }
+                               else                                    {       seqPairString = seqNameB + '\t' + seqNameA;     }
+
+                               set<string>::iterator it = seqPairSet.find(seqPairString);
+                       
+                               if(distance <= cutoff){
+                                       if(it != seqPairSet.end()){
+                                               truePositives++;
+                                               seqPairSet.erase(it);   
                                        }
                                        else{
-                                               trueNegatives++;
+                                               falseNegatives++;
                                        }
+                                       trueNegatives--;
                                }
+                               else if(it != seqPairSet.end()){        
+                                       falsePositives++;
+                                       trueNegatives--;
+                                       seqPairSet.erase(it);   
+                               }
+                               
+                               m->gobble(columnFile);
                        }
+                       falsePositives += seqPairSet.size();
+                       
+                       outputStatistics(label, origCutoff);
                }
-               phylipFile.close();
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "processColumn");
+               exit(1);
+       }
+}
+
+//***************************************************************************************************************
+
+void SensSpecCommand::setUpOutput(){
+       try{            
+               ofstream sensSpecFile;
+               m->openOutputFile(sensSpecFileName, sensSpecFile);
                
-               cout << "truePositives:\t"      << truePositives        << endl;
-               cout << "trueNegatives:\t"      << trueNegatives        << endl;
-               cout << "falsePositives:\t"     << falsePositives       << endl;
-               cout << "falseNegatives:\t"     << falseNegatives       << endl;
+               sensSpecFile << "label\tcutoff\ttp\ttn\tfp\tfn\tsensitivity\tspecificity\tppv\tnpv\tfdr\taccuracy\tmcc\tf1score\n";
+
+               sensSpecFile.close();
        }
        catch(exception& e) {
-               m->errorOut(e, "SensSpecCommand", "processPhylip");
+               m->errorOut(e, "SensSpecCommand", "setUpOutput");
                exit(1);
        }
 }
 
 //***************************************************************************************************************
 
-//void SensSpecCommand::processColumn(map<string, int> seqMap){
-//     
-//     truePositives = 0;
-//     falsePositives = 0;
-//     trueNegatives = numDists;
-//     falseNegatives = 0;
-//     
-//     ifstream columnFile;
-//     openInputFile(distFile, columnFile);
-//     
-//     string seqNameA, seqNameB, oldSeqNameA;
-//     int otuA, otuB, oldOTUA;
-//     double distance;
-//
-//     while(columnFile){
-//             columnFile >> seqNameA >> seqNameB >> distance;
-//
-//             if(seqNameA == oldSeqNameA)     {       otuA = oldOTUA; }
-//             else                                            {       otuA = seqMap[seqNameA];        oldOTUA = otuA; }
-//             
-//             otuB = seqMap[seqNameB];
-//             
-//             if(distance <= cutoff){
-//                     if(otuA == otuB){
-//                             truePositives++;
-//                     }
-//                     else{
-//                             falseNegatives++;
-//                     }
-//                     trueNegatives--;
-//             }
-//             else{
-//                     if(otuA == otuB){
-//                             falsePositives++;
-//                             trueNegatives--;
-//                     }
-//             }
-//     
-//             gobble(columnFile);
-//     }
-//     columnFile.close();
-//     
-//     cout << "truePositives:\t"      << truePositives        << endl;
-//     cout << "trueNegatives:\t"      << trueNegatives        << endl;
-//     cout << "falsePositives:\t"     << falsePositives       << endl;
-//     cout << "falseNegatives:\t"     << falseNegatives       << endl;
-//}
+void SensSpecCommand::outputStatistics(string label, string cutoff){
+       try{            
+               double tp = (double) truePositives;
+               double fp = (double) falsePositives;
+               double tn = (double) trueNegatives;
+               double fn = (double) falseNegatives;
+               
+               double p = tp + fn;
+               double n = fp + tn;
+               double pPrime = tp + fp;
+               double nPrime = tn + fn;
+               
+               double sensitivity = tp / p;    
+               double specificity = tn / n;
+               double positivePredictiveValue = tp / pPrime;
+               double negativePredictiveValue = tn / nPrime;
+               double falseDiscoveryRate = fp / pPrime;
+               
+               double accuracy = (tp + tn) / (p + n);
+               double matthewsCorrCoef = (tp * tn - fp * fn) / sqrt(p * n * pPrime * nPrime);  if(p == 0 || n == 0){   matthewsCorrCoef = 0;   }
+               double f1Score = 2.0 * tp / (p + pPrime);
+               
+               
+               if(p == 0)                      {       sensitivity = 0;        matthewsCorrCoef = 0;   }
+               if(n == 0)                      {       specificity = 0;        matthewsCorrCoef = 0;   }
+               if(p + n == 0)          {       accuracy = 0;                                                           }
+               if(p + pPrime == 0)     {       f1Score = 0;                                                            }
+               if(pPrime == 0)         {       positivePredictiveValue = 0;    falseDiscoveryRate = 0; matthewsCorrCoef = 0;   }
+               if(nPrime == 0)         {       negativePredictiveValue = 0;    matthewsCorrCoef = 0;                                                   }
+               
+               ofstream sensSpecFile;
+               m->openOutputFileAppend(sensSpecFileName, sensSpecFile);
+               
+               sensSpecFile << label << '\t' << cutoff << '\t';
+               sensSpecFile << truePositives << '\t' << trueNegatives << '\t' << falsePositives << '\t' << falseNegatives << '\t';
+               sensSpecFile << setprecision(4);
+               sensSpecFile << sensitivity << '\t' << specificity << '\t' << positivePredictiveValue << '\t' << negativePredictiveValue << '\t';
+               sensSpecFile << falseDiscoveryRate << '\t' << accuracy << '\t' << matthewsCorrCoef << '\t' << f1Score << endl;
+               
+               sensSpecFile.close();
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "outputStatistics");
+               exit(1);
+       }
+}
 
 //***************************************************************************************************************
+
+
+