You are on page 1of 24

% 1)

% Load the F. tularensis data set


load Kingrynormalized.mat
X = Kingrynorm;

% Compute the thin singular value decomposition


[U, S, V] = svd(X, 0)

U = 37632×108
-0.0029 -0.0002 -0.0009 -0.0019 0.0047 -0.0023 -0.0019 -0.0064
-0.0062 0.0078 -0.0010 0.0004 0.0033 0.0095 -0.0063 0.0003
-0.0037 0.0082 0.0006 -0.0028 0.0092 -0.0072 0.0010 -0.0001
0.0037 0.0095 -0.0032 0.0052 -0.0056 -0.0088 0.0016 0.0071
-0.0004 0.0099 0.0006 0.0104 0.0002 -0.0082 -0.0028 -0.0018
0.0007 0.0109 0.0054 0.0064 0.0037 -0.0072 0.0006 -0.0025
0.0036 0.0109 0.0069 0.0032 0.0033 -0.0051 0.0010 0.0009
0.0088 0.0053 0.0023 -0.0071 -0.0006 -0.0011 0.0034 0.0058
-0.0002 -0.0008 -0.0004 0.0009 -0.0027 -0.0050 0.0028 0.0023
0.0029 0.0091 0.0066 -0.0008 -0.0054 -0.0034 0.0059 0.0030

S = 108×108
763.0558 0 0 0 0 0 0 0
0 595.7462 0 0 0 0 0 0
0 0 528.1473 0 0 0 0 0
0 0 0 452.4644 0 0 0 0
0 0 0 0 406.3143 0 0 0
0 0 0 0 0 389.5022 0 0
0 0 0 0 0 0 375.4010 0
0 0 0 0 0 0 0 352.5415
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

V = 108×108
-0.1566 0.0239 -0.1157 -0.1143 0.0463 -0.1258 0.0398 -0.0441
-0.1341 0.0015 -0.1215 -0.1208 0.1019 -0.1103 0.0208 -0.0558
-0.0989 -0.0356 -0.1129 -0.0949 0.0702 -0.1378 -0.0147 -0.0811
0.0041 0.0657 -0.1413 0.1309 -0.1788 0.0538 -0.1100 0.0289
-0.0044 0.0603 -0.1447 0.1257 -0.1742 0.0682 -0.1035 0.0297
0.0030 0.0602 -0.1391 0.1252 -0.1847 0.0494 -0.1012 0.0174
-0.0934 -0.0681 -0.1340 0.0013 0.0811 -0.0764 0.0816 0.0125
-0.0842 -0.0817 -0.1147 0.0119 0.0257 -0.1018 0.0979 -0.0048
-0.0598 -0.0905 -0.1283 0.0125 0.0560 -0.0905 0.0815 -0.0114
-0.1019 0.0144 0.0324 0.1772 -0.0682 -0.0586 -0.0227 -0.1504

% Extract the singular values from the diagonal matrix S


s = diag(S)

s = 108×1
763.0558
595.7462
528.1473
452.4644
406.3143
389.5022
375.4010
352.5415

1
341.3336
325.1758

% Plot the singular values


figure
plot(s)
xlabel('Index')
ylabel('Singular Value')
title('Singular Values of F. tularensis Data Set')

% Plot the first three left-singular vectors (columns of U)


figure
subplot(1, 3, 1)
plot(U(:, 1))
title('1st Left-Singular')

subplot(1, 3, 2)
plot(U(:, 2))
title('2nd Left-Singular')

subplot(1, 3, 3)
plot(U(:, 3))
title('3rd Left-Singular')

2
% Plot the first three right-singular vectors (columns of V)
figure
subplot(1, 3, 1)
plot(V(:, 1))
title('1st Right-Singular')

subplot(1, 3, 2)
plot(V(:, 2))
title('2nd Right-Singular')

subplot(1, 3, 3)
plot(V(:, 3))
title('3rd Right-Singular')

3
% 2)
% Compute the total energy captured by each dimension
total_energy = sum(s.^2)

total_energy = 4.0266e+06

% Initialize variables to store results


E = zeros(108, 1)

E = 108×1
0
0
0
0
0
0
0
0
0
0

% Compute the fraction of energy captured by each dimension


for k = 1:108
E(k) = sum(s(1:k).^2) / total_energy;
end

% Display results

4
energy_two_dimensions = E(2)

energy_two_dimensions = 0.2327

dimensions_for_95_percent_energy = find(E >= 0.95, 1)

dimensions_for_95_percent_energy = 73

fprintf('Energy captured by two dimensions: %.2f%%\n', energy_two_dimensions * 100)

Energy captured by two dimensions: 23.27%

fprintf('Number of dimensions for 95%% energy: %d\n',


dimensions_for_95_percent_energy)

Number of dimensions for 95% energy: 73

% Plot the fraction of energy captured by each dimension


figure
plot(1:108, E, 'o-')
xlabel('Number of Dimensions (k)')
ylabel('Fraction of Total Energy Captured')
title('Energy Captured by Singular Values')

% 3)
% Project the data onto the first two left singular vectors
A_2D = U(:, 1:2)' * X

5
A_2D = 2×108
-119.4737 -102.3403 -75.4992 3.1554 -3.3404 2.3259 -71.2560 -64.2766
14.2131 0.8660 -21.2198 39.1571 35.9045 35.8918 -40.5447 -48.6715

% Project the data onto the first three left singular vectors
A_3D = U(:, 1:3)' * X

A_3D = 3×108
-119.4737 -102.3403 -75.4992 3.1554 -3.3404 2.3259 -71.2560 -64.2766
14.2131 0.8660 -21.2198 39.1571 35.9045 35.8918 -40.5447 -48.6715
-61.0823 -64.1692 -59.6081 -74.6054 -76.4483 -73.4806 -70.7811 -60.5839

% Plot in two dimensions


figure
hold on
plot(A_2D(1, 1:6), A_2D(2, 1:6), 'b+')
plot(A_2D(1, 55:60), A_2D(2, 55:60), 'bd')
plot(A_2D(1, 7:30), A_2D(2, 7:30), 'ro')
plot(A_2D(1, 31:54), A_2D(2, 31:54), 'gx')
plot(A_2D(1, 61:84), A_2D(2, 61:84), 'kv')
plot(A_2D(1, 85:108), A_2D(2, 85:108), 'm^')
legend('control lung','control spleen','Schu4 lung', 'LVS lung','Sch4 spleen','LVS
spleen')
title('Two-dimensional representation using first two left singular vectors')

% Plot in three dimensions


figure
scatter3(A_3D(1, 1:6), A_3D(2, 1:6), A_3D(3, 1:6), 'b+')
hold on

6
scatter3(A_3D(1, 55:60), A_3D(2, 55:60), A_3D(3, 55:60), 'bd')
scatter3(A_3D(1, 7:30), A_3D(2, 7:30), A_3D(3, 7:30), 'ro')
scatter3(A_3D(1, 31:54), A_3D(2, 31:54), A_3D(3, 31:54), 'gx')
scatter3(A_3D(1, 61:84), A_3D(2, 61:84), A_3D(3, 61:84), 'kv')
scatter3(A_3D(1, 85:108), A_3D(2, 85:108), A_3D(3, 85:108), 'm^')
legend('control lung','control spleen','Schu4 lung', 'LVS lung','Sch4 spleen','LVS
spleen')
title('Three-dimensional representation using first three left singular vectors')
xlabel('Dimension 1')
ylabel('Dimension 2')
zlabel('Dimension 3')
grid on

% 4)
% Extract data for Schu4 strain in the lung (columns 7-30)
X_Schu4 = X(:, 7:30)

X_Schu4 = 37632×24
-0.1106 -0.4488 -0.2462 1.0227 0.5201 0.1148 0.4345 0.3190
-0.2835 -0.4952 -0.1248 0.8545 0.6581 0.2829 1.1782 5.9283
-0.7119 0.0369 0.3124 0.0240 -0.2383 -0.8081 3.6026 2.9567
0.0857 0.4358 0.2377 -0.2504 -0.3249 -0.0884 -0.5779 -0.2263
0.1945 -0.0549 -0.3157 1.2722 0.8304 2.6143 0.7918 -0.4857
0.0826 -0.1007 -0.2181 2.5242 0.5068 3.8065 0.7344 1.2831
-0.3862 -0.4234 -0.5220 0.8718 -0.4737 0.5674 0.5036 0.1860
-0.9136 -0.8841 -0.8944 -1.0350 -1.0424 -1.0306 -0.8328 -0.6819
0.0849 0.3333 -0.0213 -0.6754 -0.5844 -0.6528 -0.5538 -0.1394
-1.0491 -0.7018 -0.8289 3.1318 -0.7631 0.0980 -0.3447 1.3374

7
% Extract data for LVS strain in the lung (columns 31-54)
X_LVS = X(:, 31:54)

X_LVS = 37632×24
1.1820 2.1958 2.4848 -0.3488 0.1587 -0.1206 0.4327 -0.1981
1.9293 0.0545 0.3656 -0.1050 0.6631 0.3350 -0.7420 -0.0146
1.5883 3.4169 1.2189 -0.8081 -0.2364 -0.8081 -0.1791 -0.1845
-0.4445 -0.3914 -0.5045 -0.5683 0.0541 0.2145 -0.9411 -0.8723
0.0801 -0.0388 0.0315 0.3903 0.2256 4.5324 -0.7920 -0.8012
-0.1144 -0.1722 -0.3414 -0.6105 0.3428 0.6860 -0.9399 -0.8708
-0.3656 -0.5726 -0.6380 -0.6506 0.0658 -0.0325 -0.8801 -0.8011
-0.6887 -0.6763 -0.7026 -0.9405 -0.9783 -0.9938 0.7062 0.8699
0.0958 0.2425 0.0346 -0.7702 -0.7351 -0.7544 0.5100 0.5391
-0.4594 -0.0646 -0.7266 -1.2553 -0.1170 0.4002 -0.5740 -0.9889

% Compute the thin SVD for each dataset


[U_Schu4, S_Schu4, ~] = svd(X_Schu4, 'econ')

U_Schu4 = 37632×24
0.0016 -0.0021 0.0007 0.0024 -0.0007 -0.0008 -0.0038 -0.0020
0.0110 -0.0022 -0.0025 0.0016 0.0044 0.0107 -0.0025 -0.0010
0.0085 0.0060 0.0010 0.0047 -0.0010 -0.0043 0.0093 -0.0059
-0.0004 0.0119 0.0105 -0.0019 0.0025 0.0007 0.0049 0.0041
0.0015 0.0015 0.0120 0.0033 -0.0009 -0.0021 0.0029 0.0090
0.0045 -0.0011 0.0110 0.0052 0.0020 0.0013 0.0013 0.0126
0.0017 0.0042 0.0058 0.0021 -0.0031 0.0019 -0.0006 0.0033
-0.0023 0.0105 0.0006 0.0010 -0.0014 0.0012 -0.0055 0.0007
-0.0014 0.0048 -0.0009 0.0002 0.0028 -0.0007 0.0047 0.0002
0.0029 0.0016 0.0064 0.0053 -0.0007 0.0078 -0.0060 0.0106

S_Schu4 = 24×24
526.4198 0 0 0 0 0 0 0
0 354.7288 0 0 0 0 0 0
0 0 316.9211 0 0 0 0 0
0 0 0 281.7616 0 0 0 0
0 0 0 0 239.9237 0 0 0
0 0 0 0 0 234.8084 0 0
0 0 0 0 0 0 211.0740 0
0 0 0 0 0 0 0 194.7623
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

[U_LVS, S_LVS, ~] = svd(X_LVS, 'econ')

U_LVS = 37632×24
-0.0050 -0.0021 0.0018 0.0034 0.0043 -0.0069 0.0113 0.0215
-0.0036 0.0078 -0.0047 -0.0004 0.0043 -0.0021 -0.0037 0.0040
-0.0044 0.0040 -0.0018 0.0137 0.0008 -0.0048 -0.0041 -0.0009
0.0036 0.0048 -0.0056 -0.0022 -0.0106 0.0075 -0.0026 -0.0014
0.0002 0.0041 -0.0118 0.0033 -0.0085 0.0024 0.0027 -0.0024
0.0014 0.0041 -0.0033 0.0032 -0.0009 0.0035 0.0033 -0.0062
0.0025 0.0043 -0.0005 -0.0006 0.0003 0.0039 0.0023 -0.0073
0.0037 0.0029 0.0081 0.0034 -0.0022 -0.0030 -0.0016 -0.0114
0.0001 -0.0021 -0.0029 -0.0055 -0.0087 0.0047 -0.0136 0.0081
0.0031 0.0055 -0.0019 -0.0057 -0.0012 0.0034 -0.0002 -0.0041

8
S_LVS = 24×24
434.3284 0 0 0 0 0 0 0
0 387.9921 0 0 0 0 0 0
0 0 341.8586 0 0 0 0 0
0 0 0 289.6863 0 0 0 0
0 0 0 0 261.4647 0 0 0
0 0 0 0 0 250.7513 0 0
0 0 0 0 0 0 223.4269 0
0 0 0 0 0 0 0 202.4190
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

% Extract singular values for each dataset


s_Schu4 = diag(S_Schu4)

s_Schu4 = 24×1
526.4198
354.7288
316.9211
281.7616
239.9237
234.8084
211.0740
194.7623
186.0505
173.6665

s_LVS = diag(S_LVS)

s_LVS = 24×1
434.3284
387.9921
341.8586
289.6863
261.4647
250.7513
223.4269
202.4190
191.3431
172.4755

% Compute energy for each dataset


E_Schu4 = cumsum(s_Schu4.^2) / sum(s_Schu4.^2)

E_Schu4 = 24×1
0.2683
0.3901
0.4874
0.5642
0.6200
0.6734
0.7165

9
0.7532
0.7867
0.8159

E_LVS = cumsum(s_LVS.^2) / sum(s_LVS.^2)

E_LVS = 24×1
0.1844
0.3315
0.4458
0.5278
0.5946
0.6561
0.7049
0.7449
0.7807
0.8098

% Plot the energy plots


figure
plot(1:length(E_Schu4), E_Schu4, 'b-', 'LineWidth', 2)
hold on
plot(1:length(E_LVS), E_LVS, 'r-', 'LineWidth', 2)
xlabel('Number of Dimensions (k)')
ylabel('Fraction of Total Energy Captured')
title('Energy Captured by Singular Values for Schu4 and LVS in Lung')
legend('Schu4 in Lung', 'LVS in Lung')
grid on

10
% 5)
% Extract data for Schu4 strain in the lung (columns 7-30)
X_Schu4_lung = X(:, 7:30)

