Permalink
Browse files

Merge branch 'v.1.38.0' into Opticluster

  • Loading branch information...
2 parents e64bd59 + 7b0b4d0 commit a591ad7ee21c59003fd4db49da1ca0f840759406 @mothur-westcott mothur-westcott committed Jun 30, 2016
Showing with 2,262 additions and 467 deletions.
  1. +5 −8 Makefile
  2. +26 −6 Mothur.xcodeproj/project.pbxproj
  3. +97 −0 TestMothur/testcommands/testrenamefilecommand.cpp
  4. +40 −0 TestMothur/testcommands/testrenamefilecommand.h
  5. +3 −3 makefile-internal
  6. +1 −1 source/classifier/phylotree.cpp
  7. +5 −0 source/commandfactory.cpp
  8. +4 −4 source/commands/chimerauchimecommand.cpp
  9. +0 −1 source/commands/chimerauchimecommand.h
  10. +1,642 −0 source/commands/chimeravsearchcommand.cpp
  11. +66 −0 source/commands/chimeravsearchcommand.h
  12. +68 −71 source/commands/classifyotucommand.cpp
  13. +2 −2 source/commands/classifyotucommand.h
  14. +2 −0 source/commands/clustercommand.cpp
  15. +4 −4 source/commands/clustersplitcommand.cpp
  16. +16 −4 source/commands/makebiomcommand.cpp
  17. +26 −44 source/commands/makecontigscommand.cpp
  18. +68 −201 source/commands/makecontigscommand.h
  19. +1 −1 source/commands/pcrseqscommand.cpp
  20. +72 −28 source/commands/renamefilecommand.cpp
  21. +7 −2 source/commands/renamefilecommand.h
  22. +1 −1 source/commands/splitgroupscommand.cpp
  23. +3 −22 source/commands/summarytaxcommand.cpp
  24. +1 −1 source/commands/summarytaxcommand.h
  25. +6 −0 source/datastructures/sequence.cpp
  26. +1 −0 source/datastructures/sequence.hpp
  27. +3 −3 source/datastructures/sequencecountparser.cpp
  28. +1 −1 source/datastructures/sequencecountparser.h
  29. +3 −3 source/datastructures/sequenceparser.cpp
  30. +1 −1 source/datastructures/sequenceparser.h
  31. +22 −16 source/heatmapsim.cpp
  32. +1 −1 source/heatmapsim.h
  33. +4 −4 source/mothurout.cpp
  34. +1 −1 source/mothurout.h
  35. +8 −0 source/optionparser.cpp
  36. +6 −4 source/read/splitmatrix.cpp
  37. +27 −11 source/validparameter.cpp
  38. +18 −15 source/vsearchfileparser.cpp
  39. +0 −3 source/weightedlinkage.cpp
