function all_lead_phases = get_phases_of_lead_FT(OUT, ord_seq)

% number of proteins in the ordered set
N = length(ord_seq);

% find the leading FT at MFP
tmp = strfind(OUT(1,:), 'Lead_Kmer_mfp'); 
tmp = cellfun(@isempty, tmp);
idx = find(tmp==0); clear tmp;
OUT(1,:) = [];

for i = 1:N
    
    %get the leading FT at MP
    tmp = OUT{i,idx};
    LFT_mfp = tmp{1,1};
    
    % get the phases of LFT_mfp
    % --- locations
    loc = strfind(ord_seq{i}, LFT_mfp);
    % --- phases
    lead_phase{i} = diff(loc);
    
    if length(loc) < 5
        disp('ERROR: this is not a FT');
        keyboard;
    end
    
end
    
% --- gather all lead_phase as a single vector
all_lead_phases = [];
for p = 1:length(lead_phase)
    all_lead_phases = [all_lead_phases lead_phase{p}];
end

[a b] = hist(all_lead_phases,length(all_lead_phases));
loglog(b, a, 'ko');
% clean zeros
tmp = find(a==0); a(tmp) = []; b(tmp) = [];
%for the ranked distribution:
a_ord = sort(a,'descend');
hold; loglog(b, a_ord, 'r.');
    
    