X_Schu4_lung = 37632×24
-0.1106 -0.4488 -0.2462 1.0227 0.5201 0.1148 0.4345 0.3190
-0.2835 -0.4952 -0.1248 0.8545 0.6581 0.2829 1.1782 5.9283
-0.7119 0.0369 0.3124 0.0240 -0.2383 -0.8081 3.6026 2.9567
0.0857 0.4358 0.2377 -0.2504 -0.3249 -0.0884 -0.5779 -0.2263
0.1945 -0.0549 -0.3157 1.2722 0.8304 2.6143 0.7918 -0.4857
0.0826 -0.1007 -0.2181 2.5242 0.5068 3.8065 0.7344 1.2831
-0.3862 -0.4234 -0.5220 0.8718 -0.4737 0.5674 0.5036 0.1860
-0.9136 -0.8841 -0.8944 -1.0350 -1.0424 -1.0306 -0.8328 -0.6819
0.0849 0.3333 -0.0213 -0.6754 -0.5844 -0.6528 -0.5538 -0.1394
-1.0491 -0.7018 -0.8289 3.1318 -0.7631 0.0980 -0.3447 1.3374

% Extract data for LVS strain in the lung (columns 31-54)


X_LVS_lung = X(:, 31:54)

X_LVS_lung = 37632×24
1.1820 2.1958 2.4848 -0.3488 0.1587 -0.1206 0.4327 -0.1981
1.9293 0.0545 0.3656 -0.1050 0.6631 0.3350 -0.7420 -0.0146
1.5883 3.4169 1.2189 -0.8081 -0.2364 -0.8081 -0.1791 -0.1845
-0.4445 -0.3914 -0.5045 -0.5683 0.0541 0.2145 -0.9411 -0.8723
0.0801 -0.0388 0.0315 0.3903 0.2256 4.5324 -0.7920 -0.8012
-0.1144 -0.1722 -0.3414 -0.6105 0.3428 0.6860 -0.9399 -0.8708
-0.3656 -0.5726 -0.6380 -0.6506 0.0658 -0.0325 -0.8801 -0.8011
-0.6887 -0.6763 -0.7026 -0.9405 -0.9783 -0.9938 0.7062 0.8699
0.0958 0.2425 0.0346 -0.7702 -0.7351 -0.7544 0.5100 0.5391
-0.4594 -0.0646 -0.7266 -1.2553 -0.1170 0.4002 -0.5740 -0.9889

% Extract data for Schu4 strain in the spleen (columns 61-84)


X_Schu4_spleen = X(:, 61:84)

X_Schu4_spleen = 37632×24
-0.0578 -0.2564 -0.4208 0.0672 0.6794 0.3910 -0.0316 -0.4312
-0.2816 0.0923 -0.1800 -0.3822 0.0852 -0.6248 4.0761 1.2702
-0.6472 -0.2161 -0.6195 -0.1414 1.7662 0.3976 0.3754 -0.5447
-0.7594 -0.8950 -0.6858 1.7786 0.9507 1.4818 0.1281 -0.8887
-0.8984 -0.8927 -0.8644 1.5897 0.3070 2.2959 0.6698 1.3377
-0.8686 -0.8816 -0.8006 1.1860 1.3072 2.2343 0.4079 0.2783
-0.8727 -0.8830 -0.7298 1.8628 2.2043 3.7278 1.4971 0.7229
0.6657 0.8473 0.5641 0.5813 0.6685 0.6288 0.2888 1.1695
-0.2353 -0.2848 -0.2444 -0.3442 -0.0940 -0.1869 -0.5990 -0.7662
1.3669 0.4207 0.4859 1.3734 1.5900 -0.1903 -0.7378 -1.3804

% Extract data for LVS strain in the spleen (columns 85-108)


X_LVS_spleen = X(:, 85:108)

X_LVS_spleen = 37632×24

11
-0.2528 -0.4472 0.0396 -0.2362 0.0457 -0.2971 0.5883 -0.5714
-0.3833 -0.3006 2.0846 -0.4859 0.0726 -0.6603 -0.5156 -0.4657
-0.8081 -0.6525 -0.6805 -0.1782 -0.1896 0.7384 -0.5175 -0.6423
1.0796 0.7357 -0.9561 0.7388 1.7381 0.9751 -0.9547 -0.9397
-0.8297 -0.8503 -0.8836 0.1976 0.1207 0.1560 -0.8324 -0.8195
-0.7337 -0.6412 -0.9022 0.2379 -0.2094 -0.0774 -0.8970 -0.8420
-0.0374 -0.1422 -0.8394 1.8616 0.8532 0.5260 -0.8611 -0.8905
0.2448 0.0410 0.0044 2.2524 2.9681 3.1897 0.3957 0.6109
-0.4773 -0.3047 -0.1662 0.4655 -0.1543 -0.1219 -0.4329 -0.3832
-1.0645 -0.8220 -0.8601 0.3356 -0.4941 -0.0146 -1.1069 -0.7945