View
13 Makefile 100755 → 100644
@@ -13,9 +13,10 @@ OPTIMIZE ?= yes
USEREADLINE ?= yes
USEBOOST ?= yes
BOOST_LIBRARY_DIR="\"Enter_your_boost_library_path_here\""
+BOOST_INCLUDE_DIR="\"Enter_your_boost_include_path_here\""
MOTHUR_FILES="\"Enter_your_default_path_here\""
-RELEASE_DATE = "\"4/05/2016\""
-VERSION = "\"1.37.0\""
+RELEASE_DATE = "\"6/20/2016\""
+VERSION = "\"1.37.6\""
ifeq ($(strip $(64BIT_VERSION)),yes)
CXXFLAGS += -DBIT_VERSION
@@ -44,14 +45,10 @@ ifeq ($(strip $(USEREADLINE)),yes)
endif
-#The boost libraries allow you to read gz files.
+#User specified boost library
ifeq ($(strip $(USEBOOST)),yes)
-#User specified boost library path
-ifeq ($(strip $(BOOST_LIBRARY_DIR)),"\"Enter_your_boost_library_path_here\"")
-else
- LDFLAGS += ${BOOST_LIBRARY_DIR}
-endif
+ LDFLAGS += -L ${BOOST_LIBRARY_DIR}
LIBS += -lboost_iostreams -lz
CXXFLAGS += -DUSE_BOOST -I ${BOOST_INCLUDE_DIR}
@@ -838,6 +838,8 @@
4888416C1CC7F1B900C5E972 /* optimatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = optimatrix.h; path = source/datastructures/optimatrix.h; sourceTree = SOURCE_ROOT; };
489B55701BCD7F0100FB7DC8 /* vsearchfileparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vsearchfileparser.cpp; path = source/vsearchfileparser.cpp; sourceTree = "<group>"; };
489B55711BCD7F0100FB7DC8 /* vsearchfileparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vsearchfileparser.h; path = source/vsearchfileparser.h; sourceTree = "<group>"; };
+ 48A11C6C1CDA40F0003481D8 /* testrenamefilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testrenamefilecommand.cpp; path = testcommands/testrenamefilecommand.cpp; sourceTree = "<group>"; };
+ 48A11C6D1CDA40F0003481D8 /* testrenamefilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = testrenamefilecommand.h; path = testcommands/testrenamefilecommand.h; sourceTree = "<group>"; };
48B662011BBB1B6600997EE4 /* testrenameseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testrenameseqscommand.cpp; path = testcommands/testrenameseqscommand.cpp; sourceTree = "<group>"; };
48B662021BBB1B6600997EE4 /* testrenameseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = testrenameseqscommand.h; path = testcommands/testrenameseqscommand.h; sourceTree = "<group>"; };
48C51DEE1A76B870004ECDF1 /* fastqread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = fastqread.h; path = source/datastructures/fastqread.h; sourceTree = SOURCE_ROOT; };
@@ -1760,6 +1762,8 @@
48C728731B6AB4CD00D40830 /* testgetgroupscommand.cpp */,
48C728691B69598400D40830 /* testmergegroupscommand.h */,
48C728681B69598400D40830 /* testmergegroupscommand.cpp */,
+ 48A11C6C1CDA40F0003481D8 /* testrenamefilecommand.cpp */,
+ 48A11C6D1CDA40F0003481D8 /* testrenamefilecommand.h */,
48B662011BBB1B6600997EE4 /* testrenameseqscommand.cpp */,
48B662021BBB1B6600997EE4 /* testrenameseqscommand.h */,
48C7286F1B6AB3B900D40830 /* testremovegroupscommand.cpp */,
@@ -1863,6 +1867,8 @@
A7E9B68A12D37EC400DA6239 /* chimeraslayercommand.cpp */,
A74D36B6137DAFAA00332B0C /* chimerauchimecommand.h */,
A74D36B7137DAFAA00332B0C /* chimerauchimecommand.cpp */,
+ 48EDB76A1D1320DD00F76E93 /* chimeravsearchcommand.cpp */,
+ 48EDB76B1D1320DD00F76E93 /* chimeravsearchcommand.h */,
A7E9B68D12D37EC400DA6239 /* chopseqscommand.h */,
A7E9B68C12D37EC400DA6239 /* chopseqscommand.cpp */,
A7E9B69112D37EC400DA6239 /* classifyotucommand.h */,
@@ -2788,6 +2794,7 @@
481FB64A1AC1B7F40076CFF3 /* suffixnodes.cpp in Sources */,
488841661CC6C35500C5E972 /* renamefilecommand.cpp in Sources */,
481FB53F1AC1B6000076CFF3 /* canberra.cpp in Sources */,
+ 48A11C6E1CDA40F0003481D8 /* testrenamefilecommand.cpp in Sources */,
481FB62B1AC1B7EA0076CFF3 /* database.cpp in Sources */,
481FB5BD1AC1B74F0076CFF3 /* getlabelcommand.cpp in Sources */,
481FB5B91AC1B74F0076CFF3 /* getcurrentcommand.cpp in Sources */,
@@ -3014,6 +3021,7 @@
A7E9B8A812D37EC400DA6239 /* clustercommand.cpp in Sources */,
A7E9B8A912D37EC400DA6239 /* clusterdoturcommand.cpp in Sources */,
A7E9B8AA12D37EC400DA6239 /* clusterfragmentscommand.cpp in Sources */,
+ 48EDB76C1D1320DD00F76E93 /* chimeravsearchcommand.cpp in Sources */,
A7E9B8AB12D37EC400DA6239 /* clustersplitcommand.cpp in Sources */,
A7E9B8AC12D37EC400DA6239 /* cmdargs.cpp in Sources */,
A7E9B8AD12D37EC400DA6239 /* collect.cpp in Sources */,
@@ -3359,6 +3367,11 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "VERSION=\"\\\"1.37.1\\\"\"",
+ "RELEASE_DATE=\"\\\"04/11/2016\\\"\"",
+ "MOTHUR_FILES=\"\\\"/Users/sarahwestcott/desktop/release\\\"\"",
+ );
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
GCC_WARN_UNINITIALIZED_AUTOS = NO;
GCC_WARN_UNUSED_FUNCTION = YES;
@@ -3368,6 +3381,7 @@
/usr/local/lib/,
/usr/local/include/,
);
+ ONLY_ACTIVE_ARCH = YES;
PRELINK_LIBS = "";
PRODUCT_NAME = mothur;
SDKROOT = macosx10.9;
@@ -3388,6 +3402,11 @@
DSTROOT = TARGET_BUILD_DIR;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "VERSION=\"\\\"1.37.1\\\"\"",
+ "RELEASE_DATE=\"\\\"04/11/2016\\\"\"",
+ "MOTHUR_FILES=\"\\\"/Users/sarahwestcott/desktop/release\\\"\"",
+ );
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
GCC_WARN_UNINITIALIZED_AUTOS = NO;
GCC_WARN_UNUSED_VALUE = YES;
@@ -3462,8 +3481,9 @@
GCC_MODEL_TUNING = "";
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
- "VERSION=\"\\\"1.36.0\\\"\"",
- "RELEASE_DATE=\"\\\"07/23/2015\\\"\"",
+ "VERSION=\"\\\"1.37.6\\\"\"",
+ "RELEASE_DATE=\"\\\"06/20/2016\\\"\"",
+ "MOTHUR_FILES=\"\\\"/Users/sarahwestcott/desktop/release\\\"\"",
);
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
@@ -3535,7 +3555,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
+ SDKROOT = macosx10.9;
};
name = Debug;
};
@@ -3561,8 +3581,8 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_PREPROCESSOR_DEFINITIONS = (
- "VERSION=\"\\\"1.37.0\\\"\"",
- "RELEASE_DATE=\"\\\"04/05/2015\\\"\"",
+ "VERSION=\"\\\"1.37.6\\\"\"",
+ "RELEASE_DATE=\"\\\"06/20/2016\\\"\"",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@@ -3572,7 +3592,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
+ SDKROOT = macosx10.9;
};
name = Release;
};
@@ -0,0 +1,97 @@
+//
+// testrenamefilecommand.cpp
+// Mothur
+//
+// Created by Sarah Westcott on 5/4/16.
+// Copyright (c) 2016 Schloss Lab. All rights reserved.
+//
+
+#include "testrenamefilecommand.h"
+#include "dataset.h"
+#include "catch.hpp"
+
+/**************************************************************************************************/
+TestRenameFileCommand::TestRenameFileCommand() { //setup
+ m = MothurOut::getInstance();
+ TestDataSet data;
+ filenames = data.getSubsetFNGFiles(100);
+}
+/**************************************************************************************************/
+TestRenameFileCommand::~TestRenameFileCommand() {
+ for (int i = 0; i < filenames.size(); i++) { m->mothurRemove(filenames[i]); } //teardown
+}
+/**************************************************************************************************/
+TEST_CASE("Testing RenameFileCommand Class") {
+ TestRenameFileCommand testRename;
+
+ SECTION("Testing GetNewName - with prefix") {
+ INFO("Using prefix=greatData") // Only appears on a FAIL
+
+ testRename.prefix = "greatData";
+ testRename.mothurGenerated = true;
+
+ CAPTURE(testRename.getNewName(testRename.filenames[0], "fasta")); // Displays this variable on a FAIL
+
+ CHECK(testRename.getNewName(testRename.filenames[0], "fasta") == "greatData.txt");
+
+ testRename.filenames[0] = testRename.getNewName(testRename.filenames[0], "fasta"); //for teardown
+ }
+
+ SECTION("Testing GetNewName - with user name") {
+ INFO("Using prefix=greatData") // Only appears on a FAIL
+
+ testRename.outputfile = "greatData.fasta";
+ testRename.mothurGenerated = false;
+
+ CAPTURE(testRename.getNewName(testRename.filenames[0], "fasta")); // Displays this variable on a FAIL
+
+ CHECK(testRename.getNewName(testRename.filenames[0], "fasta") == "greatData.fasta");
+
+ testRename.filenames[0] = testRename.getNewName(testRename.filenames[0], "fasta"); //for teardown
+ }
+
+
+ SECTION("Testing RenameOrCopy - deleteOld=false") {
+ INFO("Uses mothur rename function to move or system command to copy.") // Only appears on a FAIL
+
+ testRename.deleteOld = false;
+
+ testRename.renameOrCopy(testRename.filenames[0], "greatData.new.fasta");
+
+ ifstream in, in2;
+ int ableToOpen = testRename.m->openInputFile("greatData.new.fasta", in);
+ in.close();
+
+ CAPTURE(ableToOpen);
+
+ CHECK(ableToOpen == 0);
+
+ int ableToOpen2 = testRename.m->openInputFile(testRename.filenames[0], in2);
+ in2.close();
+
+ CAPTURE(ableToOpen2);
+
+ CHECK(ableToOpen2 == 0);
+
+ testRename.m->mothurRemove("greatData.new.fasta");
+ }
+
+ SECTION("Testing RenameOrCopy - deleteOld=true") {
+ INFO("Uses mothur rename function to move or system command to copy.") // Only appears on a FAIL
+
+ testRename.deleteOld = true;
+
+ testRename.renameOrCopy(testRename.filenames[0], "greatData.new.fasta");
+
+ ifstream in, in2;
+ int ableToOpen = testRename.m->openInputFile("greatData.new.fasta", in);
+ in.close();
+
+ CAPTURE(ableToOpen);
+
+ CHECK(ableToOpen == 0);
+
+ testRename.filenames[0] = testRename.getNewName(testRename.filenames[0], "fasta"); //for teardown
+ }
+}
+/**************************************************************************************************/
@@ -0,0 +1,40 @@
+//
+// testrenamefilecommand.h
+// Mothur
+//
+// Created by Sarah Westcott on 5/4/16.
+// Copyright (c) 2016 Schloss Lab. All rights reserved.
+//
+
+#ifndef __Mothur__testrenamefilecommand__
+#define __Mothur__testrenamefilecommand__
+
+#include "renamefilecommand.h"
+
+class TestRenameFileCommand : public RenameFileCommand {
+
+public:
+
+ TestRenameFileCommand();
+ ~TestRenameFileCommand();
+
+
+ MothurOut* m;
+ vector<string> filenames;
+
+ //private functions
+ using RenameFileCommand::getNewName;
+ using RenameFileCommand::renameOrCopy;
+
+ //private variables
+ using RenameFileCommand::prefix;
+ using RenameFileCommand::mothurGenerated;
+ using RenameFileCommand::outputfile;
+ using RenameFileCommand::deleteOld;
+
+
+
+};
+
+
+#endif /* defined(__Mothur__testrenamefilecommand__) */
View
6 makefile-internal 100755 → 100644
@@ -1,8 +1,8 @@
64BIT_VERSION ?= yes
USEREADLINE ?= yes
USEBOOST ?= yes
-RELEASE_DATE = "\"4/11/2016\""
-VERSION = "\"1.37.0\""
+RELEASE_DATE = "\"5/11/2016\""
+VERSION = "\"1.37.4\""
# Optimize to level 3:
CXXFLAGS += -O3
@@ -45,7 +45,7 @@ ifeq ($(strip $(USEBOOST)),yes)
LIBS += ${BOOST_LIBRARY_DIR}/libboost_iostreams.a
#if mac
- LIBS += ${BOOST_LIBRARY_DIR}/zlib.a
+ LIBS += -lz
#if linux or windows
#LIBS += ${BOOST_LIBRARY_DIR}/libz.a
@@ -186,7 +186,7 @@ int PhyloTree::addSeqToTree(string seqName, string seqTaxonomy){
map<string, int>::iterator childPointer;
int currentNode = 0;
- int level = 1;
+ int level = 0;
tree[0].accessions.push_back(seqName);
m->removeConfidences(seqTaxonomy);
@@ -151,6 +151,7 @@
#include "makefilecommand.h"
#include "biominfocommand.h"
#include "renamefilecommand.h"
+#include "chimeravsearchcommand.h"
//needed for testing project
//CommandFactory* CommandFactory::_uniqueInstance;
@@ -278,6 +279,7 @@ CommandFactory::CommandFactory(){
commands["chimera.perseus"] = "chimera.perseus";
commands["chimera.pintail"] = "chimera.pintail";
commands["chimera.bellerophon"] = "chimera.bellerophon";
+ commands["chimera.vsearch"] = "chimera.vsearch";
commands["screen.seqs"] = "screen.seqs";
commands["summary.seqs"] = "summary.seqs";
commands["cluster.split"] = "cluster.split";
@@ -479,6 +481,7 @@ Command* CommandFactory::getCommand(string commandName, string optionString){
else if(commandName == "chimera.uchime") { command = new ChimeraUchimeCommand(optionString); }
else if(commandName == "chimera.pintail") { command = new ChimeraPintailCommand(optionString); }
else if(commandName == "chimera.bellerophon") { command = new ChimeraBellerophonCommand(optionString); }
+ else if(commandName == "chimera.vsearch") { command = new ChimeraVsearchCommand(optionString); }
else if(commandName == "phylotype") { command = new PhylotypeCommand(optionString); }
else if(commandName == "mgcluster") { command = new MGClusterCommand(optionString); }
else if(commandName == "pre.cluster") { command = new PreClusterCommand(optionString); }
@@ -651,6 +654,7 @@ Command* CommandFactory::getCommand(string commandName, string optionString, str
else if(commandName == "chimera.slayer") { pipecommand = new ChimeraSlayerCommand(optionString); }
else if(commandName == "chimera.pintail") { pipecommand = new ChimeraPintailCommand(optionString); }
else if(commandName == "chimera.bellerophon") { pipecommand = new ChimeraBellerophonCommand(optionString); }
+ else if(commandName == "chimera.vsearch") { pipecommand = new ChimeraVsearchCommand(optionString); }
else if(commandName == "phylotype") { pipecommand = new PhylotypeCommand(optionString); }
else if(commandName == "mgcluster") { pipecommand = new MGClusterCommand(optionString); }
else if(commandName == "pre.cluster") { pipecommand = new PreClusterCommand(optionString); }
@@ -809,6 +813,7 @@ Command* CommandFactory::getCommand(string commandName){
else if(commandName == "chimera.uchime") { shellcommand = new ChimeraUchimeCommand(); }
else if(commandName == "chimera.pintail") { shellcommand = new ChimeraPintailCommand(); }
else if(commandName == "chimera.bellerophon") { shellcommand = new ChimeraBellerophonCommand(); }
+ else if(commandName == "chimera.vsearch") { shellcommand = new ChimeraVsearchCommand(); }
else if(commandName == "phylotype") { shellcommand = new PhylotypeCommand(); }
else if(commandName == "mgcluster") { shellcommand = new MGClusterCommand(); }
else if(commandName == "pre.cluster") { shellcommand = new PreClusterCommand(); }
@@ -675,7 +675,7 @@ int ChimeraUchimeCommand::execute(){
if (error == 1) { for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } return 0; }
if (seqs.size() != nameMapCount.size()) { m->mothurOut( "The number of sequences in your fastafile does not match the number of sequences in your namefile, aborting."); m->mothurOutEndLine(); for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } return 0; }
- m->printVsearchFile(nameMapCount, newFasta);
+ m->printVsearchFile(nameMapCount, newFasta, "/ab=", "/");
fastaFileNames[s] = newFasta;
}
@@ -1157,8 +1157,8 @@ int ChimeraUchimeCommand::driverGroups(string outputFName, string filename, stri
int start = time(NULL); if (m->control_pressed) { outCountList.close(); m->mothurRemove(countlist); return 0; }
int error;
- if (hasCount) { error = cparser->getSeqs(groups[i], filename, true); if ((error == 1) || m->control_pressed) { return 0; } }
- else { error = sparser->getSeqs(groups[i], filename, true); if ((error == 1) || m->control_pressed) { return 0; } }
+ if (hasCount) { error = cparser->getSeqs(groups[i], filename, "/ab=", "/", true); if ((error == 1) || m->control_pressed) { return 0; } }
+ else { error = sparser->getSeqs(groups[i], filename, "/ab=", "/", true); if ((error == 1) || m->control_pressed) { return 0; } }
int numSeqs = driver((outputFName + groups[i]), filename, (accnos+groups[i]), (alns+ groups[i]), numChimeras);
totalSeqs += numSeqs;
@@ -1484,7 +1484,7 @@ int ChimeraUchimeCommand::driver(string outputFName, string filename, string acc
//int numArgs = cPara.size();
//uchime_main(numArgs, uchimeParameters);
- //cout << "commandString = " << commandString << endl;
+
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
commandString = "\"" + commandString + "\"";
@@ -11,7 +11,6 @@
*
*/
-#include "mothur.h"
#include "command.hpp"
#include "sequenceparser.h"
#include "counttable.h"
Oops, something went wrong.

0 comments on commit a591ad7

Please sign in to comment.