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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
#ifndef FILTERSEQSCOMMAND_H
#define FILTERSEQSCOMMAND_H
/*
* filterseqscommand.h
* Mothur
*
* Created by Thomas Ryabin on 5/4/09.
* Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
*
*/
#include "command.hpp"
#include "filters.h"
class Sequence;
class FilterSeqsCommand : public Command {
public:
FilterSeqsCommand(string);
~FilterSeqsCommand() = default;;
vector<string> setParameters();
string getCommandName() { return "filter.seqs"; }
string getCommandCategory() { return "Sequence Processing"; }
string getHelpString();
string getOutputPattern(string);
string getCitation() { return "http://www.mothur.org/wiki/Filter.seqs"; }
string getDescription() { return "removes columns from alignments based on a criteria defined by the user"; }
int execute();
void help() { m->mothurOut(getHelpString()); }
private:
vector< vector<double> > savedPositions;
string vertical, filter, fasta, hard, filterFileName;
vector<string> fastafileNames;
int alignmentLength, processors;
vector<int> bufferSizes;
vector<string> outputNames;
char trump;
bool abort, recalced;
float soft;
long long numSeqs;
string createFilter();
int filterSequences();
long long createProcessesCreateFilter(Filters&, string);
long long createProcessesRunFilter(string, string, string, vector<linePair>);
};
/**************************************************************************************************/
//custom data structure for threads to use.
// This is passed by void pointer so it can be any data type
// that can be passed using a single void pointer (LPVOID).
struct filterData {
Filters F;
int alignmentLength, threadid;
unsigned long long start, end;
long long count;
MothurOut* m;
string filename, hard;
char trump;
float soft;
bool vertical;
Utils util;
filterData(){}
filterData(string fn, unsigned long long st, unsigned long long en, int aLength, char tr, bool vert, float so, string ha, int tid) {
filename = fn;
m = MothurOut::getInstance();
start = st;
end = en;
trump = tr;
alignmentLength = aLength;
vertical = vert;
soft = so;
hard = ha;
count = 0;
threadid = tid;
}
};
/**************************************************************************************************/
//custom data structure for threads to use.
// This is passed by void pointer so it can be any data type
// that can be passed using a single void pointer (LPVOID).
struct filterRunData {
int alignmentLength;
unsigned long long start, end;
long long count;
MothurOut* m;
string filename;
string filter;
OutputWriter* outputWriter;
Utils util;
filterRunData(){}
filterRunData(string f, string fn, OutputWriter* ofn, unsigned long long st, unsigned long long en, int aLength) {
filter = f;
outputWriter = ofn;
filename = fn;
m = MothurOut::getInstance();
start = st;
end = en;
alignmentLength = aLength;
count = 0;
}
};
/**************************************************************************************************/
#endif
|