Permalink
Browse files

Merge branch 'v.1.38.0'

  • Loading branch information...
2 parents 7120a4d + 8ca2f06 commit 68c34302d8d5a073fbb59ed802ad4b8338129313 @mothur-westcott mothur-westcott committed Jul 19, 2016
Showing with 4,293 additions and 4,565 deletions.
  1. +39 −65 Mothur.xcodeproj/project.pbxproj
  2. +1 −1 TestMothur/dataset.h
  3. +97 −0 TestMothur/testcommands/testrenamefilecommand.cpp
  4. +40 −0 TestMothur/testcommands/testrenamefilecommand.h
  5. +43 −0 TestMothur/testtrimoligos.cpp
  6. +38 −0 TestMothur/testtrimoligos.hpp
  7. +0 −3 source/averagelinkage.cpp
  8. +24 −46 source/chimera/mothurchimera.cpp
  9. +8 −69 source/classifier/bayesian.cpp
  10. +78 −132 source/classifier/classify.cpp
  11. +0 −3 source/classifier/phylosummary.cpp
  12. +1 −1 source/classifier/phylotree.cpp
  13. +4 −2 source/cluster.hpp
  14. +11 −14 source/commandfactory.cpp
  15. +3 −23 source/commands/aligncommand.cpp
  16. +3 −23 source/commands/chimeraccodecommand.cpp
  17. +3 −24 source/commands/chimeracheckcommand.cpp
  18. +2 −21 source/commands/chimerapintailcommand.cpp
  19. +0 −2 source/commands/chimerapintailcommand.h
  20. +5 −26 source/commands/chimeraslayercommand.cpp
  21. +17 −24 source/commands/chimerauchimecommand.cpp
  22. +21 −3 source/commands/chimerauchimecommand.h
  23. +1,645 −0 source/commands/chimeravsearchcommand.cpp
  24. +66 −0 source/commands/chimeravsearchcommand.h
  25. +72 −75 source/commands/classifyotucommand.cpp
  26. +2 −2 source/commands/classifyotucommand.h
  27. +41 −10 source/commands/classifyrfsharedcommand.cpp
  28. +2 −2 source/commands/classifyrfsharedcommand.h
  29. +8 −34 source/commands/classifyseqscommand.cpp
  30. +0 −2 source/commands/classifyseqscommand.h
  31. +0 −70 source/commands/clearmemorycommand.cpp
  32. +0 −41 source/commands/clearmemorycommand.h
  33. +2 −0 source/commands/clustercommand.cpp
  34. +5 −5 source/commands/clustersplitcommand.cpp
  35. +3 −128 source/commands/countseqscommand.cpp
  36. +2 −3 source/commands/countseqscommand.h
  37. +1 −0 source/commands/getmimarkspackagecommand.cpp
  38. +0 −499 source/commands/hclustercommand.cpp
  39. +0 −73 source/commands/hclustercommand.h
  40. +21 −2 source/commands/lefsecommand.cpp
  41. +2 −2 source/commands/lefsecommand.h
  42. +16 −4 source/commands/makebiomcommand.cpp
  43. +69 −12 source/commands/makecontigscommand.cpp
  44. +105 −249 source/commands/mgclustercommand.cpp
  45. +0 −2 source/commands/mgclustercommand.h
  46. +1 −0 source/commands/parsefastaqcommand.cpp
  47. +12 −8 source/commands/pcrseqscommand.cpp
  48. +8 −7 source/commands/pcrseqscommand.h
  49. +0 −790 source/commands/pipelinepdscommand.cpp
  50. +0 −57 source/commands/pipelinepdscommand.h
  51. +706 −0 source/commands/renamefilecommand.cpp
  52. +50 −0 source/commands/renamefilecommand.h
  53. +1 −0 source/commands/renameseqscommand.cpp
  54. +46 −14 source/commands/sensspeccommand.cpp
  55. +1 −1 source/commands/sensspeccommand.h
  56. +1 −0 source/commands/seqerrorcommand.cpp
  57. +1 −1 source/commands/splitgroupscommand.cpp
  58. +1 −0 source/commands/sracommand.cpp
  59. +8 −24 source/commands/summarytaxcommand.cpp
  60. +1 −1 source/commands/summarytaxcommand.h
  61. +39 −59 source/datastructures/alignmentdb.cpp
  62. +6 −1 source/datastructures/designmap.cpp
  63. +18 −8 source/datastructures/groupmap.cpp
  64. +68 −2 source/datastructures/oligos.cpp
  65. +0 −34 source/datastructures/referencedb.cpp
  66. +0 −49 source/datastructures/referencedb.h
  67. +6 −0 source/datastructures/sequence.cpp
  68. +1 −0 source/datastructures/sequence.hpp
  69. +3 −3 source/datastructures/sequencecountparser.cpp
  70. +1 −1 source/datastructures/sequencecountparser.h
  71. +3 −3 source/datastructures/sequenceparser.cpp
  72. +1 −1 source/datastructures/sequenceparser.h
  73. +0 −807 source/hcluster.cpp
  74. +0 −86 source/hcluster.h
  75. +22 −16 source/heatmapsim.cpp
  76. +1 −1 source/heatmapsim.h
  77. +5 −4 source/mothur.cpp
  78. +92 −113 source/mothurout.cpp
  79. +3 −2 source/mothurout.h
  80. +0 −59 source/randomforest/abstractrandomforest.cpp
  81. +0 −67 source/randomforest/abstractrandomforest.hpp
  82. +0 −63 source/randomforest/regularizedrandomforest.cpp
  83. +0 −30 source/randomforest/regularizedrandomforest.h
  84. +31 −86 source/read/readblast.cpp
  85. +1 −2 source/read/readblast.h
  86. +617 −444 source/trimoligos.cpp
  87. +2 −2 source/trimoligos.h
  88. +27 −11 source/validparameter.cpp
  89. +5 −7 source/vsearchfileparser.cpp
  90. +4 −1 source/vsearchfileparser.h
  91. +0 −3 source/weightedlinkage.cpp
