From 064f63488f40cb9858078b3c5af2c64fa1d75dac Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Tue, 14 Jan 2020 11:32:24 +0100 Subject: [PATCH] Isolated function (not yet functional) --- R/tulostaAdmixtureTiedot.R | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 R/tulostaAdmixtureTiedot.R diff --git a/R/tulostaAdmixtureTiedot.R b/R/tulostaAdmixtureTiedot.R new file mode 100644 index 0000000..dd40ff9 --- /dev/null +++ b/R/tulostaAdmixtureTiedot.R @@ -0,0 +1,60 @@ +tulostaAdmixtureTiedot <- function(proportions, uskottavuus, alaRaja, niter) { + # TODO: discover what this function does. Plotting? Get examples? + # h0 <- findobj('Tag','filename1_text') + # inputf = get(h0,'String'); + # h0 = findobj('Tag','filename2_text'); + # outf = get(h0,'String'); clear h0; + + # if length(outf)>0 + # fid = fopen(outf,'a'); + # else + # fid = -1; + # diary('baps4_output.baps'); % save in text anyway. + # end + + # ninds = length(uskottavuus); + # npops = size(proportions,2); + # disp(' '); + # dispLine; + # disp('RESULTS OF ADMIXTURE ANALYSIS BASED'); + # disp('ON MIXTURE CLUSTERING OF INDIVIDUALS'); + # disp(['Data file: ' inputf]); + # disp(['Number of individuals: ' num2str(ninds)]); + # disp(['Results based on ' num2str(niter) ' simulations from posterior allele frequencies.']); + # disp(' '); + # if fid ~= -1 + # fprintf(fid, '\n'); + # fprintf(fid,'%s \n', ['--------------------------------------------']); fprintf(fid, '\n'); + # fprintf(fid,'%s \n', ['RESULTS OF ADMIXTURE ANALYSIS BASED']); fprintf(fid, '\n'); + # fprintf(fid,'%s \n', ['ON MIXTURE CLUSTERING OF INDIVIDUALS']); fprintf(fid, '\n'); + # fprintf(fid,'%s \n', ['Data file: ' inputf]); fprintf(fid, '\n'); + # fprintf(fid,'%s \n', ['Number of individuals: ' num2str(ninds)]); fprintf(fid, '\n'); + # fprintf(fid,'%s \n', ['Results based on ' num2str(niter) ' simulations from posterior allele frequencies.']); fprintf(fid, '\n'); + # fprintf(fid, '\n'); + # end + + # ekaRivi = blanks(6); + # for pop = 1:npops + # ekaRivi = [ekaRivi blanks(3-floor(log10(pop))) num2str(pop) blanks(2)]; + # end + # ekaRivi = [ekaRivi blanks(1) 'p']; % Added on 29.08.06 + # disp(ekaRivi); + # for ind = 1:ninds + # rivi = [num2str(ind) ':' blanks(4-floor(log10(ind)))]; + # if any(proportions(ind,:)>0) + # for pop = 1:npops-1 + # rivi = [rivi proportion2str(proportions(ind,pop)) blanks(2)]; + # end + # rivi = [rivi proportion2str(proportions(ind,npops)) ': ']; + # rivi = [rivi ownNum2Str(uskottavuus(ind))]; + # end + # disp(rivi); + # if fid ~= -1 + # fprintf(fid,'%s \n',[rivi]); fprintf(fid,'\n'); + # end + # end + # if fid ~= -1 + # fclose(fid); + # else + # diary off +} \ No newline at end of file