]> git.donarmstrong.com Git - mothur.git/blob - splitabundcommand.h
changes while testing
[mothur.git] / splitabundcommand.h
1 #ifndef SPLITABUNDCOMMAND_H
2 #define SPLITABUNDCOMMAND_H
3
4 /*
5  *  splitabundcommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 5/17/10.
9  *  Copyright 2010 Schloss Lab. All rights reserved.
10  *
11  */
12
13
14 /* split.abund - given a list or name file and a number (cutoff), make two files - *rare* and *abund* 
15 - where rare has data for otus that have fewer sequences than the cutoff and abund has data for otus 
16 that have as many or more sequences as the cutoff. 
17 also allow an option where a user can give a group file with the list or names file and split the group file into rare and abund. */
18
19
20 #include "command.hpp"
21 #include "groupmap.h"
22 #include "inputdata.h"
23 #include "listvector.hpp"
24 #include "sequence.hpp"
25 #include "counttable.h"
26
27 /***************************************************************************************/
28
29 class SplitAbundCommand : public Command {
30         
31 public:
32         SplitAbundCommand(string);      
33         SplitAbundCommand();
34         ~SplitAbundCommand();
35         
36         vector<string> setParameters();
37         string getCommandName()                 { return "split.abund";                         }
38         string getCommandCategory()             { return "OTU-Based Approaches";        }
39         
40         string getHelpString(); 
41     string getOutputPattern(string);    
42         string getCitation() { return "http://www.mothur.org/wiki/Split.abund"; }
43         string getDescription()         { return "split a list, name, group or fasta file based on abundance"; }
44         
45         int execute(); 
46         void help() { m->mothurOut(getHelpString()); }  
47         
48 private:
49         int splitList(ListVector*);
50         int splitNames(); //namefile
51         int writeNames(); 
52         int writeList(ListVector*, string, int); 
53         int writeAccnos(string); 
54         int parseGroup(string); 
55         int parseFasta(string); 
56     int parseCount(string);
57     int splitCount();
58         int readNamesFile(); //namefile
59         int createNameMap(ListVector*);
60         
61         vector<string> outputNames;
62     GroupMap groupMap;
63     CountTable ct;
64         
65         string outputDir, listfile, namefile, groupfile, countfile, label, groups, fastafile, inputFile;
66         set<string> labels, rareNames, abundNames;
67         vector<string> Groups;
68         bool abort, allLines, accnos;
69         int cutoff;
70         map<string, string> nameMap;
71         
72         
73
74 };
75
76 /***************************************************************************************/
77
78 #endif
79
80