372E12960F263D5A0095CF7E /* readdistcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12950F263D5A0095CF7E /* readdistcommand.cpp */; };
372E12ED0F264D320095CF7E /* commandfactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12EC0F264D320095CF7E /* commandfactory.cpp */; };
37AD4CE40F28AEA300AA2D49 /* sharedlistvector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4CE30F28AEA300AA2D49 /* sharedlistvector.cpp */; };
+ 37AD4DBB0F28E2FE00AA2D49 /* tree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4DBA0F28E2FE00AA2D49 /* tree.cpp */; };
+ 37AD4DCA0F28F3DD00AA2D49 /* readtree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */; };
37B28F680F27590100808A62 /* deconvolutecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37B28F670F27590100808A62 /* deconvolutecommand.cpp */; };
37D928550F21331F001D4494 /* ace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927B80F21331F001D4494 /* ace.cpp */; };
37D928560F21331F001D4494 /* averagelinkage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927BA0F21331F001D4494 /* averagelinkage.cpp */; };
372E12EC0F264D320095CF7E /* commandfactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandfactory.cpp; sourceTree = "<group>"; };
37AD4CE20F28AEA300AA2D49 /* sharedlistvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedlistvector.h; sourceTree = "<group>"; };
37AD4CE30F28AEA300AA2D49 /* sharedlistvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedlistvector.cpp; sourceTree = "<group>"; };
+ 37AD4DB90F28E2FE00AA2D49 /* tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tree.h; sourceTree = "<group>"; };
+ 37AD4DBA0F28E2FE00AA2D49 /* tree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tree.cpp; sourceTree = "<group>"; };
+ 37AD4DC80F28F3DD00AA2D49 /* readtree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readtree.h; sourceTree = "<group>"; };
+ 37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readtree.cpp; sourceTree = "<group>"; };
37B28F660F27590100808A62 /* deconvolutecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deconvolutecommand.h; sourceTree = "<group>"; };
37B28F670F27590100808A62 /* deconvolutecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deconvolutecommand.cpp; sourceTree = "<group>"; };
37D927B80F21331F001D4494 /* ace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ace.cpp; sourceTree = "<group>"; };
37D928090F21331F001D4494 /* rarefactioncurvedata.h */,
37D928130F21331F001D4494 /* readmatrix.hpp */,
37D928120F21331F001D4494 /* readmatrix.cpp */,
+ 37AD4DC80F28F3DD00AA2D49 /* readtree.h */,
+ 37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */,
37D9281D0F21331F001D4494 /* sequence.hpp */,
37D9281C0F21331F001D4494 /* sequence.cpp */,
37D928210F21331F001D4494 /* shared.h */,
37D928300F21331F001D4494 /* sharedrabundvector.cpp */,
37D928330F21331F001D4494 /* sharedsabundvector.h */,
37D928320F21331F001D4494 /* sharedsabundvector.cpp */,
+ 37AD4DB90F28E2FE00AA2D49 /* tree.h */,
+ 37AD4DBA0F28E2FE00AA2D49 /* tree.cpp */,
);
name = containers;
sourceTree = "<group>";
372E12ED0F264D320095CF7E /* commandfactory.cpp in Sources */,
37B28F680F27590100808A62 /* deconvolutecommand.cpp in Sources */,
37AD4CE40F28AEA300AA2D49 /* sharedlistvector.cpp in Sources */,
+ 37AD4DBB0F28E2FE00AA2D49 /* tree.cpp in Sources */,
+ 37AD4DCA0F28F3DD00AA2D49 /* readtree.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
}else if (globaldata->sharedEstimators[i] == "sharedJabund") {
cDisplays.push_back(new CollectDisplay(new SharedJAbund(), new SharedOneColumnFile(fileNameRoot+"shared.jabund", groupmap->namesOfGroups)));
}else if (globaldata->sharedEstimators[i] == "sharedSorensonAbund") {
- cDisplays.push_back(new CollectDisplay(new SharedSorAbund(), new SharedOneColumnFile(fileNameRoot+"shared.sorensonabund", groupmap->namesOfGroups)));
+ cDisplays.push_back(new CollectDisplay(new SharedSorAbund(), new SharedOneColumnFile(fileNameRoot+"shared.sorabund", groupmap->namesOfGroups)));
}else if (globaldata->sharedEstimators[i] == "sharedJclass") {
cDisplays.push_back(new CollectDisplay(new SharedJclass(), new SharedOneColumnFile(fileNameRoot+"shared.jclass", groupmap->namesOfGroups)));
}else if (globaldata->sharedEstimators[i] == "sharedSorClass") {
read = new ReadPhilFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
- //list = input->getListVector();
- list = globaldata->glist;
+ list = globaldata->gSharedList;
//read in group map info.
groupMap = new GroupMap(globaldata->getGroupFile());
int i;
//create new list vectors to fill with parsed data
for (i=0; i<groupMap->getNumGroups(); i++) {
- groupOfLists[groupMap->namesOfGroups[i]] = new ListVector();
+ groupOfLists[groupMap->namesOfGroups[i]] = new SharedListVector();
}
//parses and sets each groups listvector
groupOfLists[groupMap->namesOfGroups[i]]->print(*(filehandles[groupMap->namesOfGroups[i]]));
groupOfLists[groupMap->namesOfGroups[i]]->clear();
}
- list = input->getListVector();
+ list = input->getSharedListVector();
}
//set groupmap for .shared commands
#include <map>
#include "command.hpp"
#include "rabundvector.hpp"
-#include "listvector.hpp"
+#include "sharedlistvector.h"
#include "inputdata.h"
#include "groupmap.h"
#include "readmatrix.hpp"
InputData* input;
ReadMatrix* read;
map<string, ofstream*> filehandles;
- map<string, ListVector*> groupOfLists;
- ListVector* list;
+ map<string, SharedListVector*> groupOfLists;
+ SharedListVector* list;
map<string, string> listGroups; //maps group name to sequences from that group in a specific OTU
map<string, string>::iterator it;
- map<string, ListVector*>::iterator it2;
+ map<string, SharedListVector*>::iterator it2;
map<string, ofstream*>::iterator it3;
void parse(int);
string fileroot;
--- /dev/null
+/*
+ * readtree.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/22/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "readtree.h"
+
--- /dev/null
+#ifndef READTREE_H
+#define READTREE_H
+/*
+ * readtree.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/22/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+using namespace std;
+
+#include <string>
+#include <iostream>
+
+
+class ReadTree {
+ public:
+ ReadTree();
+ ~ReadTree();
+
+
+ private:
+
+
+};
+
+
+#endif
\ No newline at end of file
}
/**************************************************************************************************/
-void Shared::getSharedVectors(int index, ListVector* list) {
+void Shared::getSharedVectors(int index, SharedListVector* list) {
string label, group;
int i,j;
label = list->getLabel();
/***********************************************************************/
-void Shared::parse(int index, ListVector* list) {
+void Shared::parse(int index, SharedListVector* list) {
string prefix, suffix, groupsName;
suffix = list->get(index);
#include <sstream>
#include <map>
#include "sharedrabundvector.h"
-#include "listvector.hpp"
+#include "sharedlistvector.h"
#include "globaldata.hpp"
class Shared {
public:
Shared();
~Shared();
- void getSharedVectors(int, ListVector*);
+ void getSharedVectors(int, SharedListVector*);
map<string, SharedRAbundVector*> sharedGroups; //string is groupname, SharedVector* is out info for that group
private:
GlobalData* globaldata;
- void parse(int, ListVector*);
+ void parse(int, SharedListVector*);
vector< map<string, SharedRAbundVector*> > sharedRAbund; //contains all the info needed to create the .shared file not sure if we will need
};
read = new ReadPhilFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
- list = globaldata->glist;
+ SharedList = globaldata->gSharedList;
shared = new Shared();
int i = 0;
- while(list != NULL){
- shared->getSharedVectors(i, list); //fills sharedGroups with new info and updates sharedVector
- list = input->getListVector(); //get new list vector to process
+ while(SharedList != NULL){
+ shared->getSharedVectors(i, SharedList); //fills sharedGroups with new info and updates sharedVector
+ SharedList = input->getSharedListVector(); //get new list vector to process
printSharedData(); //prints info to the .shared file
i++;
}
#include <fstream>
#include <map>
#include "command.hpp"
-#include "listvector.hpp"
+#include "sharedlistvector.h"
#include "inputdata.h"
#include "shared.h"
#include "readmatrix.hpp"
void printSharedData();
GlobalData* globaldata;
ReadMatrix* read;
- ListVector* list;
+ SharedListVector* SharedList;
InputData* input;
Shared* shared;
map<string, SharedRAbundVector*>::iterator it;
#include "sharedlistvector.h"
#include "sharedordervector.h"
+/***********************************************************************/
+
+SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){};
/***********************************************************************/
class SharedListVector : public DataVector {
public:
+ SharedListVector();
SharedListVector(int);
SharedListVector(ifstream&);
SharedListVector(const SharedListVector& lv) : DataVector(lv.label), data(lv.data), maxRank(lv.maxRank), numBins(lv.numBins), numSeqs(lv.numSeqs){};
--- /dev/null
+/*
+ * tree.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/22/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "tree.h"
+
--- /dev/null
+#ifndef TREE_H
+#define TREE_H
+
+/*
+ * tree.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/22/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+using namespace std;
+
+#include <string>
+#include <iostream>
+#include <vector>
+
+struct Node {
+ string name;
+ string group;
+ float branchLength;
+ Node* parent;
+ Node* lchild;
+ Node* rchild;
+};
+
+
+
+class Tree {
+ public:
+ Tree();
+ ~Tree();
+
+ Node* getParent(Node);
+ Node* getLChild(Node);
+ Node* getRChild(Node);
+
+ void setParent(Node);
+ void setLChild(Node);
+ void setRChild(Node);
+
+
+ Tree generateRandomTree();
+
+ vector<Node> leaves; //gives you easy access to the leaves of the tree to generate the parsimony score
+
+ private:
+};
+
+
+
+
+#endif
\ No newline at end of file