#include "includes.h" #include "grid.h" #include "vector.h" #include extern ofstream errorfs; #include "declare.h" /* This file contains source code for functions used during the mapping routine, mainly mundane things such as adjusting the datasets when we change the assumed location of the gene */ void augmentdata(const igrid& data, igrid& augdata, const igrid& freqallele, igrid& augfreqallele, const dgrid& freqfreq, dgrid& augfreqfreq, const dgrid& jointfreq2, dgrid& augjointfreq2, //const dvector& y, dvector& augy, const ivector& allelecounts, ivector& augallelecounts, const dvector& mut_markers, dvector& augmut_markers, const int &C, const int &ctrall, const int &debug) { int i, j; //make augdata for (i=0; i=C_loc) { if (anchapstore[i][j] != candanc(0,j+1)){submatch=0; break;}} } if (submatch==1) { match=1; break; } } if (match==0) { for (j=0;jmax) { max=maxlikCloc[i]; loc=maxlikCint[i]; } } return loc; }//assignE int pickmaxlikanc(const dvectors &resonetempstore) { //for each point on the likelihood surface, this function picks the //ancestral haplotype giving the highest lik. at the assumed location of //the gene (these points are joined together to form the lik. surf.) int i,maxind=0; double maxlik=resonetempstore[0][4]; for (i=1;i