Permalink
Browse files

Removes distance storage in sens.spec

  • Loading branch information...
1 parent a09ad09 commit 7126852a83e55be9e3ef62a9fa901530bb7533dd @mothur-westcott mothur-westcott committed Jan 31, 2017
Showing with 10 additions and 14 deletions.
  1. +9 −13 source/commands/sensspeccommand.cpp
  2. +1 −1 source/commands/sensspeccommand.h
@@ -290,7 +290,7 @@ int SensSpecCommand::execute(){
//***************************************************************************************************************
-int SensSpecCommand::process(map<string, int>& seqMap, ListVector*& list, bool& getCutoff, string& origCutoff){
+int SensSpecCommand::process(ListVector*& list, bool& getCutoff, string& origCutoff){
try {
@@ -316,7 +316,7 @@ int SensSpecCommand::process(map<string, int>& seqMap, ListVector*& list, bool&
trueNegatives = 0;
falseNegatives = 0;
- map<string, double> distanceMap;
+ set<string> distanceMap;
//could segfault out if there are sequences in phylip-formatted distance
//matrix that aren't in the list file
@@ -338,8 +338,6 @@ int SensSpecCommand::process(map<string, int>& seqMap, ListVector*& list, bool&
phylipFile >> seqNameVector[i];
- //otuIndices[i] = seqMap[seqName];
-
for(int j=0;j<i;j++){
phylipFile >> distance;
@@ -352,7 +350,7 @@ int SensSpecCommand::process(map<string, int>& seqMap, ListVector*& list, bool&
seqNamePair = seqNameVector[j] + '-' + seqNameVector[i];
}
- distanceMap[seqNamePair] = distance;
+ distanceMap.insert(seqNamePair);
}
}
@@ -381,12 +379,12 @@ int SensSpecCommand::process(map<string, int>& seqMap, ListVector*& list, bool&
} else {
seqNamePair = seqNameB + '-' + seqNameA;
}
- distanceMap[seqNamePair] = distance;
+ distanceMap.insert(seqNamePair);
}
}
columnFile.close();
}
-
+ cout << m->getRAMUsed()/(double)GIG << endl;
for(int otu=0;otu<numOTUs;otu++){
if (m->control_pressed) { return 0; }
@@ -421,7 +419,7 @@ int SensSpecCommand::process(map<string, int>& seqMap, ListVector*& list, bool&
seqNamePair = otuVector[j] + '-' + otuVector[i];
}
- map<string, double>::iterator it = distanceMap.find(seqNamePair);
+ set<string>::iterator it = distanceMap.find(seqNamePair);
if(it != distanceMap.end()){
truePositives++;
@@ -457,8 +455,6 @@ int SensSpecCommand::processListFile(){
if(cutoff == -1.00) { getCutoff = 1; }
else { origCutoff = toString(m->ceilDist(cutoff, precision)); }
- map<string, int> seqMap;
-
InputData input(listFile, "list");
ListVector* list = input.getListVector();
string lastLabel = list->getLabel();
@@ -477,7 +473,7 @@ int SensSpecCommand::processListFile(){
//process
// int numSeqs = fillSeqMap(seqMap, list);
- process(seqMap, list, getCutoff, origCutoff);
+ process(list, getCutoff, origCutoff);
}
if ((m->anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
@@ -492,7 +488,7 @@ int SensSpecCommand::processListFile(){
//process
//int numSeqs = fillSeqMap(seqMap, list);
- process(seqMap, list, getCutoff, origCutoff);
+ process(list, getCutoff, origCutoff);
//restore real lastlabel to save below
list->setLabel(saveLabel);
@@ -523,7 +519,7 @@ int SensSpecCommand::processListFile(){
//process
//int numSeqs = fillSeqMap(seqMap, list);
- process(seqMap, list, getCutoff, origCutoff);
+ process(list, getCutoff, origCutoff);
delete list;
}
@@ -52,7 +52,7 @@ class SensSpecCommand : public Command {
double cutoff;
int precision;
- int process(map<string, int>&, ListVector*&, bool&, string&);
+ int process(ListVector*&, bool&, string&);
};
#endif

0 comments on commit 7126852

Please sign in to comment.