void extern readPhenoFile(vector<Individual*>& sample, vector<Locus*>& locus, vector<CSNP*>& snp) { par.qt = false; par.bt = true; checkFileExists(par.phenofile); ifstream PHE(par.phenofile.c_str(), ios::in); map<string, Individual*> uid; map<string, Individual*>::iterator ii; for(int i=0; i<sample.size(); i++) { uid.insert(make_pair(sample[i]->fid+"_"+sample[i]->iid, sample[i])); sample[i]->phenotype = -9; sample[i]->phenotypes.resize(0); sample[i]->missing = true; } vector<int> pheno_idx; pheno_idx.resize(0); if(par.pheno_names.size()>0) { string pfid, piid, ph; char cline[par.MAX_LINE_LENGTH]; PHE.getline(cline, par.MAX_LINE_LENGTH, '\n'); string sline = cline; if(sline!="") { string buf; stringstream ss(sline); vector<string> tokens; while(ss>>buf) tokens.push_back(buf); if(tokens[0] != "FID") error("First header field must be FID"); if(tokens[1] != "IID") error("Second header field must be IID"); for(int j=0; j<par.pheno_names.size(); j++) for(int i=2; i<tokens.size(); i++) if(tokens[i] == par.pheno_names[j]) { pheno_idx.push_back(i-1); } if(pheno_idx.size()<par.pheno_names.size()) error("Did not find phenotypes"); } // end of if sline != ""
int _ecore_thread_win32_join(win32_thread *x, void **res) { if (!PHE(x, PHS())) { WaitForSingleObject(x->thread, INFINITE); CloseHandle(x->thread); } if (res) *res = x->val; free(x); return 0; }