% Compute the thin SVD for each dataset


[U_Schu4_lung, S_Schu4_lung, ~] = svd(X_Schu4_lung, 'econ')

U_Schu4_lung = 37632×24
0.0016 -0.0021 0.0007 0.0024 -0.0007 -0.0008 -0.0038 -0.0020
0.0110 -0.0022 -0.0025 0.0016 0.0044 0.0107 -0.0025 -0.0010
0.0085 0.0060 0.0010 0.0047 -0.0010 -0.0043 0.0093 -0.0059
-0.0004 0.0119 0.0105 -0.0019 0.0025 0.0007 0.0049 0.0041
0.0015 0.0015 0.0120 0.0033 -0.0009 -0.0021 0.0029 0.0090
0.0045 -0.0011 0.0110 0.0052 0.0020 0.0013 0.0013 0.0126
0.0017 0.0042 0.0058 0.0021 -0.0031 0.0019 -0.0006 0.0033
-0.0023 0.0105 0.0006 0.0010 -0.0014 0.0012 -0.0055 0.0007
-0.0014 0.0048 -0.0009 0.0002 0.0028 -0.0007 0.0047 0.0002
0.0029 0.0016 0.0064 0.0053 -0.0007 0.0078 -0.0060 0.0106

S_Schu4_lung = 24×24
526.4198 0 0 0 0 0 0 0
0 354.7288 0 0 0 0 0 0
0 0 316.9211 0 0 0 0 0
0 0 0 281.7616 0 0 0 0
0 0 0 0 239.9237 0 0 0
0 0 0 0 0 234.8084 0 0
0 0 0 0 0 0 211.0740 0
0 0 0 0 0 0 0 194.7623
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

[U_LVS_lung, S_LVS_lung, ~] = svd(X_LVS_lung, 'econ')

U_LVS_lung = 37632×24
-0.0050 -0.0021 0.0018 0.0034 0.0043 -0.0069 0.0113 0.0215
-0.0036 0.0078 -0.0047 -0.0004 0.0043 -0.0021 -0.0037 0.0040
-0.0044 0.0040 -0.0018 0.0137 0.0008 -0.0048 -0.0041 -0.0009
0.0036 0.0048 -0.0056 -0.0022 -0.0106 0.0075 -0.0026 -0.0014
0.0002 0.0041 -0.0118 0.0033 -0.0085 0.0024 0.0027 -0.0024
0.0014 0.0041 -0.0033 0.0032 -0.0009 0.0035 0.0033 -0.0062
0.0025 0.0043 -0.0005 -0.0006 0.0003 0.0039 0.0023 -0.0073
0.0037 0.0029 0.0081 0.0034 -0.0022 -0.0030 -0.0016 -0.0114
0.0001 -0.0021 -0.0029 -0.0055 -0.0087 0.0047 -0.0136 0.0081
0.0031 0.0055 -0.0019 -0.0057 -0.0012 0.0034 -0.0002 -0.0041

S_LVS_lung = 24×24
434.3284 0 0 0 0 0 0 0
0 387.9921 0 0 0 0 0 0
0 0 341.8586 0 0 0 0 0

12
0 0 0 289.6863 0 0 0 0
0 0 0 0 261.4647 0 0 0
0 0 0 0 0 250.7513 0 0
0 0 0 0 0 0 223.4269 0
0 0 0 0 0 0 0 202.4190
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

[U_Schu4_spleen, S_Schu4_spleen, ~] = svd(X_Schu4_spleen, 'econ')

U_Schu4_spleen = 37632×24
0.0014 0.0000 -0.0013 0.0029 -0.0047 -0.0027 -0.0033 0.0012
0.0019 -0.0016 -0.0129 -0.0058 0.0013 -0.0029 -0.0004 -0.0010
0.0031 0.0051 0.0002 0.0046 -0.0038 -0.0013 0.0062 0.0003
0.0038 0.0049 -0.0017 0.0098 -0.0042 -0.0015 -0.0089 0.0023
0.0039 0.0080 -0.0071 0.0049 -0.0039 -0.0023 -0.0062 0.0019
0.0056 0.0138 -0.0039 0.0096 -0.0000 0.0059 0.0061 0.0003
0.0055 0.0159 -0.0064 0.0029 -0.0046 -0.0065 -0.0054 0.0075
0.0046 0.0037 0.0002 -0.0002 0.0070 -0.0006 0.0008 0.0027
-0.0003 0.0009 0.0026 0.0028 -0.0054 -0.0008 0.0033 0.0009
0.0056 0.0035 0.0035 0.0084 0.0045 0.0005 -0.0015 0.0004

S_Schu4_spleen = 24×24
437.2913 0 0 0 0 0 0 0
0 342.8135 0 0 0 0 0 0
0 0 320.1022 0 0 0 0 0
0 0 0 268.4687 0 0 0 0
0 0 0 0 241.6363 0 0 0
0 0 0 0 0 196.3477 0 0
0 0 0 0 0 0 177.8048 0
0 0 0 0 0 0 0 159.3813
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

[U_LVS_spleen, S_LVS_spleen, ~] = svd(X_LVS_spleen, 'econ')

U_LVS_spleen = 37632×24
0.0004 0.0034 -0.0033 -0.0006 -0.0021 -0.0011 -0.0015 -0.0010
-0.0001 0.0047 -0.0027 -0.0015 -0.0003 0.0009 -0.0006 -0.0045
0.0011 0.0009 -0.0076 -0.0031 -0.0001 0.0025 -0.0012 0.0017
0.0055 -0.0037 -0.0010 -0.0084 0.0015 -0.0007 0.0016 -0.0116
0.0036 -0.0044 -0.0113 -0.0030 0.0002 -0.0023 -0.0018 0.0028
0.0042 -0.0070 -0.0098 -0.0009 0.0000 -0.0015 0.0012 -0.0027
0.0058 -0.0103 -0.0066 -0.0058 0.0084 0.0061 -0.0037 0.0015
0.0078 -0.0087 0.0069 -0.0134 -0.0004 -0.0049 -0.0000 0.0059
-0.0021 0.0008 -0.0020 -0.0019 0.0027 0.0003 -0.0025 0.0001
0.0023 -0.0149 -0.0055 0.0026 0.0032 -0.0049 0.0023 -0.0056

