X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=filterseqscommand.h;h=3bf36c040231c5f801281f9d553c60bed01101c8;hb=2bb9267aa4b4ecdf8488b06605cc9f3f36fa4332;hp=924c36627fec65abd777c5ae530bf154583e954f;hpb=ab750bdf95b4eb92186e4ce333edbd77396cda23;p=mothur.git diff --git a/filterseqscommand.h b/filterseqscommand.h index 924c366..3bf36c0 100644 --- a/filterseqscommand.h +++ b/filterseqscommand.h @@ -1,46 +1,68 @@ -#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 doSoft(Sequence); - void doVertical(Sequence); - string filter; - int alignmentLength; - - char trump; - bool vertical; - - GlobalData* globaldata; -// ReadSeqs* readSeqs; -// SequenceDB* db; - - -}; - -#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 setParameters(); + string getCommandName() { return "filter.seqs"; } + string getCommandCategory() { return "Sequence Processing"; } + string getHelpString(); + 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: + struct linePair { + unsigned long long start; + unsigned long long end; + linePair(unsigned long long i, unsigned long long 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; + + 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