X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=bellerophon.h;h=36555bf0d406addb3cc7685ee55fdac341dffe68;hp=b79089c97c87e13e8f93288707ef9b374595d34a;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=8c3489da5da7fb7274f34bfa091c54aa496e75bd diff --git a/bellerophon.h b/bellerophon.h index b79089c..36555bf 100644 --- a/bellerophon.h +++ b/bellerophon.h @@ -12,47 +12,53 @@ #include "chimera.h" -#include "filterseqscommand.h" +#include "sparsematrix.hpp" #include "sequence.hpp" #include "dist.h" -struct Preference { - string name; - vector leftParent; //keep the name of closest left associated with the two scores - vector rightParent; //keep the name of closest right associated with the two scores - vector score; //so you can keep last score and calc this score and keep whichever is bigger. - vector closestLeft; //keep the closest left associated with the two scores - vector closestRight; //keep the closest right associated with the two scores - int midpoint; - -}; - +typedef list::iterator MatData; +typedef map SeqMap; //maps sequence to all distance for that seqeunce /***********************************************************/ class Bellerophon : public Chimera { public: - Bellerophon(string); - ~Bellerophon() {}; + Bellerophon(string, bool, bool, int, int, int, string); //fastafile, filter, correction, window, increment, processors, outputDir); + ~Bellerophon() { delete distCalculator; for (int i = 0; i < seqs.size(); i++) { delete seqs[i]; } seqs.clear(); } - void getChimeras(); - void print(ostream&); - - void setCons(string){}; - void setQuantiles(string) {}; + int getChimeras(); + int print(ostream&, ostream&, string); + #ifdef USE_MPI + int print(MPI_File&, MPI_File&, string); + #endif private: + struct linePair { + unsigned long long start; + int num; + linePair(unsigned long long i, int j) : start(i), num(j) {} + }; + + vector lines; + Dist* distCalculator; - FilterSeqsCommand* filterSeqs; - vector seqs; - vector pref; + vector seqs; + vector< vector > pref; //pref[0] = preference scores for all seqs in window 0. string fastafile; - int iters; + int iters, count, window, increment, numSeqs, processors; //iters = number of windows + bool correction; - void generatePreferences(vector, vector, int); + int generatePreferences(vector, vector, int); int createSparseMatrix(int, int, SparseMatrix*, vector); + vector getBestPref(); + int driverChimeras(vector, linePair); + int createProcesses(vector); + int writePrefs(string, linePair); + int readPrefs(string); + vector getBestWindow(linePair line); + int fillPref(int, vector&); }; /***********************************************************/