Permalink
Browse files

Adds numOTUs to opti output

  • Loading branch information...
1 parent 16fedfc commit bab404d2c1a09477417974f77ede74025a72ea08 @mothur-westcott mothur-westcott committed Sep 29, 2016
Showing with 11 additions and 7 deletions.
  1. +11 −7 source/commands/clustercommand.cpp
@@ -886,15 +886,17 @@ int ClusterCommand::runOptiCluster(){
cluster.initialize(listVectorMetric, true, initialize);
- m->mothurOut("\n\niter\ttime\tlabel\tcutoff\ttp\ttn\tfp\tfn\tsensitivity\tspecificity\tppv\tnpv\tfdr\taccuracy\tmcc\tf1score\n");
- outStep << "iter\ttime\tlabel\tcutoff\ttp\ttn\tfp\tfn\tsensitivity\tspecificity\tppv\tnpv\tfdr\taccuracy\tmcc\tf1score\n";
+ ListVector* list = cluster.getList();
+ m->mothurOut("\n\niter\ttime\tlabel\tnum_otus\tcutoff\ttp\ttn\tfp\tfn\tsensitivity\tspecificity\tppv\tnpv\tfdr\taccuracy\tmcc\tf1score\n");
+ outStep << "iter\ttime\tlabel\tnum_otus\tcutoff\ttp\ttn\tfp\tfn\tsensitivity\tspecificity\tppv\tnpv\tfdr\taccuracy\tmcc\tf1score\n";
long long tp, tn, fp, fn;
vector<double> results = cluster.getStats(tp, tn, fp, fn);
- m->mothurOut("0\t0\t" + toString(cutoff) + "\t" + toString(cutoff) + "\t" + toString(tp) + "\t" + toString(tn) + "\t" + toString(fp) + "\t" + toString(fn) + "\t");
- outStep << "0\t0\t" + toString(cutoff) + "\t" + toString(cutoff) + "\t" << tp << '\t' << tn << '\t' << fp << '\t' << fn << '\t';
+ m->mothurOut("0\t0\t" + toString(cutoff) + "\t" + toString(list->getNumBins()) + "\t"+ toString(cutoff) + "\t" + toString(tp) + "\t" + toString(tn) + "\t" + toString(fp) + "\t" + toString(fn) + "\t");
+ outStep << "0\t0\t" + toString(cutoff) + "\t" + toString(list->getNumBins()) + "\t" + toString(cutoff) + "\t" << tp << '\t' << tn << '\t' << fp << '\t' << fn << '\t';
for (int i = 0; i < results.size(); i++) { m->mothurOut(toString(results[i]) + "\t"); outStep << results[i] << "\t"; }
m->mothurOutEndLine();
outStep << endl;
+ delete list;
while ((delta > stableMetric) && (iters < maxIters)) {
@@ -909,16 +911,18 @@ int ClusterCommand::runOptiCluster(){
iters++;
results = cluster.getStats(tp, tn, fp, fn);
+ list = cluster.getList();
- m->mothurOut(toString(iters) + "\t" + toString(time(NULL) - start) + "\t" + toString(cutoff) + "\t" + toString(cutoff) + "\t"+ toString(tp) + "\t" + toString(tn) + "\t" + toString(fp) + "\t" + toString(fn) + "\t");
- outStep << (toString(iters) + "\t" + toString(time(NULL) - start) + "\t" + toString(cutoff) + "\t" + toString(cutoff) + "\t") << tp << '\t' << tn << '\t' << fp << '\t' << fn << '\t';
+ m->mothurOut(toString(iters) + "\t" + toString(time(NULL) - start) + "\t" + toString(cutoff) + "\t" + toString(list->getNumBins()) + "\t" + toString(cutoff) + "\t"+ toString(tp) + "\t" + toString(tn) + "\t" + toString(fp) + "\t" + toString(fn) + "\t");
+ outStep << (toString(iters) + "\t" + toString(time(NULL) - start) + "\t" + toString(cutoff) + "\t" + toString(list->getNumBins()) + "\t" + toString(cutoff) + "\t") << tp << '\t' << tn << '\t' << fp << '\t' << fn << '\t';
for (int i = 0; i < results.size(); i++) { m->mothurOut(toString(results[i]) + "\t"); outStep << results[i] << "\t"; }
m->mothurOutEndLine();
outStep << endl;
+ delete list;
}
m->mothurOutEndLine(); m->mothurOutEndLine();
- ListVector* list = cluster.getList();
+ list = cluster.getList();
list->setLabel(toString(cutoff));
if (!m->printedListHeaders) { m->listBinLabelsInFile.clear(); list->printHeaders(listFile); }
if(countfile != "") { list->print(listFile, counts); }

0 comments on commit bab404d

Please sign in to comment.