]> git.donarmstrong.com Git - mothur.git/blob - sharedcommand.h
39ef9a7a1ebc17f830103cf33d84520aca975f97
[mothur.git] / sharedcommand.h
1 #ifndef SHAREDCOMMAND_H
2 #define SHAREDCOMMAND_H
3 /*
4  *  sharedcommand.h
5  *  Dotur
6  *
7  *  Created by Sarah Westcott on 1/2/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "command.hpp"
13 #include "sharedlistvector.h"
14 #include "inputdata.h"
15
16 /* The shared() command:
17         The shared command can only be executed after a successful read.shared command.  
18         The shared command parses a .list file and separates it into groups.  
19         It outputs a .shared file containing the OTU information for each group.  
20         There are no shared command parameters.  The shared command should be in the following format: shared(). */
21
22
23 class SharedCommand : public Command {
24         
25 public:
26         SharedCommand(string);  
27         SharedCommand();
28         ~SharedCommand();
29         
30         vector<string> setParameters();
31         string getCommandName()                 { return "make.shared";                         }
32         string getCommandCategory()             { return "OTU-Based Approaches";        }
33         
34         string getHelpString(); 
35     string getOutputPattern(string);    
36         string getCitation() { return "http://www.mothur.org/wiki/Make.shared"; }
37         string getDescription()         { return "make a shared file from a list and group file"; }
38
39         int execute(); 
40         void help() { m->mothurOut(getHelpString()); }  
41         
42 private:
43         void printSharedData(vector<SharedRAbundVector*>, ofstream&);
44         int readOrderFile();
45         bool isValidGroup(string, vector<string>);
46         int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
47         int ListGroupSameSeqs(vector<string>&, SharedListVector*);
48     int createSharedFromListGroup(string);
49     int createSharedFromBiom(string);
50     string getTag(string&);
51     vector<string> readRows(string, int&); 
52     int getDims(string, int&, int&);
53     vector<SharedRAbundVector*> readData(string, string, string, vector<string>&, int);
54         
55         vector<string> Groups, outputNames, order;
56         set<string> labels;
57         string fileroot, outputDir, listfile, groupfile, biomfile, ordergroupfile, countfile;
58         bool firsttime, pickedGroups, abort, allLines;
59         map<string, ofstream*> filehandles;
60         map<string, ofstream*>::iterator it3;
61
62 };
63
64 #endif