1 #ifndef GETOTUREPCOMMAND_H
2 #define GETOTUREPCOMMAND_H
7 * Created by Sarah Westcott on 4/6/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
12 /* The get.oturep command outputs a .fastarep file for each distance you specify, selecting one OTU representative for each bin. */
14 #include "command.hpp"
15 #include "globaldata.hpp"
16 #include "listvector.hpp"
17 #include "inputdata.h"
22 typedef list<PCell>::iterator MatData;
23 typedef map<int, float> SeqMap;
32 repStruct(string n, int b, int s, string g) : name(n), bin(b), size(s), group(g) {}
36 class GetOTURepCommand : public Command {
39 GetOTURepCommand(string);
45 GlobalData* globaldata;
51 string filename, fastafile, listfile, namesfile, groupfile, label, sorted, phylipfile, columnfile, namefile;
54 bool abort, allLines, groupError;
55 set<string> labels; //holds labels to be used
56 map<string, int> nameToIndex; //maps sequence name to index in sparsematrix
59 int process(ListVector*);
60 string findRep(int, string&, ListVector*, int&); // returns the name of the "representative" sequence of given bin,
61 // fills a string containing the groups in that bin if a groupfile is given,
62 // and returns the number of sequences in the given bin