forked from mothur/mothur
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bellerophon.h
67 lines (51 loc) · 1.79 KB
/
bellerophon.h
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
#ifndef BELLEROPHON_H
#define BELLEROPHON_H
/*
* bellerophon.h
* Mothur
*
* Created by Sarah Westcott on 7/9/09.
* Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
*
*/
#include "chimera.h"
#include "sparsematrix.hpp"
#include "sequence.hpp"
#include "dist.h"
typedef list<PCell>::iterator MatData;
typedef map<int, float> SeqMap; //maps sequence to all distance for that seqeunce
/***********************************************************/
class Bellerophon : public Chimera {
public:
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(); }
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<linePair> lines;
Dist* distCalculator;
vector<Sequence*> seqs;
vector< vector<Preference> > pref; //pref[0] = preference scores for all seqs in window 0.
string fastafile;
int iters, count, window, increment, numSeqs, processors; //iters = number of windows
bool correction;
int generatePreferences(vector<SeqMap>, vector<SeqMap>, int);
int createSparseMatrix(int, int, SparseMatrix*, vector<Sequence>);
vector<Preference> getBestPref();
int driverChimeras(vector<int>, linePair);
int createProcesses(vector<int>);
int writePrefs(string, linePair);
int readPrefs(string);
vector<string> getBestWindow(linePair line);
int fillPref(int, vector<string>&);
};
/***********************************************************/
#endif