try {
CommandParameter pblast("blast", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pblast);
CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pname);
try {
CommandParameter pblast("blast", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pblast);
CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pname);
+ CommandParameter plarge("large", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(plarge);
CommandParameter plength("length", "Number", "", "5", "", "", "",false,false); parameters.push_back(plength);
CommandParameter ppenalty("penalty", "Number", "", "0.10", "", "", "",false,false); parameters.push_back(ppenalty);
CommandParameter pcutoff("cutoff", "Number", "", "0.70", "", "", "",false,false); parameters.push_back(pcutoff);
CommandParameter plength("length", "Number", "", "5", "", "", "",false,false); parameters.push_back(plength);
CommandParameter ppenalty("penalty", "Number", "", "0.10", "", "", "",false,false); parameters.push_back(ppenalty);
CommandParameter pcutoff("cutoff", "Number", "", "0.70", "", "", "",false,false); parameters.push_back(pcutoff);
temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; }
precisionLength = temp.length();
m->mothurConvert(temp, precision);
temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; }
precisionLength = temp.length();
m->mothurConvert(temp, precision);
hclusterWanted = m->isTrue(temp);
temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; }
hclusterWanted = m->isTrue(temp);
temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; }
//**********************************************************************************************************************
int MGClusterCommand::execute(){
try {
//**********************************************************************************************************************
int MGClusterCommand::execute(){
try {
//read blastfile - creates sparsematrices for the distances and overlaps as well as a listvector
//must remember to delete those objects here since readBlast does not
read = new ReadBlast(blastfile, cutoff, penalty, length, minWanted, hclusterWanted);
read->read(nameMap);
//read blastfile - creates sparsematrices for the distances and overlaps as well as a listvector
//must remember to delete those objects here since readBlast does not
read = new ReadBlast(blastfile, cutoff, penalty, length, minWanted, hclusterWanted);
read->read(nameMap);
-
- list = new ListVector(nameMap->getListVector());
- RAbundVector* rabund = new RAbundVector(list->getRAbundVector());
+
+ list = new ListVector(nameMap->getListVector());
+ RAbundVector* rabund = NULL;
+
+ if(large) {
+ map<string, int> nameMapCounts = m->readNames(namefile);
+ createRabund(nameMapCounts);
+ rabund = &rav;
+ }else {
+ rabund = new RAbundVector(list->getRAbundVector());
+ }
+
+
+ //list = new ListVector(nameMap->getListVector());
+ //rabund = new RAbundVector(list->getRAbundVector());
+void MGClusterCommand::createRabund(map<string, int> nameMapCounts){
+ try {
+ //RAbundVector rav;
+ map<string,int>::iterator it;
+ //it = nameMapCounts.begin();
+ //for(int i = 0; i < list->getNumBins(); i++) { rav.push_back((*it).second); it++; }
+ for ( it=nameMapCounts.begin(); it!=nameMapCounts.end(); it++ ) { rav.push_back( it->second ); }
+ //return rav;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "MGClusterCommand", "createRabund");
+ exit(1);
+ }
+
+}