load('geno.dat') [nmice, nmarks] = size(geno); geno(find(geno==9)) = NaN; load('pheno.dat') [n, ntraits] = size(pheno); if n ~= nmice error('number of mice in pheno not equal to number of mice in geno'); end %marker names load('chrid.dat') m = length(chrid); if m ~= nmarks error('number of markers in chrid not equal to number of markers in geno'); end fid = fopen('mnames.txt', 'r'); mnames = cell(m,1); i = 1; while 1 if feof(fid), break, end mnames(i) = {str2mat(fscanf(fid, '%s', 1))}; i = i+1; end fclose(fid); %impute the genotype array rand('state',sum(100*clock)); genoi = geno; for i = 1:20 genoi(:,find(chrid==i)) = impute(geno(:,find(chrid==i))); end