+//********************************************************************************************************************
+//if it is more probable that the reverse compliment kmers are in the template, then we assume the sequence is reversed.
+bool Bayesian::isReversed(vector<int>& queryKmers){
+ try{
+ bool reversed = false;
+ float prob = 0;
+ float reverseProb = 0;
+
+ for (int i = 0; i < queryKmers.size(); i++){
+ int kmer = queryKmers[i];
+ if (kmer >= 0){
+ prob += WordPairDiffArr[kmer].prob;
+ reverseProb += WordPairDiffArr[kmer].reverseProb;
+ }
+ }
+
+ if (reverseProb > prob){ reversed = true; }
+
+ return reversed;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Bayesian", "isReversed");
+ exit(1);
+ }
+}
+//********************************************************************************************************************
+int Bayesian::generateWordPairDiffArr(){
+ try{
+ Kmer kmer(kmerSize);
+ for (int i = 0; i < WordPairDiffArr.size(); i++) {
+ int reversedWord = kmer.getReverseKmerNumber(i);
+ WordPairDiffArr[i].reverseProb = WordPairDiffArr[reversedWord].prob;
+ }
+
+ return 0;
+ }catch(exception& e) {
+ m->errorOut(e, "Bayesian", "generateWordPairDiffArr");
+ exit(1);
+ }
+}