Permalink
Please sign in to comment.
Showing
with
53,737 additions
and 2,721 deletions.
- +85 −26 Mothur.xcodeproj/project.pbxproj
- +1 −9 TestMothur/dataset.h
- +46,955 −0 TestMothur/distcdataset.cpp
- +32 −0 TestMothur/distcdataset.h
- +2,578 −0 TestMothur/distpdataset.cpp
- +30 −0 TestMothur/distpdataset.h
- +0 −1 TestMothur/main.cpp
- +129 −0 TestMothur/testclassifier/testphylotree.cpp
- +32 −0 TestMothur/testclassifier/testphylotree.hpp
- +3 −2 TestMothur/testcontainers/testfastqread.cpp
- +101 −0 TestMothur/testcontainers/testoptimatrix.cpp
- +31 −0 TestMothur/testcontainers/testoptimatrix.h
- +142 −0 TestMothur/testopticluster.cpp
- +36 −0 TestMothur/testopticluster.h
- +2 −2 TestMothur/testtrimoligos.hpp
- +3 −3 TestMothur/testvsearchfileparser.cpp
- +0 −1 TestMothur/testvsearchfileparser.h
- +12 −0 source/calculators/filters.h
- +0 −1 source/classifier/classify.cpp
- +17 −21 source/classifier/phylosummary.cpp
- +8 −5 source/classifier/phylotree.cpp
- +5 −0 source/classifier/phylotree.h
- +26 −15 source/classifier/taxonomyequalizer.cpp
- +2 −2 source/cluster.cpp
- +4 −6 source/cluster.hpp
- +2 −2 source/commands/catchallcommand.cpp
- +4 −2 source/commands/chimeraperseuscommand.cpp
- +4 −3 source/commands/chimeraperseuscommand.h
- +4 −2 source/commands/chimeraslayercommand.cpp
- +16 −16 source/commands/chimerauchimecommand.cpp
- +8 −6 source/commands/chimerauchimecommand.h
- +65 −285 source/commands/chimeravsearchcommand.cpp
- +0 −3 source/commands/chimeravsearchcommand.h
- +3 −3 source/commands/classifyotucommand.cpp
- +3 −2 source/commands/classifyseqscommand.cpp
- +209 −32 source/commands/clustercommand.cpp
- +10 −5 source/commands/clustercommand.h
- +236 −65 source/commands/clustersplitcommand.cpp
- +11 −6 source/commands/clustersplitcommand.h
- +54 −45 source/commands/createdatabasecommand.cpp
- +1 −1 source/commands/distancecommand.cpp
- +1 −1 source/commands/getcommandinfocommand.cpp
- +2 −4 source/commands/getgroupscommand.cpp
- +4 −6 source/commands/getlineagecommand.cpp
- +2 −1 source/commands/getotulabelscommand.cpp
- +0 −432 source/commands/getotuscommand.cpp
- +0 −55 source/commands/getotuscommand.h
- +3 −5 source/commands/getseqscommand.cpp
- +2 −5 source/commands/listseqscommand.cpp
- +6 −2 source/commands/makebiomcommand.cpp
- +127 −23 source/commands/makecontigscommand.cpp
- +626 −166 source/commands/makecontigscommand.h
- +90 −7 source/commands/makefilecommand.cpp
- +1 −1 source/commands/makefilecommand.h
- +25 −10 source/commands/mergetaxsummarycommand.cpp
- +4 −16 source/commands/mgclustercommand.cpp
- +1 −1 source/commands/mgclustercommand.h
- +3 −4 source/commands/pcrseqscommand.cpp
- +1 −29 source/commands/phylotypecommand.cpp
- +0 −2 source/commands/phylotypecommand.h
- +103 −67 source/commands/preclustercommand.cpp
- +56 −28 source/commands/preclustercommand.h
- +2 −4 source/commands/removegroupscommand.cpp
- +4 −5 source/commands/removelineagecommand.cpp
- +2 −1 source/commands/removeotulabelscommand.cpp
- +0 −439 source/commands/removeotuscommand.cpp
- +0 −52 source/commands/removeotuscommand.h
- +3 −5 source/commands/removeseqscommand.cpp
- +21 −24 source/commands/screenseqscommand.cpp
- +1 −1 source/commands/screenseqscommand.h
- +26 −32 source/commands/sensspeccommand.cpp
- +1 −2 source/commands/sensspeccommand.h
- +30 −9 source/commands/setdircommand.cpp
- +1 −1 source/commands/setdircommand.h
- +2 −10 source/commands/sffinfocommand.cpp
- +8 −8 source/commands/sffmultiplecommand.cpp
- +4 −2 source/commands/sharedcommand.cpp
- +16 −16 source/commands/shhhercommand.cpp
- +2 −1 source/commands/shhhseqscommand.cpp
- +2 −1 source/commands/shhhseqscommand.h
- +4 −4 source/commands/sortseqscommand.cpp
- +3 −0 source/commands/sparcccommand.cpp
- +4 −3 source/commands/splitgroupscommand.cpp
- +5 −1 source/commands/sracommand.cpp
- +1 −1 source/commands/sracommand.h
- +2 −2 source/commands/subsamplecommand.cpp
- +56 −57 source/commands/summarytaxcommand.cpp
- +1 −0 source/commands/summarytaxcommand.h
- +1 −2 source/datastructures/blastalign.cpp
- +9 −9 source/datastructures/blastdb.cpp
- +1 −1 source/datastructures/counttable.h
- +445 −0 source/datastructures/optimatrix.cpp
- +60 −0 source/datastructures/optimatrix.h
- +108 −61 source/datastructures/sequencecountparser.cpp
- +7 −5 source/datastructures/sequencecountparser.h
- +0 −54 source/datastructures/sequencedb.cpp
- +0 −2 source/datastructures/sequencedb.h
- +73 −202 source/datastructures/sequenceparser.cpp
- +3 −3 source/datastructures/sequenceparser.h
- +13 −5 source/engine.cpp
- +1 −1 source/linearalgebra.cpp
- +0 −171 source/makefile
- +4 −3 source/mothur.cpp
- +134 −65 source/mothurout.cpp
- +10 −4 source/mothurout.h
- +632 −0 source/opticluster.cpp
- +66 −0 source/opticluster.h
- +20 −4 source/optionparser.cpp
- +12 −1 source/read/splitmatrix.cpp
- +3 −1 source/read/splitmatrix.h
- +0 −1 source/singlelinkage.cpp
- +6 −0 source/trimoligos.h
- +5 −5 source/validparameter.cpp
- +2 −3 source/vsearchfileparser.cpp
| @@ -0,0 +1,32 @@ | ||
| +// | ||
| +// distcdataset.h | ||
| +// Mothur | ||
| +// | ||
| +// Created by Sarah Westcott on 6/8/16. | ||
| +// Copyright (c) 2016 Schloss Lab. All rights reserved. | ||
| +// | ||
| + | ||
| +#ifndef __Mothur__distcdataset__ | ||
| +#define __Mothur__distcdataset__ | ||
| + | ||
| +#include "mothurout.h" | ||
| + | ||
| +class DistCDataSet { | ||
| + | ||
| +public: | ||
| + | ||
| + DistCDataSet(); | ||
| + ~DistCDataSet() {} | ||
| + string getColumnFile() { return writeColumnFile(); } | ||
| + vector<string> getFiles(int); | ||
| + string getCountFile() { return writeCountFile(); } | ||
| + | ||
| +private: | ||
| + MothurOut* m; | ||
| + string writeColumnFile(); | ||
| + string writeCountFile(); | ||
| + | ||
| +}; | ||
| + | ||
| + | ||
| +#endif /* defined(__Mothur__distcdataset__) */ |
| @@ -0,0 +1,30 @@ | ||
| +// | ||
| +// distdataset.h | ||
| +// Mothur | ||
| +// | ||
| +// Created by Sarah Westcott on 6/6/16. | ||
| +// Copyright (c) 2016 Schloss Lab. All rights reserved. | ||
| +// | ||
| + | ||
| +#ifndef __Mothur__distdataset__ | ||
| +#define __Mothur__distdataset__ | ||
| + | ||
| +#include "mothurout.h" | ||
| + | ||
| +class DistPDataSet { | ||
| + | ||
| +public: | ||
| + | ||
| + DistPDataSet(); | ||
| + ~DistPDataSet() {} | ||
| + | ||
| + string getPhylipFile() { return writePhylipFile(); } | ||
| + | ||
| +private: | ||
| + MothurOut* m; | ||
| + string writePhylipFile(); | ||
| + | ||
| +}; | ||
| + | ||
| + | ||
| +#endif /* defined(__Mothur__distdataset__) */ |
| @@ -0,0 +1,129 @@ | ||
| +// | ||
| +// testphylotree.cpp | ||
| +// Mothur | ||
| +// | ||
| +// Created by Sarah Westcott on 8/29/16. | ||
| +// Copyright © 2016 Schloss Lab. All rights reserved. | ||
| +// | ||
| + | ||
| +#include "catch.hpp" | ||
| +#include "testphylotree.hpp" | ||
| + | ||
| +/**************************************************************************************************/ | ||
| +TestPhyloTree::TestPhyloTree() { //setup | ||
| + m = MothurOut::getInstance(); | ||
| + | ||
| + string tax1WithSpaces = "Bacteria(100);Bacteroidetes 7(100);Bacteroidia(100);Bacteroidales(100);S24-7(100);"; | ||
| + string tax2WithSpaces = "Bacteria(100);Bacteroidetes 7(100);Bacteroidia(98);Bacteroidales(98);Bacteroidaceae(98);Bacteroides(98);"; | ||
| + string tax3WithSpaces = "Bacteria(100);Firmicutes(100);Clostridia B(100);Clostridiales(100);Lachnospiraceae(100);Blautia(92);"; | ||
| + string tax4WithSpaces = "Bacteria(100);Firmicutes(100);Clostridia B(100);Clostridiales(100);Ruminococcaceae(100);Anaerotruncus(100);"; | ||
| + string tax5WithSpaces = "Bacteria(100);Firmicutes(100);Clostridia B(100);Clostridiales(100);Lachnospiraceae(100);Incertae_Sedis(97);"; | ||
| + | ||
| + string tax1WithOutSpaces = "Bacteria(100);Bacteroidetes(100);Bacteroidia(100);Bacteroidales(100);S24-7(100);"; | ||
| + string tax2WithOutSpaces = "Bacteria(100);Bacteroidetes(100);Bacteroidia(98);Bacteroidales(98);Bacteroidaceae(98);Bacteroides(98);"; | ||
| + string tax3WithOutSpaces = "Bacteria(100);Firmicutes(100);Clostridia(100);Clostridiales(100);Lachnospiraceae(100);Blautia(92);"; | ||
| + string tax4WithOutSpaces = "Bacteria(100);Firmicutes(100);Clostridia(100);Clostridiales(100);Ruminococcaceae(100);Anaerotruncus(100);"; | ||
| + string tax5WithOutSpaces = "Bacteria(100);Firmicutes(100);Clostridia(100);Clostridiales(100);Lachnospiraceae(100);Incertae_Sedis(97);"; | ||
| + | ||
| + phylo.addSeqToTree("seq1", tax1WithSpaces); | ||
| + phylo.addSeqToTree("seq2", tax2WithSpaces); | ||
| + phylo.addSeqToTree("seq3", tax3WithSpaces); | ||
| + phylo.addSeqToTree("seq4", tax4WithSpaces); | ||
| + phylo.addSeqToTree("seq5", tax5WithSpaces); | ||
| + phylo.addSeqToTree("seq6", tax1WithOutSpaces); | ||
| + phylo.addSeqToTree("seq7", tax2WithOutSpaces); | ||
| + phylo.addSeqToTree("seq8", tax3WithOutSpaces); | ||
| + phylo.addSeqToTree("seq9", tax4WithOutSpaces); | ||
| + phylo.addSeqToTree("seq10", tax5WithOutSpaces); | ||
| +} | ||
| +/**************************************************************************************************/ | ||
| +TestPhyloTree::~TestPhyloTree() {} | ||
| +/**************************************************************************************************/ | ||
| + | ||
| +TEST_CASE("Testing PhyloTree Class") { | ||
| + TestPhyloTree testPTree; | ||
| + | ||
| + string tax1WithSpaces = "Bacteria(100);Bacteroidetes 7(100);Bacteroidia(100);Bacteroidales(100);S24-7(100);"; | ||
| + string tax2WithSpaces = "Bacteria(100);Bacteroidetes 7(100);Bacteroidia(98);Bacteroidales(98);Bacteroidaceae(98);Bacteroides(98);"; | ||
| + string tax3WithSpaces = "Bacteria(100);Firmicutes(100);Clostridia B(100);Clostridiales(100);Lachnospiraceae(100);Blautia(92);"; | ||
| + string tax4WithSpaces = "Bacteria(100);Firmicutes(100);Clostridia B(100);Clostridiales(100);Ruminococcaceae(100);Anaerotruncus(100);"; | ||
| + string tax5WithSpaces = "Bacteria(100);Firmicutes(100);Clostridia B(100);Clostridiales(100);Lachnospiraceae(100);Incertae_Sedis(97);"; | ||
| + | ||
| + string tax1WithOutSpaces = "Bacteria(100);Bacteroidetes(100);Bacteroidia(100);Bacteroidales(100);S24-7(100);"; | ||
| + string tax2WithOutSpaces = "Bacteria(100);Bacteroidetes(100);Bacteroidia(98);Bacteroidales(98);Bacteroidaceae(98);Bacteroides(98);"; | ||
| + string tax3WithOutSpaces = "Bacteria(100);Firmicutes(100);Clostridia(100);Clostridiales(100);Lachnospiraceae(100);Blautia(92);"; | ||
| + string tax4WithOutSpaces = "Bacteria(100);Firmicutes(100);Clostridia(100);Clostridiales(100);Ruminococcaceae(100);Anaerotruncus(100);"; | ||
| + string tax5WithOutSpaces = "Bacteria(100);Firmicutes(100);Clostridia(100);Clostridiales(100);Lachnospiraceae(100);Incertae_Sedis(97);"; | ||
| + | ||
| + SECTION("Add Sequences to Tree") { | ||
| + INFO("Using taxonomies with and without spaces") // Only appears on a FAIL | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq1", tax1WithSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq1", tax1WithSpaces) == 5); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq2", tax2WithSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq2", tax2WithSpaces) == 6); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq3", tax3WithSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq3", tax3WithSpaces) == 6); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq4", tax4WithSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq4", tax4WithSpaces) == 6); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq5", tax5WithSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq5", tax5WithSpaces) == 6); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq6", tax1WithOutSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq6", tax1WithOutSpaces) == 5); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq7", tax2WithOutSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq7", tax2WithOutSpaces) == 6); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq8", tax3WithOutSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq8", tax3WithOutSpaces) == 6); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq9", tax4WithOutSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq9", tax4WithOutSpaces) == 6); | ||
| + | ||
| + CAPTURE(testPTree.addSeqToTree("seq10", tax5WithOutSpaces)); | ||
| + CHECK(testPTree.addSeqToTree("seq10", tax5WithOutSpaces) == 6); | ||
| + } | ||
| + | ||
| + SECTION("Get Seqs") { | ||
| + INFO("Using taxonomies with and without spaces") // Only appears on a FAIL | ||
| + | ||
| + CAPTURE(testPTree.phylo.getSeqs("Bacteroidetes 7").size()); | ||
| + CHECK((testPTree.phylo.getSeqs("Bacteroidetes 7").size()) == 2); | ||
| + | ||
| + vector<string> Bacteroidetes_7 = testPTree.phylo.getSeqs("Bacteroidetes 7"); | ||
| + CHECK(Bacteroidetes_7[0] == "seq1"); | ||
| + CHECK(Bacteroidetes_7[1] == "seq2"); | ||
| + | ||
| + CAPTURE(testPTree.phylo.getSeqs("Clostridia").size()); | ||
| + CHECK((testPTree.phylo.getSeqs("Clostridia").size()) == 3); | ||
| + | ||
| + vector<string> Clostridia = testPTree.phylo.getSeqs("Clostridia"); | ||
| + CHECK(Clostridia[0] == "seq8"); | ||
| + CHECK(Clostridia[1] == "seq9"); | ||
| + CHECK(Clostridia[2] == "seq10"); | ||
| + } | ||
| + | ||
| + SECTION("Get Genus Totals") { | ||
| + INFO("Using taxonomies with and without spaces") // Only appears on a FAIL | ||
| + | ||
| + CAPTURE(testPTree.phylo.getGenusTotals().size()); | ||
| + CHECK(testPTree.phylo.getGenusTotals().size() == 10); | ||
| + } | ||
| + | ||
| + SECTION("Get Full Taxonomy") { | ||
| + INFO("Using taxonomies with and without spaces") // Only appears on a FAIL | ||
| + | ||
| + CAPTURE(testPTree.phylo.getFullTaxonomy("seq1")); | ||
| + CHECK(testPTree.phylo.getFullTaxonomy("seq1") == "Bacteria;Bacteroidetes 7;Bacteroidia;Bacteroidales;S24-7;"); | ||
| + | ||
| + CAPTURE(testPTree.phylo.getFullTaxonomy("seq10")); | ||
| + CHECK(testPTree.phylo.getFullTaxonomy("seq1") == "Bacteria;Firmicutes;Clostridia;Clostridiales;Lachnospiraceae;Incertae_Sedis;"); | ||
| + } | ||
| + | ||
| +} | ||
| +/**************************************************************************************************/ |
| @@ -0,0 +1,32 @@ | ||
| +// | ||
| +// testphylotree.hpp | ||
| +// Mothur | ||
| +// | ||
| +// Created by Sarah Westcott on 8/29/16. | ||
| +// Copyright © 2016 Schloss Lab. All rights reserved. | ||
| +// | ||
| + | ||
| +#ifndef testphylotree_hpp | ||
| +#define testphylotree_hpp | ||
| + | ||
| +#include "phylotree.h" | ||
| + | ||
| +class TestPhyloTree : public PhyloTree { | ||
| + | ||
| + | ||
| +public: | ||
| + | ||
| + TestPhyloTree(); | ||
| + ~TestPhyloTree(); | ||
| + | ||
| + MothurOut* m; | ||
| + | ||
| + PhyloTree phylo; | ||
| + | ||
| + //using PhyloTree:: | ||
| + //using PhyloTree:: | ||
| + | ||
| +}; | ||
| + | ||
| + | ||
| +#endif /* testphylotree_hpp */ |
| @@ -0,0 +1,101 @@ | ||
| +// | ||
| +// testoptimatrix.cpp | ||
| +// Mothur | ||
| +// | ||
| +// Created by Sarah Westcott on 6/6/16. | ||
| +// Copyright (c) 2016 Schloss Lab. All rights reserved. | ||
| +// | ||
| + | ||
| +#include "catch.hpp" | ||
| +#include "testoptimatrix.h" | ||
| +#include "distancecommand.h" | ||
| +#include "dataset.h" | ||
| + | ||
| +/**************************************************************************************************/ | ||
| +TestOptiMatrix::TestOptiMatrix() { //setup | ||
| + m = MothurOut::getInstance(); | ||
| + TestDataSet data; | ||
| + filenames = data.getSubsetFNGFiles(100); //Fasta, name, group returned | ||
| + | ||
| + string inputString = "fasta=" + filenames[0]; | ||
| + m->mothurOut("/******************************************/"); m->mothurOutEndLine(); | ||
| + m->mothurOut("Running command: dist.seqs(" + inputString + ")"); m->mothurOutEndLine(); | ||
| + m->mothurCalling = true; | ||
| + | ||
| + Command* distCommand = new DistanceCommand(inputString); | ||
| + distCommand->execute(); | ||
| + | ||
| + map<string, vector<string> > outputFilenames = distCommand->getOutputFiles(); | ||
| + | ||
| + delete distCommand; | ||
| + m->mothurCalling = false; | ||
| + | ||
| + columnFile = outputFilenames["column"][0]; | ||
| + m->mothurOut("/******************************************/"); m->mothurOutEndLine(); | ||
| + | ||
| + inputString = "fasta=" + filenames[0] + ", output=lt"; | ||
| + m->mothurOut("/******************************************/"); m->mothurOutEndLine(); | ||
| + m->mothurOut("Running command: dist.seqs(" + inputString + ")"); m->mothurOutEndLine(); | ||
| + m->mothurCalling = true; | ||
| + | ||
| + Command* dist2Command = new DistanceCommand(inputString); | ||
| + dist2Command->execute(); | ||
| + | ||
| + outputFilenames = dist2Command->getOutputFiles(); | ||
| + | ||
| + delete dist2Command; | ||
| + m->mothurCalling = false; | ||
| + | ||
| + phylipFile = outputFilenames["phylip"][0]; | ||
| + m->mothurOut("/******************************************/"); m->mothurOutEndLine(); | ||
| +} | ||
| +/**************************************************************************************************/ | ||
| +TestOptiMatrix::~TestOptiMatrix() { | ||
| + for (int i = 0; i < filenames.size(); i++) { m->mothurRemove(filenames[i]); } //teardown | ||
| + m->mothurRemove(columnFile); | ||
| + m->mothurRemove(phylipFile); | ||
| +} | ||
| +/**************************************************************************************************/ | ||
| +TEST_CASE("Testing OptiMatrix Class") { | ||
| + TestOptiMatrix testOMatrix; | ||
| + OptiMatrix matrix(testOMatrix.columnFile, testOMatrix.filenames[1], "name", 0.03, false); | ||
| + OptiMatrix pmatrix(testOMatrix.phylipFile, "", "", 0.03, false); | ||
| + | ||
| + SECTION("Testing Column Read") { | ||
| + INFO("Using First 100 sequences of final.fasta and final.names") // Only appears on a FAIL | ||
| + | ||
| + CAPTURE(matrix.print(cout)); // Displays this variable on a FAIL | ||
| + | ||
| + CHECK(matrix.print(cout) == 112); //numdists in matrix | ||
| + } | ||
| + | ||
| + SECTION("Testing Phylip Read") { | ||
| + INFO("Using First 100 sequences of final.fasta and final.names") // Only appears on a FAIL | ||
| + | ||
| + CAPTURE(pmatrix.print(cout)); // Displays this variable on a FAIL | ||
| + | ||
| + CHECK(pmatrix.print(cout) == 112); //numdists in matrix | ||
| + } | ||
| + | ||
| + /* First few rows of matrix | ||
| + 12 23 44 | ||
| + 10 23 32 36 | ||
| + 16 25 33 48 | ||
| + 38 | ||
| + 22 45 52 | ||
| + */ | ||
| + | ||
| + SECTION("Testing isClose") { | ||
| + INFO("Sequences 0 and 1") // Only appears on a FAIL | ||
| + | ||
| + CAPTURE(matrix.isClose(0, 12)); | ||
| + CHECK(matrix.isClose(0, 12) == true); | ||
| + CAPTURE(matrix.isClose(0, 44)); | ||
| + CHECK(matrix.isClose(0, 44) == true); | ||
| + CAPTURE(matrix.isClose(1, 23)); | ||
| + CHECK(matrix.isClose(1, 23) == true); | ||
| + CAPTURE(matrix.isClose(1, 36)); | ||
| + CHECK(matrix.isClose(1, 36) == true); | ||
| + } | ||
| +} | ||
| +/**************************************************************************************************/ |
Oops, something went wrong.
0 comments on commit
cfb593d