Commit 6134ef4a authored by Andrew Cohen's avatar Andrew Cohen

updated client

parent 380538e4
% detectFissionFusion
tic
SERVER='https://leverjs.net/Dario/'
url=[SERVER 'lever'];
leverList=webread(url);
fissionEvents={[],[]};
fusionEvents={[],[]};
% set up data partitions
featureList=[];
for f=1:length(leverList)
if (14==f) || (3==f)
continue
% by folder
leverName=leverList{f};
idxFolder=strfind(leverName,'*');
fname=leverName(1:idxFolder-1);
% see if this feature name already exists
if ~isempty(featureList)
featureNames={featureList.folderName};
fidx=find(cellfun(@(x) strcmp(x,fname),featureNames));
else fidx=[];
end
if ~isempty(strfind(lower(leverList{f}),'ctrl'))
idx=1;
if isempty(fidx)
nf=[];
nf.folderName=fname;
nf.leverNames={leverName};
nf.features=[]; % put stats here
featureList=[featureList nf];
fidx=length(featureList);
else
idx=2;
featureList(fidx).leverNames={featureList(fidx).leverNames{:},leverName};
end
url=[SERVER leverList{f} '/trackList/1'];
url=[SERVER leverList{f} '/constants'];
constants=webread(url);
url=[SERVER leverList{f} '/trackList/3'] ;
trackList=webread(url);
if isempty(trackList)
continue
end
% nFusion= length(find([trackList.t0]>1))/length(find(1==[trackList.t0]));
% nFission = length(find([trackList.t1]<max([trackList.t1])))/length(find(1==[trackList.t0]));
movieFeatures=[];
for t=1:constants.imageData.NumberOfFrames
url=[SERVER leverList{f} '/cellCentroids/' num2str(t)];
tCells=webread(url);
if isempty(tCells)
continue
end
trackIDcull=setdiff([tCells.trackID],[trackList.trackID]);
for i=1:length(tCells)
if isempty(intersect(tCells(i).trackID,trackIDcull))
movieFeatures=[movieFeatures,[tCells(i).area]];
end
end
end
% featureList(fidx).features=[featureList(fidx).features median(movieFeatures)];
featureList(fidx).features=[featureList(fidx).features mean(movieFeatures./median(movieFeatures))];
end
for i=1:length(featureList)
fprintf(1,'%s: mean(featureList)=%2.5f\n',featureList(i).folderName,median(featureList(i).features));
end
for i=1:length(featureList)
for j=i+1:length(featureList)
[p,h]=ranksum(featureList(i).features,featureList(j).features);
fprintf(1,'%s vs. %s : [p,h]=%2.3f,%2.3f \n',featureList(i).folderName,featureList(j).folderName,p,h);
end
end
nFusion= length(find([trackList.t0]>1));
nFission = length(find([trackList.t1]<max([trackList.t1])));
fissionEvents{idx}=[fissionEvents{idx};nFission];
fusionEvents{idx}=[fusionEvents{idx};nFusion];
nFissionFusion=length(trackList)/length(find([trackList.t0]==1));
ctrl=[];
idh=[];
for i=1:length(featureList)
if strfind(lower(featureList(i).folderName),'ctrl')
ctrl=[ctrl featureList(i).features];
else
idh=[idh featureList(i).features];
end
end
ission12=[median(fissionEvents{1}), median(fissionEvents{2})]
[p,h]=ranksum(fissionEvents{1},fissionEvents{2})
fusion12=[median(fusionEvents{1}) median(fusionEvents{2})]
[p,h]=ranksum(fusionEvents{1},fusionEvents{2})
[median(idh) median(ctrl)]
[p,h]=ranksum(idh,ctrl)
toc
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment