X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cooccurrencecommand.cpp;h=e6c298e17e88a2c192765dce5b41e21c90db67c2;hb=dec4333b64891e0b923c862446cf2e3befa7e3d3;hp=e6c92594f49d8ab038abdb1587983ece722e5592;hpb=9d241ddf4c0e2467298a523e21a3b0de46902448;p=mothur.git diff --git a/cooccurrencecommand.cpp b/cooccurrencecommand.cpp index e6c9259..e6c298e 100644 --- a/cooccurrencecommand.cpp +++ b/cooccurrencecommand.cpp @@ -136,7 +136,7 @@ CooccurrenceCommand::CooccurrenceCommand(string option) { m->mothurOut("[ERROR]: " + metric + " is not a valid metric option for the cooccurrence command. Choices are cscore, checker, combo, vratio."); m->mothurOutEndLine(); abort = true; } - matrix = validParameter.validFile(parameters, "matrix", false); if (matrix == "not found") { matrix = "sim2"; } + matrix = validParameter.validFile(parameters, "matrixmodel", false); if (matrix == "not found") { matrix = "sim2"; } if ((matrix != "sim1") && (matrix != "sim2") && (matrix != "sim3") && (matrix != "sim4") && (matrix != "sim5" ) && (matrix != "sim6" ) && (matrix != "sim7" ) && (matrix != "sim8" ) && (matrix != "sim9" )) { m->mothurOut("[ERROR]: " + matrix + " is not a valid matrix option for the cooccurrence command. Choices are sim1, sim2, sim3, sim4, sim5, sim6, sim7, sim8, sim9."); m->mothurOutEndLine(); abort = true; @@ -295,17 +295,10 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp //nrows is ncols of inital matrix. All the functions need this value. They assume the transposition has already taken place and nrows and ncols refer to that matrix. //comatrix and initmatrix are still vectors of vectors of ints as in the original script. The abundancevector is only what was read in ie not a co-occurrence matrix! - int ncols = numOTUS;//rows of inital matrix - int nrows = thisLookUp.size();//groups + int nrows = numOTUS;//rows of inital matrix + int ncols = thisLookUp.size();//groups double initscore = 0.0; - //transpose matrix - int newmatrows = ncols; - int newmatcols = nrows; - - //swap for transposed matrix - nrows = newmatrows;//ncols; - ncols = newmatcols;//nrows; - + vector initcolumntotal; initcolumntotal.resize(ncols, 0); vector initrowtotal; initrowtotal.resize(nrows, 0); vector stats;