8 * Created by Sarah Westcott on 7/9/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
15 #include "sparsematrix.hpp"
16 #include "sequence.hpp"
19 typedef list<PCell>::iterator MatData;
20 typedef map<int, float> SeqMap; //maps sequence to all distance for that seqeunce
22 /***********************************************************/
24 class Bellerophon : public Chimera {
27 Bellerophon(string, bool, bool, int, int, int, string); //fastafile, filter, correction, window, increment, processors, outputDir);
28 ~Bellerophon() { delete distCalculator; for (int i = 0; i < seqs.size(); i++) { delete seqs[i]; } seqs.clear(); }
31 int print(ostream&, ostream&, string);
34 int print(MPI_File&, MPI_File&, string);
39 unsigned long long start;
41 linePair(unsigned long long i, int j) : start(i), num(j) {}
44 vector<linePair> lines;
47 vector<Sequence*> seqs;
48 vector< vector<Preference> > pref; //pref[0] = preference scores for all seqs in window 0.
50 int iters, count, window, increment, numSeqs, processors; //iters = number of windows
53 int generatePreferences(vector<SeqMap>, vector<SeqMap>, int);
54 int createSparseMatrix(int, int, SparseMatrix*, vector<Sequence>);
55 vector<Preference> getBestPref();
56 int driverChimeras(vector<int>, linePair);
57 int createProcesses(vector<int>);
58 int writePrefs(string, linePair);
59 int readPrefs(string);
60 vector<string> getBestWindow(linePair line);
61 int fillPref(int, vector<string>&);
64 /***********************************************************/