1 #ifndef SHAREDCOMMAND_H
2 #define SHAREDCOMMAND_H
7 * Created by Sarah Westcott on 1/2/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
12 #include "command.hpp"
13 #include "sharedlistvector.h"
14 #include "inputdata.h"
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(). */
23 class SharedCommand : public Command {
26 SharedCommand(string);
30 vector<string> setParameters();
31 string getCommandName() { return "make.shared"; }
32 string getCommandCategory() { return "OTU-Based Approaches"; }
33 string getHelpString();
34 string getCitation() { return "http://www.mothur.org/wiki/Make.shared"; }
35 string getDescription() { return "make a shared file from a list and group file"; }
38 void help() { m->mothurOut(getHelpString()); }
41 void printSharedData(vector<SharedRAbundVector*>, ofstream&);
42 int createMisMatchFile(SharedListVector*, GroupMap*);
44 bool isValidGroup(string, vector<string>);
45 int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
46 int ListGroupSameSeqs(vector<string>&, SharedListVector*);
47 int createSharedFromListGroup(string);
48 int createSharedFromBiom(string);
49 string getTag(string&);
50 vector<string> readRows(string, ifstream&, int&);
51 int getDims(string, int&, int&);
52 vector<SharedRAbundVector*> readData(string, string, ifstream&, vector<string>&, int);
54 vector<string> Groups, outputNames, order;
56 string fileroot, outputDir, listfile, groupfile, biomfile, ordergroupfile;
57 bool firsttime, pickedGroups, abort, allLines;
58 map<string, ofstream*> filehandles;
59 map<string, ofstream*>::iterator it3;