S_LVS_spleen = 24×24
508.4598 0 0 0 0 0 0 0
0 379.8258 0 0 0 0 0 0
0 0 268.6613 0 0 0 0 0
0 0 0 222.8783 0 0 0 0
0 0 0 0 203.9260 0 0 0
0 0 0 0 0 176.9306 0 0
0 0 0 0 0 0 161.0965 0
0 0 0 0 0 0 0 154.6256

13
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

% Extract singular values for each dataset


s_Schu4_lung = diag(S_Schu4_lung)

s_Schu4_lung = 24×1
526.4198
354.7288
316.9211
281.7616
239.9237
234.8084
211.0740
194.7623
186.0505
173.6665

s_LVS_lung = diag(S_LVS_lung)

s_LVS_lung = 24×1
434.3284
387.9921
341.8586
289.6863
261.4647
250.7513
223.4269
202.4190
191.3431
172.4755

s_Schu4_spleen = diag(S_Schu4_spleen)

s_Schu4_spleen = 24×1
437.2913
342.8135
320.1022
268.4687
241.6363
196.3477
177.8048
159.3813
149.1062
145.0955

s_LVS_spleen = diag(S_LVS_spleen)

s_LVS_spleen = 24×1
508.4598
379.8258
268.6613
222.8783

14
203.9260
176.9306
161.0965
154.6256
145.6324
139.1256

% Compute energy for each dataset


E_Schu4_lung = cumsum(s_Schu4_lung.^2) / sum(s_Schu4_lung.^2)

E_Schu4_lung = 24×1
0.2683
0.3901
0.4874
0.5642
0.6200
0.6734
0.7165
0.7532
0.7867
0.8159

E_LVS_lung = cumsum(s_LVS_lung.^2) / sum(s_LVS_lung.^2)

E_LVS_lung = 24×1
0.1844
0.3315
0.4458
0.5278
0.5946
0.6561
0.7049
0.7449
0.7807
0.8098

E_Schu4_spleen = cumsum(s_Schu4_spleen.^2) / sum(s_Schu4_spleen.^2)

E_Schu4_spleen = 24×1
0.2378
0.3840
0.5114
0.6011
0.6737
0.7217
0.7610
0.7926
0.8202
0.8464

E_LVS_spleen = cumsum(s_LVS_spleen.^2) / sum(s_LVS_spleen.^2)

E_LVS_spleen = 24×1

15
0.3260
0.5079
0.5989
0.6615
0.7139
0.7534
0.7861
0.8163
0.8430
0.8674

% Plot the energy curves for all datasets


figure
plot(1:length(E_Schu4_lung), E_Schu4_lung, 'b-', 'LineWidth', 2)
hold on
plot(1:length(E_LVS_lung), E_LVS_lung, 'r-', 'LineWidth', 2)
plot(1:length(E_Schu4_spleen), E_Schu4_spleen, 'g-', 'LineWidth', 2)
plot(1:length(E_LVS_spleen), E_LVS_spleen, 'm-', 'LineWidth', 2)
xlabel('Number of Dimensions (k)')
ylabel('Fraction of Total Energy Captured')
title('Energy Captured by Singular Values for Different Strains in Lung and Spleen')
legend('Schu4 in Lung', 'LVS in Lung', 'Schu4 in Spleen', 'LVS in Spleen')
grid on

% 6)
% Extract data for Shu4 spleen (columns 61-84)
X_Schu4_spleen = X(:, 61:84)

16
X_Schu4_spleen = 37632×24
-0.0578 -0.2564 -0.4208 0.0672 0.6794 0.3910 -0.0316 -0.4312
-0.2816 0.0923 -0.1800 -0.3822 0.0852 -0.6248 4.0761 1.2702
-0.6472 -0.2161 -0.6195 -0.1414 1.7662 0.3976 0.3754 -0.5447
-0.7594 -0.8950 -0.6858 1.7786 0.9507 1.4818 0.1281 -0.8887
-0.8984 -0.8927 -0.8644 1.5897 0.3070 2.2959 0.6698 1.3377
-0.8686 -0.8816 -0.8006 1.1860 1.3072 2.2343 0.4079 0.2783
-0.8727 -0.8830 -0.7298 1.8628 2.2043 3.7278 1.4971 0.7229
0.6657 0.8473 0.5641 0.5813 0.6685 0.6288 0.2888 1.1695
-0.2353 -0.2848 -0.2444 -0.3442 -0.0940 -0.1869 -0.5990 -0.7662
1.3669 0.4207 0.4859 1.3734 1.5900 -0.1903 -0.7378 -1.3804

% Extract data for Shu4 lung (columns 7-30)


X_Schu4_lung = X(:, 7:30)

X_Schu4_lung = 37632×24
-0.1106 -0.4488 -0.2462 1.0227 0.5201 0.1148 0.4345 0.3190
-0.2835 -0.4952 -0.1248 0.8545 0.6581 0.2829 1.1782 5.9283
-0.7119 0.0369 0.3124 0.0240 -0.2383 -0.8081 3.6026 2.9567
0.0857 0.4358 0.2377 -0.2504 -0.3249 -0.0884 -0.5779 -0.2263
0.1945 -0.0549 -0.3157 1.2722 0.8304 2.6143 0.7918 -0.4857
0.0826 -0.1007 -0.2181 2.5242 0.5068 3.8065 0.7344 1.2831
-0.3862 -0.4234 -0.5220 0.8718 -0.4737 0.5674 0.5036 0.1860
-0.9136 -0.8841 -0.8944 -1.0350 -1.0424 -1.0306 -0.8328 -0.6819
0.0849 0.3333 -0.0213 -0.6754 -0.5844 -0.6528 -0.5538 -0.1394
-1.0491 -0.7018 -0.8289 3.1318 -0.7631 0.0980 -0.3447 1.3374

% Compute the thin SVD for Shu4 spleen and Shu4 lung
[U1, ~, ~] = svd(X_Schu4_spleen, 'econ')

