]> git.donarmstrong.com Git - mothur.git/commitdiff
1.12.0
authorwestcott <westcott>
Fri, 23 Jul 2010 14:27:45 +0000 (14:27 +0000)
committerwestcott <westcott>
Fri, 23 Jul 2010 14:27:45 +0000 (14:27 +0000)
getoturepcommand.cpp
getrelabundcommand.cpp
makefile
mgclustercommand.cpp

index b3bfd42369297c2caf5441ce56f65594cfa7c68e..89c62faba2f0d3350d3dea797bd2bebbe23074c3 100644 (file)
@@ -214,6 +214,7 @@ void GetOTURepCommand::help(){
                m->mothurOut("The default value for label is all labels in your inputfile.\n");
                m->mothurOut("The sorted parameter allows you to indicate you want the output sorted. You can sort by sequence name, bin number, bin size or group. The default is no sorting, but your options are name, number, size, or group.\n");
                m->mothurOut("The large parameter allows you to indicate that your distance matrix is too large to fit in RAM.  The default value is false.\n");
+               m->mothurOut("The group parameter allows you provide a group file.\n");
                m->mothurOut("The groups parameter allows you to indicate that you want representative sequences for each group specified for each OTU, group name should be separated by dashes. ex. groups=A-B-C.\n");
                m->mothurOut("The get.oturep command outputs a .fastarep and .rep.names file for each distance you specify, selecting one OTU representative for each bin.\n");
                m->mothurOut("If you provide a groupfile, then it also appends the names of the groups present in that bin.\n");
index 4d155f2f0fda2b4462450ad5e2789e70a12b13d7..90d084f3e9be3f27f0723f4e5b095bd3cc61a1c7 100644 (file)
@@ -226,14 +226,6 @@ int GetRelAbundCommand::getRelAbundance(vector<SharedRAbundVector*>& thisLookUp,
        try {
                if (pickedGroups) { eliminateZeroOTUS(thisLookUp); }
 
-               int totalNumSeqs = 0;
-               if ((scale == "totalgroup") || (scale == "averagegroup")) {
-                       for (int i = 0; i < thisLookUp.size(); i++) {
-                               //find total number of sequences in all samples
-                               totalNumSeqs += thisLookUp[i]->getNumSeqs();
-                       }
-               }
-               float averageNumSeqs = totalNumSeqs / (float) thisLookUp.size();
                
                 for (int i = 0; i < thisLookUp.size(); i++) {
                        out << thisLookUp[i]->getLabel() << '\t' << thisLookUp[i]->getGroup() << '\t' << thisLookUp[i]->getNumBins() << '\t';
@@ -246,8 +238,8 @@ int GetRelAbundCommand::getRelAbundance(vector<SharedRAbundVector*>& thisLookUp,
                                
                                float relabund = 0.0;
                                
-                               if (scale == "totalgroup") {  //abund of this otu compared to total number of sequence in my group
-                                       relabund = abund / (float) totalNumSeqs;
+                               if (scale == "totalgroup") { 
+                                       relabund = abund / (float) thisLookUp[i]->getNumSeqs();
                                }else if (scale == "totalotu") {
                                        //calc the total in this otu
                                        int totalOtu = 0;
@@ -255,7 +247,7 @@ int GetRelAbundCommand::getRelAbundance(vector<SharedRAbundVector*>& thisLookUp,
                                        
                                        relabund = abund / (float) totalOtu;
                                }else if (scale == "averagegroup") {
-                                       relabund = abund / (float) averageNumSeqs;
+                                       relabund = abund / (float) (thisLookUp[i]->getNumSeqs() / (float) thisLookUp[i]->getNumBins());
                                }else if (scale == "averageotu") {
                                        //calc the total in this otu
                                        int totalOtu = 0;
index 974890d363ee400ec3a243aecc23e1f4ff79c9a5..3f0893c5ad82d811fb4c5cf05f86f0326b4561c8 100644 (file)
--- a/makefile
+++ b/makefile
@@ -13,7 +13,7 @@
 
 CXXFLAGS += -O3
 
-MOTHUR_FILES = "\"/Users/SarahsWork/desktop/Release\""
+MOTHUR_FILES = "\"Enter_your_default_path_here\""
 ifeq  ($(strip $(MOTHUR_FILES)),"\"Enter_your_default_path_here\"")
 else
        CXXFLAGS += -DMOTHUR_FILES=${MOTHUR_FILES}
index 269e08853e16478918e830a279b68958954fe16a..9a1ac215388e09e6477fffa034e0542c38c208b1 100644 (file)
@@ -500,13 +500,16 @@ ListVector* MGClusterCommand::mergeOPFs(map<string, int> binInfo, float dist){
                                        float overlapDistance;
                                        inOverlap >> firstName >> secondName >> overlapDistance; gobble(inOverlap);
                                        
-                                       map<string,int>::iterator itA = nameMap->find(firstName);
-                                       map<string,int>::iterator itB = nameMap->find(secondName);
-                                       if(itA == nameMap->end()){  cerr << "AAError: Sequence '" << firstName << "' was not found in the names file, please correct\n"; exit(1);  }
-                                       if(itB == nameMap->end()){  cerr << "ABError: Sequence '" << secondName << "' was not found in the names file, please correct\n"; exit(1);  }
+                                       //commented out because we check this in readblast already
+                                       //map<string,int>::iterator itA = nameMap->find(firstName);
+                                       //map<string,int>::iterator itB = nameMap->find(secondName);
+                                       //if(itA == nameMap->end()){  cerr << "AAError: Sequence '" << firstName << "' was not found in the names file, please correct\n"; exit(1);  }
+                                       //if(itB == nameMap->end()){  cerr << "ABError: Sequence '" << secondName << "' was not found in the names file, please correct\n"; exit(1);  }
                                        
-                                       overlapNode.seq1 = itA->second;
-                                       overlapNode.seq2 = itB->second;
+                                       //overlapNode.seq1 = itA->second;
+                                       //overlapNode.seq2 = itB->second;
+                                       overlapNode.seq1 = nameMap->get(firstName);
+                                       overlapNode.seq2 = nameMap->get(secondName);
                                        overlapNode.dist = overlapDistance;
                                }else { inOverlap.close(); break; }
                        }