function [rho,groupz,numgroupsthisrow]=transcript_sorter_subfun1(rho,jj,kk,groupz,numgroupsthisrow)
%description: check whether this 'correlated' transcript correlates with *all* elements of each successive group until
%such a group is found, or until there are no more groups to check -- if there are no more groups to check, make a new group with the correlated transcript
%and the fulcrum transcript
%called by: transcript_sorter
%calls:
%notes:
%code confirmed date:
for mm=1:numgroupsthisrow
a=groupz{mm};
if all(rho(a,kk))
groupz{mm}=[a kk];
rho(kk,a)=0; %if there is a match into an existing group, all of those group members need to be zeroed out in the correlated transcript's fulcrum row
rho(a,kk)=0; %and the correlated transcript needs to be zeroed out in the fulcrum row of each other group member
return
end
end
groupz{mm+1}=[jj,kk];
rho(kk,jj)=0; %zero out the fulcrum transcript from the row where this correlated transcript is the fulcrum
numgroupsthisrow=numgroupsthisrow+1;