Permalink
Please sign in to comment.
Showing
with
4,293 additions
and 4,565 deletions.
- +39 −65 Mothur.xcodeproj/project.pbxproj
- +1 −1 TestMothur/dataset.h
- +97 −0 TestMothur/testcommands/testrenamefilecommand.cpp
- +40 −0 TestMothur/testcommands/testrenamefilecommand.h
- +43 −0 TestMothur/testtrimoligos.cpp
- +38 −0 TestMothur/testtrimoligos.hpp
- +0 −3 source/averagelinkage.cpp
- +24 −46 source/chimera/mothurchimera.cpp
- +8 −69 source/classifier/bayesian.cpp
- +78 −132 source/classifier/classify.cpp
- +0 −3 source/classifier/phylosummary.cpp
- +1 −1 source/classifier/phylotree.cpp
- +4 −2 source/cluster.hpp
- +11 −14 source/commandfactory.cpp
- +3 −23 source/commands/aligncommand.cpp
- +3 −23 source/commands/chimeraccodecommand.cpp
- +3 −24 source/commands/chimeracheckcommand.cpp
- +2 −21 source/commands/chimerapintailcommand.cpp
- +0 −2 source/commands/chimerapintailcommand.h
- +5 −26 source/commands/chimeraslayercommand.cpp
- +17 −24 source/commands/chimerauchimecommand.cpp
- +21 −3 source/commands/chimerauchimecommand.h
- +1,645 −0 source/commands/chimeravsearchcommand.cpp
- +66 −0 source/commands/chimeravsearchcommand.h
- +72 −75 source/commands/classifyotucommand.cpp
- +2 −2 source/commands/classifyotucommand.h
- +41 −10 source/commands/classifyrfsharedcommand.cpp
- +2 −2 source/commands/classifyrfsharedcommand.h
- +8 −34 source/commands/classifyseqscommand.cpp
- +0 −2 source/commands/classifyseqscommand.h
- +0 −70 source/commands/clearmemorycommand.cpp
- +0 −41 source/commands/clearmemorycommand.h
- +2 −0 source/commands/clustercommand.cpp
- +5 −5 source/commands/clustersplitcommand.cpp
- +3 −128 source/commands/countseqscommand.cpp
- +2 −3 source/commands/countseqscommand.h
- +1 −0 source/commands/getmimarkspackagecommand.cpp
- +0 −499 source/commands/hclustercommand.cpp
- +0 −73 source/commands/hclustercommand.h
- +21 −2 source/commands/lefsecommand.cpp
- +2 −2 source/commands/lefsecommand.h
- +16 −4 source/commands/makebiomcommand.cpp
- +69 −12 source/commands/makecontigscommand.cpp
- +105 −249 source/commands/mgclustercommand.cpp
- +0 −2 source/commands/mgclustercommand.h
- +1 −0 source/commands/parsefastaqcommand.cpp
- +12 −8 source/commands/pcrseqscommand.cpp
- +8 −7 source/commands/pcrseqscommand.h
- +0 −790 source/commands/pipelinepdscommand.cpp
- +0 −57 source/commands/pipelinepdscommand.h
- +706 −0 source/commands/renamefilecommand.cpp
- +50 −0 source/commands/renamefilecommand.h
- +1 −0 source/commands/renameseqscommand.cpp
- +46 −14 source/commands/sensspeccommand.cpp
- +1 −1 source/commands/sensspeccommand.h
- +1 −0 source/commands/seqerrorcommand.cpp
- +1 −1 source/commands/splitgroupscommand.cpp
- +1 −0 source/commands/sracommand.cpp
- +8 −24 source/commands/summarytaxcommand.cpp
- +1 −1 source/commands/summarytaxcommand.h
- +39 −59 source/datastructures/alignmentdb.cpp
- +6 −1 source/datastructures/designmap.cpp
- +18 −8 source/datastructures/groupmap.cpp
- +68 −2 source/datastructures/oligos.cpp
- +0 −34 source/datastructures/referencedb.cpp
- +0 −49 source/datastructures/referencedb.h
- +6 −0 source/datastructures/sequence.cpp
- +1 −0 source/datastructures/sequence.hpp
- +3 −3 source/datastructures/sequencecountparser.cpp
- +1 −1 source/datastructures/sequencecountparser.h
- +3 −3 source/datastructures/sequenceparser.cpp
- +1 −1 source/datastructures/sequenceparser.h
- +0 −807 source/hcluster.cpp
- +0 −86 source/hcluster.h
- +22 −16 source/heatmapsim.cpp
- +1 −1 source/heatmapsim.h
- +5 −4 source/mothur.cpp
- +92 −113 source/mothurout.cpp
- +3 −2 source/mothurout.h
- +0 −59 source/randomforest/abstractrandomforest.cpp
- +0 −67 source/randomforest/abstractrandomforest.hpp
- +0 −63 source/randomforest/regularizedrandomforest.cpp
- +0 −30 source/randomforest/regularizedrandomforest.h
- +31 −86 source/read/readblast.cpp
- +1 −2 source/read/readblast.h
- +617 −444 source/trimoligos.cpp
- +2 −2 source/trimoligos.h
- +27 −11 source/validparameter.cpp
- +5 −7 source/vsearchfileparser.cpp
- +4 −1 source/vsearchfileparser.h
- +0 −3 source/weightedlinkage.cpp
| @@ -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 */ |
Oops, something went wrong.
0 comments on commit
68c3430