-
Notifications
You must be signed in to change notification settings - Fork 0
/
Figure1.m
104 lines (94 loc) · 2.74 KB
/
Figure1.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
function [mol_parasite, mol_rbc, mol_uninfected, plot_mat ] = Figure1( parasite, rbc, uninfected, names, species )
% parasite=DD2f_p_;
% rbc=DD2f_R_;
% uninfected=uninf;
% names=DD2f_names;
groups=cell2mat(names(:,2));
unique_=unique(groups);
cmap=[255/255 51/255 51/255; 0/255 204/255 102/255; 204/255 0/255 204/255];
L_=length(unique_);
[r,c]=size(parasite);
mat=parasite;
mol_parasite=zeros(L_,c);
sum_mat=sum(parasite);
%find the mol%time for each lipid group
for k=1:length(unique_);
indx=find(groups==unique_(k));
mat_=mat(indx,:);
mat_species=sum(mat_);
for j=1:c
mol_parasite(k,j)=mat_species(1,j)/sum_mat(1,j);
end
end
[r,c]=size(rbc);
mat=rbc;
mol_rbc=zeros(L_,c);
sum_mat=sum(rbc);
%find the mol%time for each lipid group
for k=1:length(unique_);
indx=find(groups==unique_(k));
mat_=mat(indx,:);
mat_species=sum(mat_);
for j=1:c
mol_rbc(k,j)=mat_species(1,j)/sum_mat(1,j);
end
end
[r,c]=size(uninfected);
mat=uninfected;
mol_uninfected=zeros(L_,c);
sum_mat=sum(uninfected);
%find the mol%time for each lipid group
for k=1:length(unique_);
indx=find(groups==unique_(k));
mat_=mat(indx,:);
mat_species=sum(mat_);
for j=1:c
mol_uninfected(k,j)=mat_species(1,j)/sum_mat(1,j);
end
end
plot_mat=zeros(L_,24);
plot_std=NaN(L_,24);
for k=1:length(unique_);
label=species(k,2);
c=1;
d=1;
for j=1:6
plot_mat(k,c)=mean(mol_uninfected(k,:))*100;
std_dev=std(mol_uninfected(k,:));
plot_std(k,c)=(std_dev/sqrt(3))*100;
c=c+1;
plot_mat(k,c)=mean(mol_rbc(k,d:d+8))*100;
std_dev=std(mol_rbc(k,d:d+8));
plot_std(k,c)=(std_dev/sqrt(9))*100;
c=c+1;
plot_mat(k,c)=mean(mol_parasite(k,d:d+8))*100;
std_dev=std(mol_parasite(k,d:d+8));
plot_std(k,c)=(std_dev/sqrt(9))*100;
c=c+2;
d=d+9;
end
bar_color=[-1 0 1 0 -1 0 1 0 -1 0 1 0 -1 0 1 0 -1 0 1 0 -1 0 1 0];
bh=bar(plot_mat(k,:), 1);
applyhatch(gcf,'\-x.');
title(label);
hold on
c=1;
% for j=1:6
errorbar (plot_mat(k,:), plot_std(k,:), '.k', 'MarkerSize', 2);
% c=c+4;
% end
hold off
k_str=num2str(k);
ch=get(bh,'Children');
set (ch,'CData',bar_color) ;
colormap (cmap);
%x_label={'C', 'R', 'P', [], 'C', 'R', 'P', [], 'C', 'R', 'P', [], 'C', 'R', 'P', [], 'C', 'R', 'P', [], 'C', 'R', 'P', []};
x_label= {[],'8',[],[],[],'16',[],[],[],'24',[],[],[],'32',[],[],[],'40',[],[],[],'48',[],[]};
set(gca, 'XTick', [1:24]);
set (gca, 'XTickLabel',x_label);
xlim([0 25]);
ylabel('Mol % of Total Lipids Measured');
print (gcf, '-dpng', [k_str 'figure1_bar.png']);
close all
end
end