%plot YFP levels vs size figure totiY=[]; totiL=[]; for i=1:2 totiY=[]; totiL=[]; for j=1:12 if ~isempty(totOutDataNorm{j,i}) [matDataY]=linearCellDat(totOutData{j,i},28); totiY=[totiY;matDataY(:,1)]; [matDataL]=linearCellDat(totOutData{j,i},13); totiL=[totiL;matDataL(:,1)]; end itotL{i}=totiL; itotY{i}=totiY; end end binsV=[2000:500:12000]; binsM=[2250:500:11750]; subplot(2,4,1) hold on scatter(itotL{1},itotY{1},50,cmapDef(1,:),'filled') %correlation WT with FP corrWT=corr(itotY{1},itotL{1},'type','pearson'); binOut=dataBinner(itotL{1},itotY{1},binsV); scatter(binsM,binOut(:,1),100,'k','filled') grid on box on xlim([2000,12000]) ylim([100,450]) subplot(2,4,5) hold on scatter(itotL{2},itotY{2},50,cmapDef(2,:),'filled') binOut=dataBinner(itotL{2},itotY{2},binsV); %correlation AF with FP corrAF=corr(itotY{2},itotL{2},'type','pearson'); scatter(binsM,binOut(:,1),100,'k','filled') grid on box on xlim([2000,12000]) ylim([100,450]) %plot the gradients matRL=nan(12,2); matRLTot=nan(12,2); matRYTot=nan(12,2); count=0; totDC={}; subInd={[1,2],[3,4]}; subindNewL=[2*ones(12,1),6*ones(12,1)]; for i=1:2 matDC=[]; for j=11:12 if ~isempty(totOutDataNorm{j,i}) count=count+1; [matDataL]=linearCellDat(totOutData{j,i},13); [matDataY]=linearCellDat(totOutData{j,i},28); %cellSGRate{j,i}=PlotSmoothedFluoroGR_thesis_Specific(totOutDataNorm{j,i},0); cmaxV=[]; %if cellSGRate{j,i}{l,3}(1)>1 hold on for l=1:size(matDataL,1) if ~totAna{j,i}(l) matDC=[matDC;matDataL(l,1),max(cellSGRate{j,i}{l,2}),matDataY(l,1),0]; end if totAna{j,i}(l)% && max(cellSGRate{j,i}{l,2}(1))<50 maxTD=maxIndF(cellSGRate{j,i}{l,2}); maxTD_L=maxTD-30; ratChange=max(cellSGRate{j,i}{l,2}); maxC3_L=ratChange; matDC=[matDC;matDataL(l,1),maxC3_L,matDataY(l,1),1]; subplot(2,4,subindNewL(j,i)) hold on scatter(matDataL(l,1),maxC3_L,50,matDataY(l,1),'filled') end end end end ax=gca; colorbar(ax); if ~isempty(matDC) && size(matDC,1)>10 [~,~,~,~,bInt]=regress(matDC(:,2),[matDC(:,1),ones(size(matDC(:,1)))]); matRL(j,i)=bInt(1); matPV(j,i)=bInt(3); % binsV=[2000:500:12000]; binsM=[2250:500:11750]; binOut=dataBinner(matDC(:,1),matDC(:,2),binsV); % fitDat=polyfit(binsM(~isnan(binOut(:,1))),binOut(~isnan(binOut(:,1)),1)',1); % hold on % subplot(2,4,subindNewL(j,i)) % plot(binsM,binsM*fitDat(1)+fitDat(2),'LineWidth',3,'color',cmapD(j,:)) hold on % hold on scatter(binsM,binOut(:,1),70,'r','filled') scatter(binsM,binOut(:,1),20,'k','filled') %totDC{i}=matDC; xlim([4000,12000]) ylim([50,250]) grid on box on [~,~,~,~,bInt]=regress(binsM',[binOut(:,1),ones(size(binOut(:,1)))]); matRLTot(j,i)=bInt(1); end end subindNewY=[3*ones(12,1),7*ones(12,1)]; matRY=nan(12,2); count=0; totDC={}; subInd={[1,2],[3,4]}; for i=1:2 matDC=[]; for j=11:12 if ~isempty(totOutDataNorm{j,i}) count=count+1; [matDataL]=linearCellDat(totOutData{j,i},13); [matDataY]=linearCellDat(totOutData{j,i},28); %cellSGRate{j,i}=PlotSmoothedFluoroGR_thesis_Specific(totOutDataNorm{j,i},0); cmaxV=[]; %if cellSGRate{j,i}{l,3}(1)>1 hold on for l=1:size(matDataL,1) if ~totAna{j,i}(l) matDC=[matDC;matDataL(l,1),max(cellSGRate{j,i}{l,2}),matDataY(l,1),0]; end if totAna{j,i}(l)%&& max(cellSGRate{j,i}{l,2}(1))<50 maxTD=maxIndF(cellSGRate{j,i}{l,2}); maxTD_L=maxTD-30; ratChange=max(cellSGRate{j,i}{l,2}); maxC3_L=ratChange; matDC=[matDC;matDataL(l,1),maxC3_L,matDataY(l,1),1]; subplot(2,4,subindNewY(j,i)) hold on scatter(matDataY(l,1),maxC3_L,50,matDataL(l,1),'filled') end end end end ax=gca; colorbar(ax); if ~isempty(matDC) && size(matDC,1)>10 [~,~,~,~,bInt]=regress(matDC(:,2),[matDC(:,3),ones(size(matDC(:,1)))]); %added corr bInt(1)=corr(matDC(:,2),matDC(:,3),'type','pearson'); matRY(j,i)=bInt(1); matPV(j,i)=bInt(3); % binsV=[140:15:440]; binsM=[147.5:15:432.5]; binOut=dataBinner(matDC(:,3),matDC(:,2),binsV); % fitDat=polyfit(binsM(~isnan(binOut(:,1))),binOut(~isnan(binOut(:,1)),1)',1); % hold on % subplot(2,4,subindNewY(j,i)) % plot(binsM,binsM*fitDat(1)+fitDat(2),'LineWidth',3,'color',cmapD(j,:)) hold on scatter(binsM,binOut(:,1),70,'r','filled') scatter(binsM,binOut(:,1),20,'k','filled') totDC{i}=matDC; xlim([150,400]) ylim([50,250]) grid on box on [~,~,~,~,bInt]=regress(binsM',[binOut(:,1),ones(size(binOut(:,1)))]); bInt(1)=corr(binsM',binOut(:,1),'type','pearson'); matRYTot(j,i)=bInt(1); end end subplot(2,4,[4,8]) hold on scatter(1,matRL(12,1),100,cmapDef(1,:),'filled') scatter(2,matRY(12,1),100,cmapDef(1,:),'filled') plot([1,2],[matRL(12,1),matRY(12,1)],'LineWidth',3) scatter(1,matRL(12,2),100,cmapDef(2,:),'filled') scatter(2,matRY(12,2),100,cmapDef(2,:),'filled') plot([1,2],[matRL(12,2),matRY(12,2)],'LineWidth',3) grid on box on % figure % matDC=totDC{1}; % hold on % scatter(matDC(:,1)./mean(matDC(:,1)),matDC(:,2),50,cmapDef(2,:),'filled') % scatter(matDC(:,3)./mean(matDC(:,3)),matDC(:,2),50,cmapDef(1,:),'filled') % matDC=totDC{2}; % hold on % scatter(matDC(:,1)./mean(matDC(:,1)),matDC(:,2),50,cmapDef(3,:),'filled') % scatter(matDC(:,3)./mean(matDC(:,3)),matDC(:,2),50,cmapDef(4,:),'filled') %