%PCA analysis script written by Laura Ylä-Outinen X1=readtable('PCA_table.xlsx'); X1(1:36,1)=table({'hPSC_20517_MEA1and2'}); X2=X1(:,4:end); X3=table2array(X2); Xstandard=zscore(X3); expressions=Xstandard; %% subtypes=X1(:,1); subtypes= table2array(subtypes); subtypes3=categorical(subtypes); %% [coeff, score, latent, tsquared, explained,mu] = pca(expressions); %if matrix do not contain blanks X=score(:,1); Y=score(:,2); Z=score(:,3); %% gscatter3b(X,Y,Z, subtypes3, [0.82 0.3 0.1; 0.82 0.3 0.1; 0.82 0.3 0.1; 0 0.48 0.83; 0 0.48 0.83; 0 0.48 0.83;] ,'ox.ox.',[10,10,15,10,10,15]) ;