X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=filterseqscommand.h;h=c670f37919e7da8ce3e3f3ee5d294cd4d23acd94;hb=45b880733289694b2a23c9dc8a774aa626458f81;hp=4b7d0111f11f5712dc9075bf313ec695222c7d7c;hpb=a8c74e7c7283b5bd04d4bd084a28f0c32992416d;p=mothur.git diff --git a/filterseqscommand.h b/filterseqscommand.h index 4b7d011..c670f37 100644 --- a/filterseqscommand.h +++ b/filterseqscommand.h @@ -1,46 +1,65 @@ -#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 "globaldata.hpp" -#include "readfasta.h" -#include "readnexus.h" -#include "readclustal.h" -#include "readseqsphylip.h" - - -class FilterSeqsCommand : public Command { - -public: - FilterSeqsCommand(); - ~FilterSeqsCommand() {}; - int execute(); - -private: - void doHard(); - void doTrump(Sequence); - void doVertical(); - void doSoft(); - void getFreqs(Sequence); - string filter; - int alignmentLength; - - char trump; - bool vertical; - float soft; - int numSeqs; - - GlobalData* globaldata; - vector a, t, g, c, gap; -}; - -#endif +#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(); + ~FilterSeqsCommand() {}; + vector getRequiredParameters(); + vector getValidParameters(); + vector getRequiredFiles(); + map > getOutputFiles() { return outputTypes; } + int execute(); + void help(); + +private: + struct linePair { + unsigned long int start; + unsigned long int end; + linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {} + }; + + vector lines; + vector processIDS; + + string vertical, filter, fasta, hard, outputDir, filterFileName; + vector fastafileNames; + int alignmentLength, processors; + vector bufferSizes; + vector outputNames; + map > outputTypes; + + char trump; + bool abort; + float soft; + int numSeqs; + + string createFilter(); + int filterSequences(); + int createProcessesCreateFilter(Filters&, string); + int createProcessesRunFilter(string, string); + int driverRunFilter(string, string, string, linePair*); + int driverCreateFilter(Filters& F, string filename, linePair* line); + #ifdef USE_MPI + int driverMPIRun(int, int, MPI_File&, MPI_File&, vector&); + int MPICreateFilter(int, int, Filters&, MPI_File&, vector&); + #endif + +}; + +#endif