}
//***************************************************************************************************************
//num is query's spot in querySeqs
-void DeCalculator::trimSeqs(Sequence* query, Sequence subject, map<int, int>& trim) {
+void DeCalculator::trimSeqs(Sequence* query, Sequence* subject, map<int, int>& trim) {
try {
string q = query->getAligned();
- string s = subject.getAligned();
+ string s = subject->getAligned();
int front = 0;
for (int i = 0; i < q.length(); i++) {
}
//***************************************************************************************************************
-vector<float> DeCalculator::calcObserved(Sequence* query, Sequence subject, vector<int> window, int size) {
+vector<float> DeCalculator::calcObserved(Sequence* query, Sequence* subject, vector<int> window, int size) {
try {
vector<float> temp;
for (int m = 0; m < window.size(); m++) {
string seqFrag = query->getAligned().substr(window[m], size);
- string seqFragsub = subject.getAligned().substr(window[m], size);
+ string seqFragsub = subject->getAligned().substr(window[m], size);
//cout << "start point = " << window[m] << " end point = " << window[m]+size << endl;
int diff = 0;
for (int b = 0; b < seqFrag.length(); b++) {
}
}
//***************************************************************************************************************
-float DeCalculator::calcDist(Sequence* query, Sequence subject, int front, int back) {
+float DeCalculator::calcDist(Sequence* query, Sequence* subject, int front, int back) {
try {
//so you only look at the trimmed part of the sequence
//from first startpoint with length back-front
string seqFrag = query->getAligned().substr(front, cutoff);
- string seqFragsub = subject.getAligned().substr(front, cutoff);
+ string seqFragsub = subject->getAligned().substr(front, cutoff);
int diff = 0;
for (int b = 0; b < seqFrag.length(); b++) {
try {
vector<float> prob;
- string freqfile = getRootName(filename) + "prob";
+ string freqfile = getRootName(filename) + "freq";
ofstream outFreq;
openOutputFile(freqfile, outFreq);
if (Pi < 0) { Pi = 0.0; }
//saves this for later
- outFreq << i+1 << '\t' << Pi << endl;
+ outFreq << i+1 << '\t' << highFreq << endl;
- prob.push_back(Pi);
+ if (h.count(i) > 0) {
+ cout << i+1 << '\t' << highFreq << endl;
+ prob.push_back(Pi);
+ }
}
outFreq.close();
//compare to every other sequence in template
for(int j = 0; j < i; j++){
- Sequence subject = *(seqs[j]);
+ Sequence* subject = seqs[j];
map<int, int> trim;
map<int, int>::iterator it;