U1 = 37632×24
0.0014 0.0000 -0.0013 0.0029 -0.0047 -0.0027 -0.0033 0.0012
0.0019 -0.0016 -0.0129 -0.0058 0.0013 -0.0029 -0.0004 -0.0010
0.0031 0.0051 0.0002 0.0046 -0.0038 -0.0013 0.0062 0.0003
0.0038 0.0049 -0.0017 0.0098 -0.0042 -0.0015 -0.0089 0.0023
0.0039 0.0080 -0.0071 0.0049 -0.0039 -0.0023 -0.0062 0.0019
0.0056 0.0138 -0.0039 0.0096 -0.0000 0.0059 0.0061 0.0003
0.0055 0.0159 -0.0064 0.0029 -0.0046 -0.0065 -0.0054 0.0075
0.0046 0.0037 0.0002 -0.0002 0.0070 -0.0006 0.0008 0.0027
-0.0003 0.0009 0.0026 0.0028 -0.0054 -0.0008 0.0033 0.0009
0.0056 0.0035 0.0035 0.0084 0.0045 0.0005 -0.0015 0.0004

[U2, ~, ~] = svd(X_Schu4_lung, 'econ')

U2 = 37632×24
0.0016 -0.0021 0.0007 0.0024 -0.0007 -0.0008 -0.0038 -0.0020
0.0110 -0.0022 -0.0025 0.0016 0.0044 0.0107 -0.0025 -0.0010
0.0085 0.0060 0.0010 0.0047 -0.0010 -0.0043 0.0093 -0.0059
-0.0004 0.0119 0.0105 -0.0019 0.0025 0.0007 0.0049 0.0041
0.0015 0.0015 0.0120 0.0033 -0.0009 -0.0021 0.0029 0.0090
0.0045 -0.0011 0.0110 0.0052 0.0020 0.0013 0.0013 0.0126
0.0017 0.0042 0.0058 0.0021 -0.0031 0.0019 -0.0006 0.0033
-0.0023 0.0105 0.0006 0.0010 -0.0014 0.0012 -0.0055 0.0007
-0.0014 0.0048 -0.0009 0.0002 0.0028 -0.0007 0.0047 0.0002

17
0.0029 0.0016 0.0064 0.0053 -0.0007 0.0078 -0.0060 0.0106

% Extract data for LVS spleen (columns 85-108)


X_LVS_spleen = X(:, 85:108)

X_LVS_spleen = 37632×24
-0.2528 -0.4472 0.0396 -0.2362 0.0457 -0.2971 0.5883 -0.5714
-0.3833 -0.3006 2.0846 -0.4859 0.0726 -0.6603 -0.5156 -0.4657
-0.8081 -0.6525 -0.6805 -0.1782 -0.1896 0.7384 -0.5175 -0.6423
1.0796 0.7357 -0.9561 0.7388 1.7381 0.9751 -0.9547 -0.9397
-0.8297 -0.8503 -0.8836 0.1976 0.1207 0.1560 -0.8324 -0.8195
-0.7337 -0.6412 -0.9022 0.2379 -0.2094 -0.0774 -0.8970 -0.8420
-0.0374 -0.1422 -0.8394 1.8616 0.8532 0.5260 -0.8611 -0.8905
0.2448 0.0410 0.0044 2.2524 2.9681 3.1897 0.3957 0.6109
-0.4773 -0.3047 -0.1662 0.4655 -0.1543 -0.1219 -0.4329 -0.3832
-1.0645 -0.8220 -0.8601 0.3356 -0.4941 -0.0146 -1.1069 -0.7945

% Project LVS spleen data onto U1 and U2


