void InfAdmixture::exportXmlIter(std::ostream * fileout,int iter) { // state->printBeta(&cout); *fileout<<"<Iteration>"<<endl; state->setprint(fileout); *fileout<<"<Likelihood>"<<setprecision (10) <<logstateprob<<"</Likelihood>"<<endl; double lq=0; for(int c1=0;c1<(int)Q.size();c1++) lq+=priorForQ(c1); *fileout<<"<PriorForQ>"<<lq<<"</PriorForQ>"<<endl; *fileout<<"<Q>"<<endl; printQs(fileout); *fileout<<"</Q>"<<endl; if(P_QS<1.0) { *fileout<<"<P>"<<endl; printPs(fileout); *fileout<<"</P>"<<endl; } double np=0,nq=0; if (numPs>0) np=((double)accPs)/numPs; if (numQs>0) nq=((double)accQs)/numQs; *fileout<<"<AccPs>"<<np<<"</AccPs>"<<endl; *fileout<<"<AccQs>"<<nq<<"</AccQs>"<<endl; *fileout<<"<Number>"<<iter<<"</Number>"<<endl; *fileout<<"</Iteration>"<<endl; }
abcCounts::~abcCounts(){ if(oFileCountsBin!=NULL) bgzf_close(oFileCountsBin); if(oFileCountsPos!=NULL) bgzf_close(oFileCountsPos); if(doQsDist){ FILE *oFileQs = NULL; oFileQs = aio::openFile(oFiles,postfix3); fprintf(oFileQs,"qscore\tcounts\n"); printQs(oFileQs,qsDist); if(oFileQs) fclose(oFileQs); delete[] qsDist; } if(doDepth){ FILE *oFileSamplDepth = aio::openFile(oFiles,postfix4); FILE *oFileGlobDepth = aio::openFile(oFiles,postfix5); for(int i=0;i<nInd;i++){ for(int j=0;j<maxDepth+1;j++){ fprintf(oFileSamplDepth,"%lu\t",depthCount[i][j]); } fprintf(oFileSamplDepth,"\n"); } //thorfinn for(int j=0;j<maxDepth+1;j++) fprintf(oFileGlobDepth,"%lu\t",globCount[j]); fprintf(oFileGlobDepth,"\n"); //clean depthCount for(int i=0;i<nInd;i++) delete[] depthCount[i]; delete[] depthCount; if(oFileSamplDepth) fclose(oFileSamplDepth); if(oFileSamplDepth) fclose(oFileGlobDepth); } if(minQfile!=NULL){ // angsd::printMatrix(minQmat,stderr); angsd::deleteMatrix(minQmat); } if(oFileIcounts!=NULL) bgzf_close(oFileIcounts); free(oFiles); free(bpos.s); free(bbin.s); free(bufstr.s); if(globCount) delete [] globCount; }