function viewPartition4(osuudet, popnames, npops, admixnpops, ... inliers, partition, filename) % Kuin viewParition.m, mutta toimii itsenäisesti. Ei siis tarvitse % globaalia COUNTS-muuttujaa. nind = size(osuudet,1); % inliers = unique(partition); % inliers = find(any(osuudet)); if admixnpops>36 disp(' '); disp('Figure can be drawn only if the number of populations'); disp('is less or equal to 36.'); disp(' '); return; end varit = giveColors(npops); korkeinviiva = 1.05; pieninarvo = -korkeinviiva; h0 = figure; set(h0, 'NumberTitle', 'off'); %image_figure; %Muutettu set(h0,'Tag','admixture_result'); set(h0,'Name',['Admixture Result - ' filename]); tiedot.popnames = popnames; tiedot.info = osuudet; set(h0,'UserData',tiedot); set(gca, 'Xlim', [-.5 ,nind+.5], 'YLim', [pieninarvo ,korkeinviiva], ... 'XTick', [], 'XTickLabel', [], 'YTick', [], 'YTickLabel', []); for i=1:nind if any(osuudet(i,:)>0) cumOsuudet = cumsum(osuudet(i,:)); % Pylvään piirtäminen for j = 1:admixnpops if j == 1 if cumOsuudet(1)>0 h0 =patch([i-1, i, i, i-1], [0, 0, cumOsuudet(1), cumOsuudet(1)], varit(inliers(j),:)); set(h0,'EdgeColor','none'); % Midevaa varten kommentoitava! end else if (cumOsuudet(j)>cumOsuudet(j-1)) h0 = patch([i-1, i, i, i-1], [cumOsuudet(j-1), cumOsuudet(j-1), ... cumOsuudet(j), cumOsuudet(j)], varit(inliers(j),:)); set(h0,'EdgeColor','none'); % Midevaa varten kommentoitava! end end end end end if ~isempty(popnames) npops = size(popnames,1); % NB! npops now stands for the number of individuals. for i = 1:npops firstInd = popnames{i,2}; if size(popnames,1)~=nind line([firstInd-1, firstInd-1], [0,1], 'Color', 'k'); %Populaatioiden rajat end % The determination of x_paikka is changed, since popnames could be % non-sequential. - Jing if i