X_LVS_spleen_projected_U1 = U1 * (U1' * X_LVS_spleen)

X_LVS_spleen_projected_U1 = 37632×24
-0.2270 -0.2751 -0.1949 0.0768 0.0357 0.0442 -0.2245 -0.2375
-0.0981 -0.3211 -0.3808 -0.4686 -0.4108 -0.3241 -0.2650 -0.3685
-0.4006 -0.4406 -0.4865 -0.1031 -0.1604 -0.0293 -0.1613 -0.3478
-0.6939 -0.7475 -0.5546 0.3800 0.1713 0.1404 -0.6697 -0.6361
-0.7013 -0.8107 -0.6563 0.1825 0.1588 0.1083 -0.5631 -0.6212
-0.7004 -0.7997 -0.6202 0.3883 0.5114 0.4215 -0.4617 -0.6809
-0.7609 -0.9615 -0.7349 0.2915 0.5310 0.4458 -0.3736 -0.7012
0.3233 0.3548 0.2273 0.2895 0.4898 0.4293 0.1441 0.1742
-0.2861 -0.2084 -0.1153 0.0667 -0.1189 -0.0884 -0.1809 -0.1770
-0.1981 -0.0205 -0.0194 0.6111 0.4071 0.3848 -0.3012 -0.2993

X_LVS_spleen_projected_U2 = U2 * (U2' * X_LVS_spleen)

X_LVS_spleen_projected_U2 = 37632×24
-0.1550 -0.1300 -0.1170 -0.1444 -0.2098 -0.1937 -0.1752 -0.0983
-0.3498 -0.4312 -0.3176 -0.1954 -0.3050 -0.2569 -0.3967 -0.4162
-0.6617 -0.9180 -0.6695 0.4937 0.2548 0.2576 -0.5228 -0.6772
-0.0938 -0.2152 -0.2784 0.8547 0.6933 0.6128 -0.5082 -0.5335
-0.4645 -0.4469 -0.5418 0.1101 0.0249 0.0575 -0.6754 -0.6090
-0.6713 -0.6773 -0.6855 0.1409 -0.1758 -0.1254 -0.8529 -0.8200
-0.0893 -0.1043 -0.1901 0.4498 0.3203 0.2902 -0.3841 -0.3517
0.4888 0.4560 0.2972 0.4845 0.6898 0.5895 0.1478 0.1691
-0.1196 -0.0516 0.0065 0.2711 0.2390 0.2384 -0.0018 0.0187
-0.3116 -0.0685 -0.1305 0.4554 0.1284 0.1403 -0.5751 -0.4197

% Compute residuals (novelties) directly


residuals_U1 = vecnorm(X_LVS_spleen - X_LVS_spleen_projected_U1)

residuals_U1 = 1×24

18
117.5253 108.8062 139.8699 156.3915 151.9369 138.3518 110.8530 148.3456

residuals_U2 = vecnorm(X_LVS_spleen - X_LVS_spleen_projected_U2)

residuals_U2 = 1×24
123.4700 113.8516 143.5348 146.7116 145.5200 129.6979 114.0325 147.6373

% Plot a histogram of novelties


figure
histogram(residuals_U1, 'BinWidth', 0.1, 'FaceColor', 'b', 'EdgeColor', 'k',
'Normalization', 'probability');
hold on
histogram(residuals_U2, 'BinWidth', 0.1, 'FaceColor', 'r', 'EdgeColor', 'k',
'Normalization', 'probability');
xlabel('Novelty')
ylabel('Probability')
title('Histogram of Novelties for LVS Spleen Data using U1 and U2')
legend('U1', 'U2')

% 7)
% Extract data for infected spleen samples (positive class C+)
X_Cplus = X(:, 85:108)

X_Cplus = 37632×24
-0.2528 -0.4472 0.0396 -0.2362 0.0457 -0.2971 0.5883 -0.5714
-0.3833 -0.3006 2.0846 -0.4859 0.0726 -0.6603 -0.5156 -0.4657
-0.8081 -0.6525 -0.6805 -0.1782 -0.1896 0.7384 -0.5175 -0.6423
1.0796 0.7357 -0.9561 0.7388 1.7381 0.9751 -0.9547 -0.9397
-0.8297 -0.8503 -0.8836 0.1976 0.1207 0.1560 -0.8324 -0.8195

19
-0.7337 -0.6412 -0.9022 0.2379 -0.2094 -0.0774 -0.8970 -0.8420
-0.0374 -0.1422 -0.8394 1.8616 0.8532 0.5260 -0.8611 -0.8905
0.2448 0.0410 0.0044 2.2524 2.9681 3.1897 0.3957 0.6109
-0.4773 -0.3047 -0.1662 0.4655 -0.1543 -0.1219 -0.4329 -0.3832
-1.0645 -0.8220 -0.8601 0.3356 -0.4941 -0.0146 -1.1069 -0.7945

% Extract data for control samples from spleen (negative class C-)
X_Cminus = X(:, 1:6)

X_Cminus = 37632×6
-0.1262 0.6718 0.9256 -0.3997 -0.4850 -0.3946
-0.4449 -0.0562 -0.7427 0.4412 0.2514 -0.1950
-0.0413 1.3056 0.2338 -0.5930 -0.6999 -0.8635
-0.0638 -0.1344 -0.3212 0.5342 1.3963 2.1722
-0.0696 0.0199 -0.2363 -0.0283 -0.0228 0.0155
-0.0960 -0.4143 -0.3861 0.0445 -0.0293 -0.1553
0.3171 -0.5630 -0.6598 -0.5625 -0.5603 -0.5517
-0.9495 -0.9899 -0.9873 -1.0280 -1.0302 -1.0248
0.0452 -0.2455 -0.0498 -0.7500 -0.7498 -0.7611
-0.5620 -0.7877 -0.5814 -0.3794 -0.3706 -0.1221

% Combine the data for FDA analysis


X_fda = [X_Cplus, X_Cminus]

X_fda = 37632×30
-0.2528 -0.4472 0.0396 -0.2362 0.0457 -0.2971 0.5883 -0.5714
-0.3833 -0.3006 2.0846 -0.4859 0.0726 -0.6603 -0.5156 -0.4657
-0.8081 -0.6525 -0.6805 -0.1782 -0.1896 0.7384 -0.5175 -0.6423
1.0796 0.7357 -0.9561 0.7388 1.7381 0.9751 -0.9547 -0.9397
-0.8297 -0.8503 -0.8836 0.1976 0.1207 0.1560 -0.8324 -0.8195
-0.7337 -0.6412 -0.9022 0.2379 -0.2094 -0.0774 -0.8970 -0.8420
-0.0374 -0.1422 -0.8394 1.8616 0.8532 0.5260 -0.8611 -0.8905
0.2448 0.0410 0.0044 2.2524 2.9681 3.1897 0.3957 0.6109
-0.4773 -0.3047 -0.1662 0.4655 -0.1543 -0.1219 -0.4329 -0.3832
-1.0645 -0.8220 -0.8601 0.3356 -0.4941 -0.0146 -1.1069 -0.7945

% Compute the Thin SVD


[U, S, V] = svd(X_fda, 'econ')

U = 37632×30
-0.0003 0.0033 0.0015 0.0033 0.0027 -0.0039 0.0017 -0.0007
0.0000 0.0033 -0.0028 -0.0016 0.0039 -0.0026 -0.0005 -0.0016
0.0003 0.0018 0.0056 0.0023 0.0043 -0.0057 -0.0011 -0.0059
0.0056 -0.0001 0.0037 -0.0097 -0.0057 -0.0017 -0.0017 0.0049
0.0034 -0.0019 0.0085 -0.0036 0.0068 -0.0055 -0.0013 -0.0001
0.0044 -0.0043 0.0087 -0.0035 0.0059 -0.0023 -0.0006 0.0012
0.0058 -0.0071 0.0102 -0.0024 -0.0001 -0.0028 -0.0093 -0.0084
0.0085 -0.0083 0.0011 0.0023 -0.0105 -0.0137 -0.0026 -0.0013
-0.0021 -0.0006 -0.0002 0.0024 0.0024 -0.0043 -0.0037 -0.0035
0.0033 -0.0122 0.0090 -0.0028 0.0032 0.0022 -0.0028 0.0066

20
S = 30×30
522.0680 0 0 0 0 0 0 0
0 411.2188 0 0 0 0 0 0
0 0 313.7568 0 0 0 0 0
0 0 0 278.9185 0 0 0 0
0 0 0 0 243.5938 0 0 0
0 0 0 0 0 206.7620 0 0
0 0 0 0 0 0 204.4954 0
0 0 0 0 0 0 0 169.7746
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

V = 30×30
0.1029 0.0778 -0.1473 0.0610 -0.2861 0.0747 -0.0322 0.1427
0.0939 0.0286 -0.1530 0.0619 -0.2943 0.1528 0.0037 0.1026
0.0987 0.0321 -0.1748 0.0662 -0.2985 0.0357 -0.0062 0.0733
0.0963 -0.0319 -0.0110 -0.1049 -0.3349 -0.3221 -0.2640 -0.2008
0.1724 -0.0079 -0.0346 -0.0774 -0.3638 -0.3616 -0.1237 -0.0626
0.1456 -0.0145 -0.0287 -0.0791 -0.3289 -0.3066 -0.1226 -0.0740
0.0929 0.0133 -0.1691 0.1662 -0.0904 0.0802 0.2282 -0.0285
0.0698 -0.0301 -0.1909 0.1807 -0.1432 0.2406 0.2959 -0.1876
0.0854 -0.0318 -0.1683 0.1403 -0.1523 0.1706 0.2619 -0.1169
0.2156 -0.2387 0.1694 0.0300 -0.0078 -0.0828 0.1609 0.3702

% Extract the optimal FDA projection vector


V_FDA = U(:, 1)

V_FDA = 37632×1
-0.0003
0.0000
0.0003
0.0056
0.0034
0.0044
0.0058
0.0085
-0.0021
0.0033

% Project the data onto the optimal FDA vector


A_FDA = S(1, 1) * V_FDA'

A_FDA = 1×37632
-0.1636 0.0179 0.1584 2.9348 1.7932 2.2784 3.0445 4.4426

% Plot the projections


figure
scatter(A_FDA(1, 1:24), zeros(24, 1), 'r', 'filled', 'DisplayName', 'Infected
Spleen Samples (C+)')
hold on
scatter(A_FDA(1, 25:30), zeros(6, 1), 'b', 'filled', 'DisplayName', 'Control Spleen
Samples (C-)')

21
xlabel('FDA Projection')
ylabel('Class')
title('FDA Projections of Infected Spleen and Control Spleen Samples')
legend

% 8)
% Extract data for infected spleen samples (positive class C+)
X_Cplus = X(:, 85:108)

X_Cplus = 37632×24
-0.2528 -0.4472 0.0396 -0.2362 0.0457 -0.2971 0.5883 -0.5714
-0.3833 -0.3006 2.0846 -0.4859 0.0726 -0.6603 -0.5156 -0.4657
-0.8081 -0.6525 -0.6805 -0.1782 -0.1896 0.7384 -0.5175 -0.6423
1.0796 0.7357 -0.9561 0.7388 1.7381 0.9751 -0.9547 -0.9397
-0.8297 -0.8503 -0.8836 0.1976 0.1207 0.1560 -0.8324 -0.8195
-0.7337 -0.6412 -0.9022 0.2379 -0.2094 -0.0774 -0.8970 -0.8420
-0.0374 -0.1422 -0.8394 1.8616 0.8532 0.5260 -0.8611 -0.8905
0.2448 0.0410 0.0044 2.2524 2.9681 3.1897 0.3957 0.6109
-0.4773 -0.3047 -0.1662 0.4655 -0.1543 -0.1219 -0.4329 -0.3832
-1.0645 -0.8220 -0.8601 0.3356 -0.4941 -0.0146 -1.1069 -0.7945

% Extract data for control samples from spleen (negative class C-)
X_Cminus = X(:, 1:6)

X_Cminus = 37632×6
-0.1262 0.6718 0.9256 -0.3997 -0.4850 -0.3946
-0.4449 -0.0562 -0.7427 0.4412 0.2514 -0.1950
-0.0413 1.3056 0.2338 -0.5930 -0.6999 -0.8635
-0.0638 -0.1344 -0.3212 0.5342 1.3963 2.1722
-0.0696 0.0199 -0.2363 -0.0283 -0.0228 0.0155

22
-0.0960 -0.4143 -0.3861 0.0445 -0.0293 -0.1553
0.3171 -0.5630 -0.6598 -0.5625 -0.5603 -0.5517
-0.9495 -0.9899 -0.9873 -1.0280 -1.0302 -1.0248
0.0452 -0.2455 -0.0498 -0.7500 -0.7498 -0.7611
-0.5620 -0.7877 -0.5814 -0.3794 -0.3706 -0.1221

% Combine the data for visualization


X_visualization = [X_Cplus, X_Cminus]

X_visualization = 37632×30
-0.2528 -0.4472 0.0396 -0.2362 0.0457 -0.2971 0.5883 -0.5714
-0.3833 -0.3006 2.0846 -0.4859 0.0726 -0.6603 -0.5156 -0.4657
-0.8081 -0.6525 -0.6805 -0.1782 -0.1896 0.7384 -0.5175 -0.6423
1.0796 0.7357 -0.9561 0.7388 1.7381 0.9751 -0.9547 -0.9397
-0.8297 -0.8503 -0.8836 0.1976 0.1207 0.1560 -0.8324 -0.8195
-0.7337 -0.6412 -0.9022 0.2379 -0.2094 -0.0774 -0.8970 -0.8420
-0.0374 -0.1422 -0.8394 1.8616 0.8532 0.5260 -0.8611 -0.8905
0.2448 0.0410 0.0044 2.2524 2.9681 3.1897 0.3957 0.6109
-0.4773 -0.3047 -0.1662 0.4655 -0.1543 -0.1219 -0.4329 -0.3832
-1.0645 -0.8220 -0.8601 0.3356 -0.4941 -0.0146 -1.1069 -0.7945

% Normalize the data row-wise


X_normalized = (X_visualization - mean(X_visualization, 2)) ./ std(X_visualization,
0, 2)

X_normalized = 37632×30
-0.0916 -0.5891 0.6571 -0.0491 0.6728 -0.2049 2.0618 -0.9072
-0.1494 -0.0061 4.1285 -0.3272 0.6409 -0.6295 -0.3787 -0.2922
-1.0094 -0.6840 -0.7427 0.3074 0.2837 2.2238 -0.4019 -0.6629
0.8666 0.5088 -1.2518 0.5120 1.5519 0.7579 -1.2503 -1.2348
-0.8260 -0.8545 -0.9002 0.5866 0.4809 0.5294 -0.8298 -0.8121
-0.7503 -0.6385 -0.9540 0.4242 -0.1165 0.0431 -0.9477 -0.8813
-0.1031 -0.1943 -0.8010 1.5492 0.6718 0.3871 -0.8199 -0.8454
-0.1415 -0.3033 -0.3324 1.4531 2.0215 2.1976 -0.0216 0.1493
-0.8695 -0.3592 0.0504 1.9179 0.0856 0.1812 -0.7382 -0.5912
-1.1185 -0.9145 -0.9466 0.0596 -0.6385 -0.2351 -1.1542 -0.8913

% Plot heatmap
figure;
imagesc(X_normalized);
colormap('jet');
colorbar;
xlabel('Samples');
ylabel('Genes');
title('Heatmap of F. tularensis Gene Expression Data');

23
24

You might also like