X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=makebiomcommand.cpp;h=0d289d7c195ae4b19d020de145e2b80382caf006;hb=6b32d112bb60e9f7eb6d4407a4eed4c49b67bced;hp=7cf8295fb48e02b0dce58b32432d39c736695259;hpb=d1c97b8c04bb75faca1e76ffad60b37a4d789d3d;p=mothur.git diff --git a/makebiomcommand.cpp b/makebiomcommand.cpp index 7cf8295..0d289d7 100644 --- a/makebiomcommand.cpp +++ b/makebiomcommand.cpp @@ -447,10 +447,10 @@ int MakeBiomCommand::getBiom(vector& lookup){ string rowBack = "\", \"metadata\":"; for (int i = 0; i < numBins-1; i++) { if (m->control_pressed) { out.close(); return 0; } - if (!picrust) { out << rowFront << m->currentBinLabels[i] << rowBack << metadata[i] << "},\n"; } + if (!picrust) { out << rowFront << m->currentSharedBinLabels[i] << rowBack << metadata[i] << "},\n"; } else { out << rowFront << picrustLabels[i] << rowBack << metadata[i] << "},\n"; } } - if (!picrust) { out << rowFront << m->currentBinLabels[(numBins-1)] << rowBack << metadata[(numBins-1)] << "}\n" + spaces + "],\n"; } + if (!picrust) { out << rowFront << m->currentSharedBinLabels[(numBins-1)] << rowBack << metadata[(numBins-1)] << "}\n" + spaces + "],\n"; } else { out << rowFront << picrustLabels[(numBins-1)] << rowBack << metadata[(numBins-1)] << "}\n" + spaces + "],\n"; } //get column info /*"columns": [ @@ -574,7 +574,7 @@ vector MakeBiomCommand::getMetaData(vector& lookup, in.close(); //should the labels be Otu001 or PhyloType001 - string firstBin = m->currentBinLabels[0]; + string firstBin = m->currentSharedBinLabels[0]; string binTag = "Otu"; if ((firstBin.find("Otu")) == string::npos) { binTag = "PhyloType"; } @@ -596,8 +596,9 @@ vector MakeBiomCommand::getMetaData(vector& lookup, for (int h = 0; h < diff; h++) { binLabel += "0"; } } binLabel += sbinNumber; + binLabel = m->getSimpleLabel(binLabel); labelTaxMap[binLabel] = taxs[i]; - }else { labelTaxMap[otuLabels[i]] = taxs[i]; } + }else { labelTaxMap[m->getSimpleLabel(otuLabels[i])] = taxs[i]; } } @@ -610,9 +611,9 @@ vector MakeBiomCommand::getMetaData(vector& lookup, if (m->control_pressed) { return metadata; } - it = labelTaxMap.find(m->currentBinLabels[i]); + it = labelTaxMap.find(m->getSimpleLabel(m->currentSharedBinLabels[i])); - if (it == labelTaxMap.end()) { m->mothurOut("[ERROR]: can't find taxonomy information for " + m->currentBinLabels[i] + ".\n"); m->control_pressed = true; } + if (it == labelTaxMap.end()) { m->mothurOut("[ERROR]: can't find taxonomy information for " + m->currentSharedBinLabels[i] + ".\n"); m->control_pressed = true; } else { if (picrust) { string temp = it->second; m->removeConfidences(temp);