File: getgroupscommand.h

package info (click to toggle)
mothur 1.48.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,692 kB
  • sloc: cpp: 161,866; makefile: 122; sh: 31
file content (70 lines) | stat: -rwxr-xr-x 1,767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef GETGROUPSCOMMAND_H
#define GETGROUPSCOMMAND_H

/*
 *  getgroupscommand.h
 *  Mothur
 *
 *  Created by westcott on 11/10/10.
 *  Copyright 2010 Schloss Lab. All rights reserved.
 *
 */


#include "command.hpp"
#include "groupmap.h"

class GetGroupsCommand : public Command {
    
#ifdef UNIT_TEST
    friend class TestGetGroupsCommand;
#endif
	
public:
	
	GetGroupsCommand(string);	
	~GetGroupsCommand(){}
	
	vector<string> setParameters();
	string getCommandName()			{ return "get.groups";				}
	string getCommandCategory()		{ return "OTU-Based Approaches";	}
	
	string getHelpString();	
    string getOutputPattern(string);	
	string getCitation() { return "http://www.mothur.org/wiki/Get.groups"; }
	string getDescription()		{ return "gets sequences from a list, fasta, name, group, shared, design or taxonomy file from a given group or set of groups"; }

	
	int execute(); 
	void help() { m->mothurOut(getHelpString()); }	
	
	
private:
    unordered_set<string> names;
	map<string, string> uniqueToRedundant; //if a namefile is given and the first column name is not selected
										   //then the other files need to change the unique name in their file to match.
										   //only add the names that need to be changed to keep the map search quick
	string sets, accnosfile, countfile, fastafile, namefile, groupfile, listfile, designfile, taxfile,  groups, sharedfile, phylipfile, columnfile, flowfile;
	bool abort;
	vector<string> outputNames, Groups, Sets;
	GroupMap* groupMap;
	
	void readFasta();
    void readFlow();
	void readName();
	void readGroup();
	void readList();
	void readTax();
	void fillNames();
	void readShared();
    void readDesign();
    void readPhylip();
    void readColumn();
    void fillGroupsFromDesign();
	
};

#endif