375874060F7D64EF0040F377 /* sharedkulczynskicody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375874020F7D64EF0040F377 /* sharedkulczynskicody.cpp */; };
3758740C0F7D64FC0040F377 /* sharedmorisitahorn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375874080F7D64FC0040F377 /* sharedmorisitahorn.cpp */; };
3758740D0F7D64FC0040F377 /* sharedochiai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3758740B0F7D64FC0040F377 /* sharedochiai.cpp */; };
+ 375AA1390F9E433D008EF9B8 /* readcolumn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375AA1330F9E433D008EF9B8 /* readcolumn.cpp */; };
+ 375AA13A0F9E433D008EF9B8 /* readotu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375AA1350F9E433D008EF9B8 /* readotu.cpp */; };
+ 375AA13B0F9E433D008EF9B8 /* readphylip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 375AA1370F9E433D008EF9B8 /* readphylip.cpp */; };
379293C30F2DE73400B9034A /* treemap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379293C20F2DE73400B9034A /* treemap.cpp */; };
379294700F2E191800B9034A /* parsimonycommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3792946F0F2E191800B9034A /* parsimonycommand.cpp */; };
3792948A0F2E258500B9034A /* parsimony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379294890F2E258500B9034A /* parsimony.cpp */; };
37D9287A0F21331F001D4494 /* rarefact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928050F21331F001D4494 /* rarefact.cpp */; };
37D9287B0F21331F001D4494 /* rarefactcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928070F21331F001D4494 /* rarefactcommand.cpp */; };
37D9287C0F21331F001D4494 /* rarefactsharedcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9280A0F21331F001D4494 /* rarefactsharedcommand.cpp */; };
- 37D928800F21331F001D4494 /* readmatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928120F21331F001D4494 /* readmatrix.cpp */; };
37D928840F21331F001D4494 /* sabundvector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9281A0F21331F001D4494 /* sabundvector.cpp */; };
37D928850F21331F001D4494 /* sequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9281C0F21331F001D4494 /* sequence.cpp */; };
37D928860F21331F001D4494 /* shannon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9281E0F21331F001D4494 /* shannon.cpp */; };
375874090F7D64FC0040F377 /* sharedochiai.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedochiai.h; sourceTree = "<group>"; };
3758740A0F7D64FC0040F377 /* sharednseqs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharednseqs.h; sourceTree = "<group>"; };
3758740B0F7D64FC0040F377 /* sharedochiai.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedochiai.cpp; sourceTree = "<group>"; };
+ 375AA1330F9E433D008EF9B8 /* readcolumn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readcolumn.cpp; sourceTree = "<group>"; };
+ 375AA1340F9E433D008EF9B8 /* readcolumn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readcolumn.h; sourceTree = "<group>"; };
+ 375AA1350F9E433D008EF9B8 /* readotu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotu.cpp; sourceTree = "<group>"; };
+ 375AA1360F9E433D008EF9B8 /* readotu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotu.h; sourceTree = "<group>"; };
+ 375AA1370F9E433D008EF9B8 /* readphylip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readphylip.cpp; sourceTree = "<group>"; };
+ 375AA1380F9E433D008EF9B8 /* readphylip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readphylip.h; sourceTree = "<group>"; };
379293C10F2DE73400B9034A /* treemap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treemap.h; sourceTree = "<group>"; };
379293C20F2DE73400B9034A /* treemap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = treemap.cpp; sourceTree = "<group>"; };
3792946E0F2E191800B9034A /* parsimonycommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parsimonycommand.h; sourceTree = "<group>"; };
37D928090F21331F001D4494 /* rarefactioncurvedata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactioncurvedata.h; sourceTree = "<group>"; };
37D9280A0F21331F001D4494 /* rarefactsharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefactsharedcommand.cpp; sourceTree = "<group>"; };
37D9280B0F21331F001D4494 /* rarefactsharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactsharedcommand.h; sourceTree = "<group>"; };
- 37D928120F21331F001D4494 /* readmatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readmatrix.cpp; sourceTree = "<group>"; };
37D928130F21331F001D4494 /* readmatrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = readmatrix.hpp; sourceTree = "<group>"; };
37D9281A0F21331F001D4494 /* sabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sabundvector.cpp; sourceTree = "<group>"; };
37D9281B0F21331F001D4494 /* sabundvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sabundvector.hpp; sourceTree = "<group>"; };
37D928060F21331F001D4494 /* rarefact.h */,
37D928050F21331F001D4494 /* rarefact.cpp */,
37D928090F21331F001D4494 /* rarefactioncurvedata.h */,
+ 375AA1340F9E433D008EF9B8 /* readcolumn.h */,
+ 375AA1330F9E433D008EF9B8 /* readcolumn.cpp */,
37D928130F21331F001D4494 /* readmatrix.hpp */,
- 37D928120F21331F001D4494 /* readmatrix.cpp */,
+ 375AA1360F9E433D008EF9B8 /* readotu.h */,
+ 375AA1350F9E433D008EF9B8 /* readotu.cpp */,
+ 375AA1380F9E433D008EF9B8 /* readphylip.h */,
+ 375AA1370F9E433D008EF9B8 /* readphylip.cpp */,
37AD4DC80F28F3DD00AA2D49 /* readtree.h */,
37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */,
37D9281D0F21331F001D4494 /* sequence.hpp */,
37D9287A0F21331F001D4494 /* rarefact.cpp in Sources */,
37D9287B0F21331F001D4494 /* rarefactcommand.cpp in Sources */,
37D9287C0F21331F001D4494 /* rarefactsharedcommand.cpp in Sources */,
- 37D928800F21331F001D4494 /* readmatrix.cpp in Sources */,
37D928840F21331F001D4494 /* sabundvector.cpp in Sources */,
37D928850F21331F001D4494 /* sequence.cpp in Sources */,
37D928860F21331F001D4494 /* shannon.cpp in Sources */,
211C38320F961DD400FEE541 /* sharedutilities.cpp in Sources */,
211C38380F961E1F00FEE541 /* treegroupscommand.cpp in Sources */,
21DDC01B0F97A8FE0060691C /* bootstrapsharedcommand.cpp in Sources */,
+ 375AA1390F9E433D008EF9B8 /* readcolumn.cpp in Sources */,
+ 375AA13A0F9E433D008EF9B8 /* readotu.cpp in Sources */,
+ 375AA13B0F9E433D008EF9B8 /* readphylip.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
}
//read list file
- read = new ReadPhilFile(globaldata->getListFile());
+ read = new ReadOTUFile(globaldata->getListFile());
read->read(&*globaldata);
input = globaldata->ginput;
#include "command.hpp"
#include "inputdata.h"
#include "listvector.hpp"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "fastamap.h"
private:
GlobalData* globaldata;
ListVector* list;
- ReadMatrix* read;
+ ReadOTUFile* read;
InputData* input;
FastaMap* fasta;
string filename, fastafile, namesfile;
if (treeCalculators.size() == 0) { return 0; }
if (format == "sharedfile") {
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = input->getSharedOrderVector();
}else {
//you are using a list and a groupfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
#include "sharedlistvector.h"
#include "inputdata.h"
#include "groupmap.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "validcalculator.h"
#include "tree.h"
#include "treemap.h"
GlobalData* globaldata;
SharedUtil* util;
- ReadMatrix* read;
+ ReadOTUFile* read;
TreeMap* tmap;
Tree* t;
vector<Calculator*> treeCalculators;
//if the users entered no valid calculators don't execute command
if (cDisplays.size() == 0) { return 0; }
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
order = globaldata->gorder;
#include "groupmap.h"
#include "collect.h"
#include "display.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "validcalculator.h"
/*The collect() command:
private:
GlobalData* globaldata;
- ReadMatrix* read;
+ ReadOTUFile* read;
OrderVector* order;
InputData* input;
Collect* cCurve;
if (cDisplays.size() == 0) { return 0; }
if (format == "sharedfile") {
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = input->getSharedOrderVector();
}else {
//you are using a list and a groupfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
#include "groupmap.h"
#include "collect.h"
#include "display.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "validcalculator.h"
#include "sharedutilities.h"
SharedUtil* util;
GroupMap* groupmap;
SharedListVector* SharedList;
- ReadMatrix* read;
+ ReadOTUFile* read;
SharedOrderVector* order;
InputData* input;
ValidCalculators* validCalculator;
}
//read list file
- read = new ReadPhilFile(globaldata->getListFile());
+ read = new ReadOTUFile(globaldata->getListFile());
read->read(&*globaldata);
input = globaldata->ginput;
#include "sparsematrix.hpp"
#include "listvector.hpp"
#include "inputdata.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "fastamap.h"
SparseMatrix* matrix;
ListVector* list;
ListVector* listOfNames;
- ReadMatrix* read;
+ ReadOTUFile* read;
InputData* input;
FastaMap* fasta;
string filename, fastafile, namesfile;
if (format == "sharedfile") {
//you have groups
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = input->getSharedOrderVector();
}else if (format == "shared") {
//you are using a list and a groupfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = SharedList->getSharedOrderVector();
}else if (format == "list") {
//you are using just a list file and have only one group
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
ordersingle = globaldata->gorder;
#include "command.hpp"
#include "inputdata.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "sharedlistvector.h"
#include "heatmap.h"
#include "sharedutilities.h"
private:
GlobalData* globaldata;
- ReadMatrix* read;
+ ReadOTUFile* read;
SharedUtil* util;
InputData* input;
SharedListVector* SharedList;
int count = 1;
//read in listfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
list = globaldata->gSharedList;
#include "sharedlistvector.h"
#include "inputdata.h"
#include "groupmap.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
/* The parselist() command:
GlobalData* globaldata;
GroupMap* groupMap;
InputData* input;
- ReadMatrix* read;
+ ReadOTUFile* read;
map<string, ofstream*> filehandles;
map<string, SharedListVector*> groupOfLists;
SharedListVector* list;
//if the users entered no valid calculators don't execute command
if (rDisplays.size() == 0) { return 0; }
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
order = globaldata->gorder;
#include "inputdata.h"
#include "rarefact.h"
#include "display.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "validcalculator.h"
private:
GlobalData* globaldata;
vector<Display*> rDisplays;
- ReadMatrix* read;
+ ReadOTUFile* read;
OrderVector* order;
InputData* input;
ValidCalculators* validCalculator;
if (rDisplays.size() == 0) { return 0; }
if (format == "sharedfile") {
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = input->getSharedOrderVector();
}else {
//you are using a list and a groupfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
#include "inputdata.h"
#include "rarefact.h"
#include "display.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "validcalculator.h"
#include "sharedutilities.h"
GlobalData* globaldata;
SharedUtil* util;
SharedListVector* SharedList;
- ReadMatrix* read;
+ ReadOTUFile* read;
SharedOrderVector* order;
InputData* input;
ValidCalculators* validCalculator;
--- /dev/null
+/*
+ * readcolumn.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 4/21/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "readcolumn.h"
+#include "progress.hpp"
+
+/***********************************************************************/
+
+ReadColumnMatrix::ReadColumnMatrix(string df) : distFile(df){
+
+ successOpen = openInputFile(distFile, fileHandle);
+
+}
+
+/***********************************************************************/
+
+void ReadColumnMatrix::read(NameAssignment* nameMap){
+ try {
+
+ string firstName, secondName;
+ float distance;
+ int nseqs = nameMap->size();
+
+ list = new ListVector(nameMap->getListVector());
+
+ Progress* reading = new Progress("Reading matrix: ", nseqs * nseqs);
+
+ int lt = 1;
+ int refRow = 0; //we'll keep track of one cell - Cell(refRow,refCol) - and see if it's transpose
+ int refCol = 0; //shows up later - Cell(refCol,refRow). If it does, then its a square matrix
+
+ //need to see if this is a square or a triangular matrix...
+ while(fileHandle && lt == 1){ //let's assume it's a triangular matrix...
+
+ fileHandle >> firstName >> secondName >> distance; // get the row and column names and distance
+
+ if(nameMap->count(firstName)==0){
+ cerr << "AError: Sequence '" << firstName << "' was not found in the names file, please correct\n";
+ }
+ if(nameMap->count(secondName)==0){
+ cerr << "AError: Sequence '" << secondName << "' was not found in the names file, please correct\n";
+ }
+
+ if (distance == -1) { distance = 1000000; }
+
+ if(distance < cutoff && nameMap->get(firstName) != nameMap->get(secondName)){
+ if(nameMap->get(firstName) > nameMap->get(secondName)){
+ PCell value(nameMap->get(firstName), nameMap->get(secondName), distance);
+
+ if(refRow == refCol){ // in other words, if we haven't loaded refRow and refCol...
+ refRow = nameMap->get(firstName);
+ refCol = nameMap->get(secondName);
+ D->addCell(value);
+ }
+ else if(refRow == nameMap->get(firstName) && refCol == nameMap->get(secondName)){
+ lt = 0;
+ }
+ else{
+ D->addCell(value);
+ }
+ }
+ else if(nameMap->get(firstName) < nameMap->get(secondName)){
+ PCell value(nameMap->get(secondName), nameMap->get(firstName), distance);
+
+ if(refRow == refCol){ // in other words, if we haven't loaded refRow and refCol...
+ refRow = nameMap->get(firstName);
+ refCol = nameMap->get(secondName);
+ D->addCell(value);
+ }
+ else if(refRow == nameMap->get(secondName) && refCol == nameMap->get(firstName)){
+ lt = 0;
+ }
+ else{
+ D->addCell(value);
+ }
+ }
+ reading->update(nameMap->get(firstName) * nseqs);
+ }
+ gobble(fileHandle);
+ }
+
+ if(lt == 0){ // oops, it was square
+ fileHandle.close(); //let's start over
+ D->clear(); //let's start over
+
+ openInputFile(distFile, fileHandle); //let's start over
+
+ while(fileHandle){
+ fileHandle >> firstName >> secondName >> distance;
+
+ if(nameMap->count(firstName)==0){
+ cerr << "BError: Sequence '" << firstName << "' was not found in the names file, please correct\n";
+ }
+ if(nameMap->count(secondName)==0){
+ cerr << "BError: Sequence '" << secondName << "' was not found in the names file, please correct\n";
+ }
+
+ if (distance == -1) { distance = 1000000; }
+
+ if(distance < cutoff && nameMap->get(firstName) > nameMap->get(secondName)){
+ PCell value(nameMap->get(firstName), nameMap->get(secondName), distance);
+ D->addCell(value);
+ reading->update(nameMap->get(firstName) * nseqs);
+ }
+
+ gobble(fileHandle);
+ }
+ }
+ // else if(lt == 0){
+ // while(fileHandle){
+ // fileHandle >> firstName >> secondName >> distance;
+ //
+ // if(nameMap->count(firstName)==0){
+ // cerr << "CError: Sequence '" << firstName << "' was not found in the names file, please correct\n";
+ // }
+ // if(nameMap->count(secondName)==0){
+ // cerr << "CError: Sequence '" << secondName << "' was not found in the names file, please correct\n";
+ // }
+ // if (distance == -1) { distance = 1000000; }
+
+ // if(distance < cutoff && (*nameMap)[firstName].second < (*nameMap)[secondName].second){
+ //// cout << (*nameMap)[secondName] << ' ' << (*nameMap)[firstName] << ' ' << distance << endl;
+ // D->addCell(Cell((*nameMap)[secondName].second, (*nameMap)[firstName].second, distance));
+ // reading->update((*nameMap)[secondName].second * nseqs);
+ // }
+ //
+ // gobble(fileHandle);
+ // }
+ // }
+ reading->finish();
+ fileHandle.close();
+
+ list->setLabel("0");
+
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the ReadColumnMatrix class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the ReadColumnMatrix class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+
+}
+
+/***********************************************************************/
+
+ReadColumnMatrix::~ReadColumnMatrix(){
+ delete D;
+ delete list;
+}
+
+
--- /dev/null
+#ifndef READCOLUMN_H
+#define READCOLUMN_H
+/*
+ * readcolumn.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 4/21/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "readmatrix.hpp"
+
+/******************************************************/
+
+class ReadColumnMatrix : public ReadMatrix {
+
+public:
+ ReadColumnMatrix(string);
+ ~ReadColumnMatrix();
+ void read(NameAssignment*);
+private:
+ ifstream fileHandle;
+ string distFile;
+};
+
+/******************************************************/
+
+#endif
\ No newline at end of file
*/
#include "readdistcommand.h"
+#include "readphylip.h"
+#include "readcolumn.h"
ReadDistCommand::ReadDistCommand(){
try {
+++ /dev/null
-/*
- * readmatrix.cpp
- *
- *
- * Created by Pat Schloss on 8/13/08.
- * Copyright 2008 Patrick D. Schloss. All rights reserved.
- *
- */
-
-using namespace std;
-
-#include "sparsematrix.hpp"
-#include "progress.hpp"
-#include "listvector.hpp"
-#include "rabundvector.hpp"
-#include "readmatrix.hpp"
-
-
-/***********************************************************************/
-
-ReadPhylipMatrix::ReadPhylipMatrix(string distFile){
-
- successOpen = openInputFile(distFile, fileHandle);
-
-}
-
-/***********************************************************************/
-
-void ReadPhylipMatrix::read(NameAssignment* nameMap){
- try {
-
- float distance;
- int square, nseqs;
- string name;
- vector<string> matrixNames;
-
- fileHandle >> nseqs >> name;
-
- matrixNames.push_back(name);
-
- if(nameMap == NULL){
- list = new ListVector(nseqs);
- list->set(0, name);
- }
- else{
- list = new ListVector(nameMap->getListVector());
- if(nameMap->count(name)==0){ cout << "Error: Sequence '" << name << "' was not found in the names file, please correct" << endl; }
- }
-
- char d;
- while((d=fileHandle.get()) != EOF){
-
- if(isalnum(d)){
- square = 1;
- fileHandle.putback(d);
- for(int i=0;i<nseqs;i++){
- fileHandle >> distance;
- }
- break;
- }
- if(d == '\n'){
- square = 0;
- break;
- }
- }
-
- Progress* reading;
-
- if(square == 0){
-
- reading = new Progress("Reading matrix: ", nseqs * (nseqs - 1) / 2);
-
- int index = 0;
-
- for(int i=1;i<nseqs;i++){
- fileHandle >> name;
- matrixNames.push_back(name);
-
- //there's A LOT of repeated code throughout this method...
- if(nameMap == NULL){
- list->set(i, name);
-
- for(int j=0;j<i;j++){
- fileHandle >> distance;
-
- if(distance < cutoff){
- PCell value(i, j, distance);
- D->addCell(value);
- }
- index++;
- reading->update(index);
- }
-
- }
- else{
- if(nameMap->count(name)==0){ cout << "Error: Sequence '" << name << "' was not found in the names file, please correct" << endl; }
-
- for(int j=0;j<i;j++){
- fileHandle >> distance;
-
- if(distance < cutoff){
- PCell value(nameMap->get(matrixNames[i]), nameMap->get(matrixNames[j]), distance);
- D->addCell(value);
- }
- index++;
- reading->update(index);
- }
- }
- }
- }
- else{
-
- reading = new Progress("Reading matrix: ", nseqs * nseqs);
-
- int index = nseqs;
-
- for(int i=1;i<nseqs;i++){
- fileHandle >> name;
- matrixNames.push_back(name);
-
- if(nameMap == NULL){
- list->set(i, name);
- for(int j=0;j<nseqs;j++){
- fileHandle >> distance;
-
- if(distance < cutoff && j < i){
- PCell value(i, j, distance);
- D->addCell(value);
- }
- index++;
- reading->update(index);
- }
-
- }
- else{
- if(nameMap->count(name)==0){ cout << "Error: Sequence '" << name << "' was not found in the names file, please correct" << endl; }
-
- for(int j=0;j<nseqs;j++){
- fileHandle >> distance;
-
- if(distance < cutoff && j < i){
- PCell value(nameMap->get(matrixNames[i]), nameMap->get(matrixNames[j]), distance);
- D->addCell(value);
- }
- index++;
- reading->update(index);
- }
- }
- }
- }
- reading->finish();
- delete reading;
-
- list->setLabel("0");
- fileHandle.close();
-
- if(nameMap != NULL){
- for(int i=0;i<matrixNames.size();i++){
- nameMap->erase(matrixNames[i]);
- }
- if(nameMap->size() > 0){
- //should probably tell them what is missing if we missed something
- cout << "missed something" << '\t' << nameMap->size() << endl;
- }
- }
-
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadPhylipMatrix class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadPhylipMatrix class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-
-/***********************************************************************/
-
-ReadPhylipMatrix::~ReadPhylipMatrix(){
- delete D;
- delete list;
-}
-
-/***********************************************************************/
-
-ReadColumnMatrix::ReadColumnMatrix(string df) : distFile(df){
-
- successOpen = openInputFile(distFile, fileHandle);
-
-}
-
-/***********************************************************************/
-
-void ReadColumnMatrix::read(NameAssignment* nameMap){
- try {
-
- string firstName, secondName;
- float distance;
- int nseqs = nameMap->size();
-
- list = new ListVector(nameMap->getListVector());
-
- Progress* reading = new Progress("Reading matrix: ", nseqs * nseqs);
-
- int lt = 1;
- int refRow = 0; //we'll keep track of one cell - Cell(refRow,refCol) - and see if it's transpose
- int refCol = 0; //shows up later - Cell(refCol,refRow). If it does, then its a square matrix
-
- //need to see if this is a square or a triangular matrix...
- while(fileHandle && lt == 1){ //let's assume it's a triangular matrix...
-
- fileHandle >> firstName >> secondName >> distance; // get the row and column names and distance
-
- if(nameMap->count(firstName)==0){
- cerr << "AError: Sequence '" << firstName << "' was not found in the names file, please correct\n";
- }
- if(nameMap->count(secondName)==0){
- cerr << "AError: Sequence '" << secondName << "' was not found in the names file, please correct\n";
- }
-
- if(distance < cutoff && nameMap->get(firstName) != nameMap->get(secondName)){
- if(nameMap->get(firstName) > nameMap->get(secondName)){
- PCell value(nameMap->get(firstName), nameMap->get(secondName), distance);
-
- if(refRow == refCol){ // in other words, if we haven't loaded refRow and refCol...
- refRow = nameMap->get(firstName);
- refCol = nameMap->get(secondName);
- D->addCell(value);
- }
- else if(refRow == nameMap->get(firstName) && refCol == nameMap->get(secondName)){
- lt = 0;
- }
- else{
- D->addCell(value);
- }
- }
- else if(nameMap->get(firstName) < nameMap->get(secondName)){
- PCell value(nameMap->get(secondName), nameMap->get(firstName), distance);
-
- if(refRow == refCol){ // in other words, if we haven't loaded refRow and refCol...
- refRow = nameMap->get(firstName);
- refCol = nameMap->get(secondName);
- D->addCell(value);
- }
- else if(refRow == nameMap->get(secondName) && refCol == nameMap->get(firstName)){
- lt = 0;
- }
- else{
- D->addCell(value);
- }
- }
- reading->update(nameMap->get(firstName) * nseqs);
- }
- gobble(fileHandle);
- }
-
- if(lt == 0){ // oops, it was square
- fileHandle.close(); //let's start over
- D->clear(); //let's start over
-
- openInputFile(distFile, fileHandle); //let's start over
-
- while(fileHandle){
- fileHandle >> firstName >> secondName >> distance;
-
- if(nameMap->count(firstName)==0){
- cerr << "BError: Sequence '" << firstName << "' was not found in the names file, please correct\n";
- }
- if(nameMap->count(secondName)==0){
- cerr << "BError: Sequence '" << secondName << "' was not found in the names file, please correct\n";
- }
-
- if(distance < cutoff && nameMap->get(firstName) > nameMap->get(secondName)){
- PCell value(nameMap->get(firstName), nameMap->get(secondName), distance);
- D->addCell(value);
- reading->update(nameMap->get(firstName) * nseqs);
- }
-
- gobble(fileHandle);
- }
- }
- // else if(lt == 0){
- // while(fileHandle){
- // fileHandle >> firstName >> secondName >> distance;
- //
- // if(nameMap->count(firstName)==0){
- // cerr << "CError: Sequence '" << firstName << "' was not found in the names file, please correct\n";
- // }
- // if(nameMap->count(secondName)==0){
- // cerr << "CError: Sequence '" << secondName << "' was not found in the names file, please correct\n";
- // }
- //
- // if(distance < cutoff && (*nameMap)[firstName].second < (*nameMap)[secondName].second){
- //// cout << (*nameMap)[secondName] << ' ' << (*nameMap)[firstName] << ' ' << distance << endl;
- // D->addCell(Cell((*nameMap)[secondName].second, (*nameMap)[firstName].second, distance));
- // reading->update((*nameMap)[secondName].second * nseqs);
- // }
- //
- // gobble(fileHandle);
- // }
- // }
- reading->finish();
- fileHandle.close();
-
- list->setLabel("0");
-
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadColumnMatrix class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadColumnMatrix class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-
-}
-
-/***********************************************************************/
-
-ReadColumnMatrix::~ReadColumnMatrix(){
- delete D;
- delete list;
-}
-
-
-/***********************************************************************/
-
-ReadPhilFile::ReadPhilFile(string pf): philFile(pf){
-
- successOpen = openInputFile(philFile, fileHandle);
-
-}
-
-/***********************************************************************/
-//This function reads the list, rabund or sabund files to be used by collect and rarefact command.
-void ReadPhilFile::read(GlobalData* globaldata){
- try {
- if (globaldata->getOrderFile() == "") {
- //you have two inputs because in the next if statement if you only have one then it moves ahead in the same file.
- //So when you run the collect or summary commands you miss a line.
- input = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund.
- inputList = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund.
- inputSabund = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund or shared.
- }else {//there is an orderfile
- input = new InputData(philFile, globaldata->getOrderFile(), globaldata->getFormat());
- }
-
- //memory leak prevention
- //if (globaldata->ginput != NULL) { delete globaldata->ginput; }
- globaldata->ginput = input; //saving to be used by collector and rarefact commands.
-
- if ((globaldata->getFormat() == "list") || (globaldata->getFormat() == "rabund") || (globaldata->getFormat() == "sabund")) {//you are reading a list, rabund or sabund file for collect, rarefaction or summary.
- order = input->getOrderVector();
- //memory leak prevention
- //if (globaldata->gorder != NULL) { delete globaldata->gorder; }
- globaldata->gorder = order; //saving to be used by collect and rarefact commands.
- sabund = inputSabund->getSAbundVector();
- globaldata->sabund = sabund; //saving to be used by summary command.
- list = inputList->getListVector();
- globaldata->gListVector = list;
- }else if (globaldata->getFormat() == "shared") {
- SharedList = input->getSharedListVector(); //you are reading for collect.shared, rarefaction.shared, summary.shared, parselist command, or shared commands.
- //memory leak prevention
- //if (globaldata->gSharedList != NULL) { delete globaldata->gSharedList; }
- globaldata->gSharedList = SharedList;
- }
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadPhilFile class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadPhilFile class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-
-/***********************************************************************/
-
-ReadPhilFile::~ReadPhilFile(){
-// delete input;
-// delete order;
-}
-
-/***********************************************************************/
-
*/
#include "mothur.h"
-#include "rabundvector.hpp"
#include "listvector.hpp"
-#include "sharedlistvector.h"
#include "sparsematrix.hpp"
#include "nameassignment.hpp"
-#include "inputdata.h"
#include "globaldata.hpp"
-#include "sabundvector.hpp"
-#include "groupmap.h"
class SparseMatrix;
SparseMatrix* D;
ListVector* list;
GlobalData* globaldata;
- OrderVector* order;
- InputData* input;
float cutoff;
};
-class ReadPhylipMatrix : public ReadMatrix {
-
-public:
- ReadPhylipMatrix(string);
- ~ReadPhylipMatrix();
- void read(NameAssignment*);
-private:
- ifstream fileHandle;
- string distFile;
-};
-
-
-
-class ReadColumnMatrix : public ReadMatrix {
-
-public:
- ReadColumnMatrix(string);
- ~ReadColumnMatrix();
- void read(NameAssignment*);
-private:
- ifstream fileHandle;
- string distFile;
-};
-
-
-class ReadPhilFile : public ReadMatrix {
-
-public:
- ReadPhilFile(string);
- ~ReadPhilFile();
- void read(GlobalData* globaldata);
-private:
- ifstream fileHandle;
- string philFile;
- InputData* input;
- InputData* inputSabund;
- InputData* inputList;
- ListVector* list;
- SharedListVector* SharedList;
- OrderVector* order;
- SAbundVector* sabund;
- GlobalData* globaldata;
- // InputData* getInput() { return input; }
-};
-
-
-
#endif
--- /dev/null
+/*
+ * readotu.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 4/21/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "readotu.h"
+
+/***********************************************************************/
+
+ReadOTUFile::ReadOTUFile(string pf): philFile(pf){
+
+ openInputFile(philFile, fileHandle);
+}
+
+/***********************************************************************/
+//This function reads the list, rabund or sabund files to be used by collect and rarefact command.
+void ReadOTUFile::read(GlobalData* globaldata){
+ try {
+ if (globaldata->getOrderFile() == "") {
+ //you have two inputs because in the next if statement if you only have one then it moves ahead in the same file.
+ //So when you run the collect or summary commands you miss a line.
+ input = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund.
+ inputList = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund.
+ inputSabund = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund or shared.
+ }else {//there is an orderfile
+ input = new InputData(philFile, globaldata->getOrderFile(), globaldata->getFormat());
+ }
+
+ //memory leak prevention
+ //if (globaldata->ginput != NULL) { delete globaldata->ginput; }
+ globaldata->ginput = input; //saving to be used by collector and rarefact commands.
+
+ if ((globaldata->getFormat() == "list") || (globaldata->getFormat() == "rabund") || (globaldata->getFormat() == "sabund")) {//you are reading a list, rabund or sabund file for collect, rarefaction or summary.
+ order = input->getOrderVector();
+ //memory leak prevention
+ //if (globaldata->gorder != NULL) { delete globaldata->gorder; }
+ globaldata->gorder = order; //saving to be used by collect and rarefact commands.
+ sabund = inputSabund->getSAbundVector();
+ globaldata->sabund = sabund; //saving to be used by summary command.
+ list = inputList->getListVector();
+ globaldata->gListVector = list;
+ }else if (globaldata->getFormat() == "shared") {
+ SharedList = input->getSharedListVector(); //you are reading for collect.shared, rarefaction.shared, summary.shared, parselist command, or shared commands.
+ //memory leak prevention
+ //if (globaldata->gSharedList != NULL) { delete globaldata->gSharedList; }
+ globaldata->gSharedList = SharedList;
+ }
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the ReadOTUFile class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the ReadOTUFile class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+
+/***********************************************************************/
+
+ReadOTUFile::~ReadOTUFile(){
+// delete input;
+// delete order;
+}
+
+/***********************************************************************/
+
--- /dev/null
+#ifndef READOTU_H
+#define READOTU_H
+/*
+ * readotu.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 4/21/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+
+
+#include "rabundvector.hpp"
+#include "listvector.hpp"
+#include "sharedlistvector.h"
+#include "inputdata.h"
+#include "globaldata.hpp"
+#include "sabundvector.hpp"
+#include "groupmap.h"
+
+
+class ReadOTUFile {
+
+public:
+ ReadOTUFile(string);
+ ~ReadOTUFile();
+ void read(GlobalData* globaldata);
+private:
+ ifstream fileHandle;
+ string philFile;
+ InputData* input;
+ InputData* inputSabund;
+ InputData* inputList;
+ ListVector* list;
+ SharedListVector* SharedList;
+ OrderVector* order;
+ SAbundVector* sabund;
+ GlobalData* globaldata;
+ // InputData* getInput() { return input; }
+};
+
+
+#endif
\ No newline at end of file
try {
globaldata = GlobalData::getInstance();
filename = globaldata->inputFileName;
- read = new ReadPhilFile(filename);
+ read = new ReadOTUFile(filename);
if (globaldata->getFormat() == "shared") {
//read in group map info.
groupMap = new GroupMap(globaldata->getGroupFile());
*/
#include "command.hpp"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "inputdata.h"
#include "groupmap.h"
#include "sharedcommand.h"
private:
GlobalData* globaldata;
- ReadMatrix* read;
+ ReadOTUFile* read;
InputData* input;
Command* shared;
Command* parselist;
--- /dev/null
+/*
+ * readphylip.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 4/21/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "readphylip.h"
+#include "progress.hpp"
+
+/***********************************************************************/
+
+ReadPhylipMatrix::ReadPhylipMatrix(string distFile){
+
+ successOpen = openInputFile(distFile, fileHandle);
+
+}
+
+/***********************************************************************/
+
+void ReadPhylipMatrix::read(NameAssignment* nameMap){
+ try {
+
+ float distance;
+ int square, nseqs;
+ string name;
+ vector<string> matrixNames;
+
+ fileHandle >> nseqs >> name;
+
+ matrixNames.push_back(name);
+
+ if(nameMap == NULL){
+ list = new ListVector(nseqs);
+ list->set(0, name);
+ }
+ else{
+ list = new ListVector(nameMap->getListVector());
+ if(nameMap->count(name)==0){ cout << "Error: Sequence '" << name << "' was not found in the names file, please correct" << endl; }
+ }
+
+ char d;
+ while((d=fileHandle.get()) != EOF){
+
+ if(isalnum(d)){
+ square = 1;
+ fileHandle.putback(d);
+ for(int i=0;i<nseqs;i++){
+ fileHandle >> distance;
+ }
+ break;
+ }
+ if(d == '\n'){
+ square = 0;
+ break;
+ }
+ }
+
+ Progress* reading;
+
+ if(square == 0){
+
+ reading = new Progress("Reading matrix: ", nseqs * (nseqs - 1) / 2);
+
+ int index = 0;
+
+ for(int i=1;i<nseqs;i++){
+ fileHandle >> name;
+ matrixNames.push_back(name);
+
+ //there's A LOT of repeated code throughout this method...
+ if(nameMap == NULL){
+ list->set(i, name);
+
+ for(int j=0;j<i;j++){
+ fileHandle >> distance;
+
+ if (distance == -1) { distance = 1000000; }
+
+ if(distance < cutoff){
+ PCell value(i, j, distance);
+ D->addCell(value);
+ }
+ index++;
+ reading->update(index);
+ }
+
+ }
+ else{
+ if(nameMap->count(name)==0){ cout << "Error: Sequence '" << name << "' was not found in the names file, please correct" << endl; }
+
+ for(int j=0;j<i;j++){
+ fileHandle >> distance;
+
+ if (distance == -1) { distance = 1000000; }
+
+ if(distance < cutoff){
+ PCell value(nameMap->get(matrixNames[i]), nameMap->get(matrixNames[j]), distance);
+ D->addCell(value);
+ }
+ index++;
+ reading->update(index);
+ }
+ }
+ }
+ }
+ else{
+
+ reading = new Progress("Reading matrix: ", nseqs * nseqs);
+
+ int index = nseqs;
+
+ for(int i=1;i<nseqs;i++){
+ fileHandle >> name;
+ matrixNames.push_back(name);
+
+ if(nameMap == NULL){
+ list->set(i, name);
+ for(int j=0;j<nseqs;j++){
+ fileHandle >> distance;
+
+ if (distance == -1) { distance = 1000000; }
+
+ if(distance < cutoff && j < i){
+ PCell value(i, j, distance);
+ D->addCell(value);
+ }
+ index++;
+ reading->update(index);
+ }
+
+ }
+ else{
+ if(nameMap->count(name)==0){ cout << "Error: Sequence '" << name << "' was not found in the names file, please correct" << endl; }
+
+ for(int j=0;j<nseqs;j++){
+ fileHandle >> distance;
+
+ if (distance == -1) { distance = 1000000; }
+
+ if(distance < cutoff && j < i){
+ PCell value(nameMap->get(matrixNames[i]), nameMap->get(matrixNames[j]), distance);
+ D->addCell(value);
+ }
+ index++;
+ reading->update(index);
+ }
+ }
+ }
+ }
+ reading->finish();
+ delete reading;
+
+ list->setLabel("0");
+ fileHandle.close();
+
+ if(nameMap != NULL){
+ for(int i=0;i<matrixNames.size();i++){
+ nameMap->erase(matrixNames[i]);
+ }
+ if(nameMap->size() > 0){
+ //should probably tell them what is missing if we missed something
+ cout << "missed something" << '\t' << nameMap->size() << endl;
+ }
+ }
+
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the ReadPhylipMatrix class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the ReadPhylipMatrix class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+
+/***********************************************************************/
+
+ReadPhylipMatrix::~ReadPhylipMatrix(){
+ delete D;
+ delete list;
+}
+
--- /dev/null
+#ifndef READPHYLIP_H
+#define READPHYLIP_H
+/*
+ * readphylip.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 4/21/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "readmatrix.hpp"
+
+/******************************************************/
+
+class ReadPhylipMatrix : public ReadMatrix {
+
+public:
+ ReadPhylipMatrix(string);
+ ~ReadPhylipMatrix();
+ void read(NameAssignment*);
+private:
+ ifstream fileHandle;
+ string distFile;
+};
+
+/******************************************************/
+
+#endif
\ No newline at end of file
globaldata = GlobalData::getInstance();
//read in listfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
SharedList = globaldata->gSharedList;
#include "sharedlistvector.h"
#include "inputdata.h"
#include "shared.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
/* The shared() command:
The shared command can only be executed after a successful read.shared command.
private:
void printSharedData();
GlobalData* globaldata;
- ReadMatrix* read;
+ ReadOTUFile* read;
SharedListVector* SharedList;
InputData* input;
Shared* shared;
openOutputFile(outputFileName, outputFileHandle);
outputFileHandle << "label";
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
for(int i=0;i<sumCalculators.size();i++){
#include "sabundvector.hpp"
#include "inputdata.h"
#include "calculator.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "validcalculator.h"
/* The summary() command:
private:
GlobalData* globaldata;
- ReadMatrix* read;
+ ReadOTUFile* read;
vector<Calculator*> sumCalculators;
InputData* input;
ValidCalculators* validCalculator;
if (sumCalculators.size() == 0) { return 0; }
if (format == "sharedfile") {
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = input->getSharedOrderVector();
}else {
//you are using a list and a groupfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
#include "sharedrabundvector.h"
#include "inputdata.h"
#include "calculator.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "sharedlistvector.h"
#include "validcalculator.h"
#include "sharedutilities.h"
private:
GlobalData* globaldata;
- ReadMatrix* read;
+ ReadOTUFile* read;
SharedUtil* util;
vector<Calculator*> sumCalculators;
InputData* input;
if (treeCalculators.size() == 0) { return 0; }
if (format == "sharedfile") {
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = input->getSharedOrderVector();
}else {
//you are using a list and a groupfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
#include "sharedlistvector.h"
#include "inputdata.h"
#include "groupmap.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "validcalculator.h"
#include "tree.h"
#include "treemap.h"
GlobalData* globaldata;
SharedUtil* util;
- ReadMatrix* read;
+ ReadOTUFile* read;
TreeMap* tmap;
Tree* t;
vector<Calculator*> treeCalculators;
if (format == "sharedfile") {
//you have groups
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = input->getSharedOrderVector();
}else if (format == "shared") {
//you are using a list and a groupfile
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
input = globaldata->ginput;
order = SharedList->getSharedOrderVector();
}else if (format == "list") {
//you are using just a list file and have only one group
- read = new ReadPhilFile(globaldata->inputFileName);
+ read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
ordersingle = globaldata->gorder;
#include "command.hpp"
#include "inputdata.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
#include "sharedlistvector.h"
#include "venn.h"
#include "validcalculator.h"
private:
GlobalData* globaldata;
- ReadMatrix* read;
+ ReadOTUFile* read;
SharedUtil* util;
InputData* input;
SharedListVector* SharedList;