addpath('./Utilities') % link in all matlab functions in a Utilities directory % this is the place to keep generally useful functions load BC49DATA % load breast cancer data set - 49 tumours on microarrays % loads a saved matlab workspace with lots of info who % what's here? whos % more detail please C_ER % indicator of ER status ivalidER % identifies the tumours in validation sample Chip_Names Descriptions([5524 5782 1734 2672],:) x=AD7129; Des=Descriptions; % save data and descriptions in dummy working variables scatter(1:49, x(5524,:)) % scatter plot of ER gene x(x<=1)=1; x=log2(x); % transform to log2 scale, with zero for cases less than 1 scatter(1:49, x(5524,:)) % scatter plot of ER gene after log transform size(x) % how many genes and arrays? [N,n]=size(x); % give the dimensions names N n help image % simple on-line help imagesc(x); colormap hot % let's look at gene expression data helpwin % to get browser access to extensive help desk plot(x(:,1)) % one array, all genes scatter(1:n,x(5524,:)) hist(x(5524,:)) hist(x(5524,:),30) % one gene, all arrays ind=1:n; scatter(ind,x(1734,:),'r+') ind=1:n; scatter(ind(C_ER==0),x(2672,C_ER==0)); hold on; scatter(ind(C_ER==1),x(2672,C_ER==1),'r'); hold off; ShowGene(x,C_ER,5524) % example of use of a user written function previously % saved in the Utilities directory scatter(1:n,mean(x)) % sample mean of arrays (columns) -- note low cases 7,8,11,46 scatter(1:200,mean(x(1:200,:),2)) % sample means of first 200 genes (rows) scatter(x(5524,:),x(5782,:)) scatter(AD7129(5524,:),AD7129(5782,:)) % two genes print -depsc plot1.ps % save to a postscript file figure(2); scatter(x(5524,:),x(5782,:)); print -depsc plot2.ps % new graph, save to file figure(1) subplot(2,2,1); scatter(x(5524,:),x(5782,:)) xlabel('Gene 5524'); ylabel('Gene 5782') subplot(2,2,2); scatter(x(5524,:),x(1734,:)) xlabel('Gene 5524'); ylabel('Gene 1734') subplot(2,2,3); scatter(x(5524,:),x(2672,:)) xlabel('Gene 5524'); ylabel('Gene 2672') subplot(2,2,4); scatter(x(1734,:),x(5782,:)) xlabel('Gene 1734'); ylabel('Gene 5782') % 4 scatter plots on one page help std help var % back to sample summaries var(x(5524,:)) var(x([5524 5782 1734 2672],:)') % sample variances for some genes -- note transpose std(x(5524,:)) std(x([5524 5782 1734 2672],:)') % sample standard deviations -- cov(x([5524 5782 1734 2672],:)') % sample covariance matrix corrcoef(x([5524 5782 1734 2672],:)') % sample correlation matrix quit % gracefully close Matlab session - nothing is saved