helpString += "The count.seqs aka. make.table command reads a name or shared file and outputs a .count_table file. You may also provide a group with the names file to get the counts broken down by group.\n";
helpString += "The groups parameter allows you to indicate which groups you want to include in the counts, by default all groups in your groupfile are used.\n";
- helpString += "The large parameter indicates the name and group files are too large to fit in RAM.\n";
helpString += "When you use the groups parameter and a sequence does not represent any sequences from the groups you specify it is not included in the .count.summary file.\n";
helpString += "The processors parameter allows you to specify the number of processors to use. The default is 1.\n";
helpString += "The count.seqs command should be in the following format: count.seqs(name=yourNameFile).\n";
- m->mothurOut("It took " + toString(time(NULL) - estart) + " seconds to sort and index the group and name files. "); m->mothurOutEndLine();
- }else { outName = namefile; }
-
- time_t estart = time(NULL);
- //open input file
- ifstream in;
- m->openInputFile(outName, in);
-
- //open input file
- ifstream in2;
-
- unsignedlonglong total = 0;
- vector< vector<int> > nameMapCount;
- if (groupfile != "") {
- m->openInputFile(outfile, in2);
- nameMapCount.resize(indexToName.size());
- for (int i = 0; i < nameMapCount.size(); i++) {
- nameMapCount[i].resize(indexToGroup.size(), 0);
- }
- }
-
- while (!in.eof()) {
- if (m->control_pressed) { break; }
-
- string firstCol;
- in >> firstCol; m->gobble(in);
-
- if (groupfile != "") {
- int uniqueIndex;
- in >> uniqueIndex; m->gobble(in);
-
- string name; int groupIndex;
- in2 >> name >> groupIndex; m->gobble(in2);
-
- if (name != firstCol) { m->mothurOut("[ERROR]: found " + name + " in your groupfile, but " + firstCol + " was in your namefile, please correct.\n"); m->control_pressed = true; }
-
- nameMapCount[uniqueIndex][groupIndex]++;
- total++;
- }else {
- string secondCol;
- in >> secondCol; m->gobble(in);
- int num = m->getNumNames(secondCol);
- out << firstCol << '\t' << num << endl;
- total += num;
- }
- }
- in.close();
-
- if (groupfile != "") {
- m->mothurRemove(outfile);
- m->mothurRemove(outName);
- in2.close();
- for (map<int, string>::iterator it = indexToGroup.begin(); it != indexToGroup.end(); it++) { out << '\t' << it->second; }
0 comments on commit
f6d9e36