%% import data 
clear; % clear all workspace variables

% Load the data 
load expressiondata;

% list of variables in the workspace
whos 

% plot the gene expression matrix as image
figure(1); clf;
imagesc(X)
xlabel('gene')
ylabel('condition')


%% Perform SVD
[U,S,V] = svd(X);
P = X*V; % Principal components

%% Plot first three components of X
figure(2); clf;
scatter3(X(:,1),X(:,2),X(:,3),24,col,'filled')
xlabel(num2str(Probes.geneid(1)))
ylabel(num2str(Probes.geneid(2)))
zlabel(num2str(Probes.geneid(3)))

%% Plot first 3 principal components
figure(3); clf;
scatter3(P(:,1),P(:,2),P(:,3),24,col,'filled')
xlabel('Premiere composante')
ylabel('Deuxieme composante')
zlabel('Troisieme composante')
