#include "splitmatrix.h"
#include "phylotree.h"
#include "distancecommand.h"
+#include "seqsummarycommand.h"
/***********************************************************************/
}
/***********************************************************************/
-SplitMatrix::SplitMatrix(string ffile, string name, string tax, float c, string t, int p, string output){
+SplitMatrix::SplitMatrix(string ffile, string name, string tax, float c, float cu, string t, int p, string output){
m = MothurOut::getInstance();
fastafile = ffile;
namefile = name;
taxFile = tax;
- cutoff = c;
+ cutoff = c; //tax level cutoff
+ distCutoff = cu; //for fasta method if you are creating distance matrix you need a cutoff for that
method = t;
processors = p;
outputDir = output;
if (large) { splitDistanceLarge(); }
else { splitDistanceRAM(); }
+
+ return 0;
}
catch(exception& e) {
int SplitMatrix::splitClassify(){
try {
cutoff = int(cutoff);
-
+
map<string, int> seqGroup;
map<string, int>::iterator it;
map<string, int>::iterator it2;
//process each distance file
for (int i = 0; i < numGroups; i++) {
- string options = "fasta=" + (fastafile + "." + toString(i) + ".temp") + ", processors=" + toString(processors) + ", cutoff=" + toString(cutoff);
+ string options = "fasta=" + (fastafile + "." + toString(i) + ".temp") + ", processors=" + toString(processors) + ", cutoff=" + toString(distCutoff);
Command* command = new DistanceCommand(options);
+
command->execute();
delete command;
//remove old names files just in case
remove((namefile + "." + toString(i) + ".temp").c_str());
}
-
+
singleton = namefile + ".extra.temp";
ofstream remainingNames;
m->openOutputFile(singleton, remainingNames);
for(int i=0;i<numGroups;i++){
string tempNameFile = namefile + "." + toString(i) + ".temp";
+ if (outputDir == "") { outputDir = m->hasPath(fastafile); }
string tempDistFile = outputDir + m->getRootName(m->getSimpleName((fastafile + "." + toString(i) + ".temp"))) + "dist";
//if there are valid distances