if (namefile != "") { m->readNames(namefile, nameMap, true); }
if (groupfile != "") { groupMap = new GroupMap(groupfile); groupMap->readMap(); groups = groupMap->getNamesOfGroups(); }
else { groupMap = NULL; }
- if (countfile != "") { ct = new CountTable(); ct->readTable(countfile); if (ct->hasGroupInfo()) { groups = ct->getNamesOfGroups(); } }
+ if (countfile != "") { ct = new CountTable(); ct->readTable(countfile, true, false); if (ct->hasGroupInfo()) { groups = ct->getNamesOfGroups(); } }
else { ct = NULL; }
//read taxonomy file and save in map for easy access in building bin trees
//for each bin in the list vector
string snumBins = toString(processList->getNumBins());
+ vector<string> binLabels = processList->getLabels();
for (int i = 0; i < processList->getNumBins(); i++) {
if (m->control_pressed) { break; }
names = findConsensusTaxonomy(thisNames, size, conTax);
if (m->control_pressed) { break; }
-
- //output to new names file
- string binLabel = "Otu";
- string sbinNumber = toString(i+1);
- if (sbinNumber.length() < snumBins.length()) {
- int diff = snumBins.length() - sbinNumber.length();
- for (int h = 0; h < diff; h++) { binLabel += "0"; }
- }
- binLabel += sbinNumber;
- out << binLabel << '\t' << size << '\t' << conTax << endl;
+ out << binLabels[i] << '\t' << size << '\t' << conTax << endl;
string noConfidenceConTax = conTax;
m->removeConfidences(noConfidenceConTax);
//add this bins taxonomy to summary
if (basis == "sequence") {
for(int j = 0; j < names.size(); j++) {
- int numReps = 1;
- if (countfile != "") { numReps = ct->getNumSeqs(names[j]); }
- for(int k = 0; k < numReps; k++) { taxaSum->addSeqToTree(names[j], noConfidenceConTax); }
+ //int numReps = 1;
+ //if (countfile != "") { numReps = ct->getNumSeqs(names[j]); }
+ //for(int k = 0; k < numReps; k++) { taxaSum->addSeqToTree(names[j], noConfidenceConTax); }
+ taxaSum->addSeqToTree(names[j], noConfidenceConTax);
}
}else { //otu
map<string, bool> containsGroup;
if (m->control_pressed) { break; }
- //output to new names file
- string binLabel = "Otu";
- string sbinNumber = toString(i+1);
- if (sbinNumber.length() < snumBins.length()) {
- int diff = snumBins.length() - sbinNumber.length();
- for (int h = 0; h < diff; h++) { binLabel += "0"; }
- }
- binLabel += sbinNumber;
- (*outs[groupIndex[itParsed->first]]) << binLabel << '\t' << size << '\t' << conTax << endl;
+ (*outs[groupIndex[itParsed->first]]) << binLabels[i] << '\t' << size << '\t' << conTax << endl;
string noConfidenceConTax = conTax;
m->removeConfidences(noConfidenceConTax);