View
104 Mothur.xcodeproj/project.pbxproj 100755 → 100644

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -29,7 +29,7 @@ class TestDataSet {
vector<FastqRead> getReverseFastq() { return fastqData.getReverseFastq(); }
vector<string> getSubsetFRFastq(int n) { return fastqData.getSubsetFRFastq(n); }
- vector<string> getSubsetFNGFiles(int); //number of uniques, Fasta, name, group returned
+ vector<string> getSubsetFNGFiles(int); //number of uniques passed in. 3 files returned -> Fasta, name, group.
private:
MothurOut* m;
@@ -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__) */
@@ -0,0 +1,43 @@
+//
+// testtrimoligos.cpp
+// Mothur
+//
+// Created by Sarah Westcott on 7/14/16.
+// Copyright © 2016 Schloss Lab. All rights reserved.
+//
+
+#include "catch.hpp"
+#include "testtrimoligos.hpp"
+
+/**************************************************************************************************/
+TestTrimOligos::TestTrimOligos() { //setup
+ m = MothurOut::getInstance();
+
+ //set up barcodes, primers, pairedBarcodes and pairedPrimers
+
+ //Set up vector of seqs with barcodes and primers
+
+ //Set up vector of seqs with pairedbarcodes and pairedprimers
+
+}
+/**************************************************************************************************/
+TestTrimOligos::~TestTrimOligos() {
+
+}
+/**************************************************************************************************/
+
+TEST_CASE("Testing TrimOligos Class") {
+ TestTrimOligos testTrim;
+
+
+ //Create trimoligos classes with various constructors
+
+
+ //run all public strip functions
+
+
+ //run private functions
+
+
+}
+/**************************************************************************************************/
@@ -0,0 +1,38 @@
+//
+// testtrimoligos.hpp
+// Mothur
+//
+// Created by Sarah Westcott on 7/14/16.
+// Copyright © 2016 Schloss Lab. All rights reserved.
+//
+
+#ifndef testtrimoligos_hpp
+#define testtrimoligos_hpp
+
+#include "trimoligos.h"
+#include "sequence.hpp"
+
+class TestTrimOligos : public TrimOligos {
+
+
+public:
+
+ TestTrimOligos();
+ ~TestTrimOligos();
+
+ MothurOut* m;
+ vector<Sequence> seqs;
+ vector<Sequence> pairedSeqs;
+
+ map<string, int> barcodes;
+ map<string, int> primers;
+ map<int, oligosPair> pairedPrimers;
+ map<int, oligosPair> pairedBarcodes;
+
+ using TrimOligos::compareDNASeq(string, string);
+ using TrimOligos::countDiffs(string, string);
+
+};
+
+
+#endif /* testtrimoligos_hpp */
@@ -2,10 +2,7 @@
#define AVERAGE_H
//test
-#include "mothur.h"
#include "cluster.hpp"
-#include "rabundvector.hpp"
-#include "sparsedistancematrix.h"
/* This class implements the average UPGMA, average neighbor clustering algorithm */
@@ -8,7 +8,6 @@
*/
#include "mothurchimera.h"
-#include "referencedb.h"
//***************************************************************************************************************
//this is a vertical soft filter
@@ -100,53 +99,32 @@ vector<Sequence*> MothurChimera::readSeqs(string file) {
int count = 0;
length = 0;
unaligned = false;
- ReferenceDB* rdb = ReferenceDB::getInstance();
- if (file == "saved") {
-
-
- m->mothurOutEndLine(); m->mothurOut("Using sequences from " + rdb->getSavedReference() + " that are saved in memory."); m->mothurOutEndLine();
-
- for (int i = 0; i < rdb->referenceSeqs.size(); i++) {
- Sequence* temp = new Sequence(rdb->referenceSeqs[i].getName(), rdb->referenceSeqs[i].getAligned());
-
- if (count == 0) { length = temp->getAligned().length(); count++; } //gets first seqs length
- else if (length != temp->getAligned().length()) { unaligned = true; }
-
- if (temp->getName() != "") { container.push_back(temp); }
- }
-
- templateFileName = rdb->getSavedReference();
-
- }else {
-
- m->mothurOut("Reading sequences from " + file + "..."); cout.flush();
-
-
- ifstream in;
- m->openInputFile(file, in);
-
- //read in seqs and store in vector
- while(!in.eof()){
-
- if (m->control_pressed) { return container; }
-
- Sequence* current = new Sequence(in); m->gobble(in);
-
- if (count == 0) { length = current->getAligned().length(); count++; } //gets first seqs length
- else if (length != current->getAligned().length()) { unaligned = true; }
-
- if (current->getName() != "") {
- container.push_back(current);
- if (rdb->save) { rdb->referenceSeqs.push_back(*current); }
- }
- }
- in.close();
+
+ m->mothurOut("Reading sequences from " + file + "..."); cout.flush();
+
+
+ ifstream in;
+ m->openInputFile(file, in);
+
+ //read in seqs and store in vector
+ while(!in.eof()){
+
+ if (m->control_pressed) { return container; }
+
+ Sequence* current = new Sequence(in); m->gobble(in);
+
+ if (count == 0) { length = current->getAligned().length(); count++; } //gets first seqs length
+ else if (length != current->getAligned().length()) { unaligned = true; }
+
+ if (current->getName() != "") { container.push_back(current); }
+ }
+ in.close();
+
+ m->mothurOut("Done."); m->mothurOutEndLine();
+
+ filterString = (string(container[0]->getAligned().length(), '1'));
- m->mothurOut("Done."); m->mothurOutEndLine();
-
- filterString = (string(container[0]->getAligned().length(), '1'));
- }
return container;
}
Oops, something went wrong.

0 comments on commit 68c3430

Please sign in to comment.