%combine all data tables
cd 10
cd 1
a1=readtable('cav1_to_cav1(ryr1).csv')
b1=readtable('nrx_to_nrx(cav1).csv')
c1=readtable('cav1_to_nrx.csv')
d1=readtable('ryr1_to_cav1.csv')
e1=readtable('nrx_to_cav1.csv')
f1=readtable('cav1_to_cav1(nrx).csv')
g1=readtable('nrx_to_ryr.csv')
h1=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 2
a2=readtable('cav1_to_cav1(ryr1).csv')
b2=readtable('nrx_to_nrx(cav1).csv')
c2=readtable('cav1_to_nrx.csv')
d2=readtable('ryr1_to_cav1.csv')
e2=readtable('nrx_to_cav1.csv')
f2=readtable('cav1_to_cav1(nrx).csv')
g2=readtable('nrx_to_ryr.csv')
h2=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 3
a3=readtable('cav1_to_cav1(ryr1).csv')
b3=readtable('nrx_to_nrx(cav1).csv')
c3=readtable('cav1_to_nrx.csv')
d3=readtable('ryr1_to_cav1.csv')
e3=readtable('nrx_to_cav1.csv')
f3=readtable('cav1_to_cav1(nrx).csv')
g3=readtable('nrx_to_ryr.csv')
h3=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 4
a4=readtable('cav1_to_cav1(ryr1).csv')
b4=readtable('nrx_to_nrx(cav1).csv')
c4=readtable('cav1_to_nrx.csv')
d4=readtable('ryr1_to_cav1.csv')
e4=readtable('nrx_to_cav1.csv')
f4=readtable('cav1_to_cav1(nrx).csv')
g4=readtable('nrx_to_ryr.csv')
h4=readtable('nrx_to_nrx(ryr).csv')
cd ..
%cd 5
%a5=readtable('cav1_to_cav1(ryr1).csv')
%b5=readtable('nrx_to_nrx(cav1).csv')
%c5=readtable('cav1_to_nrx.csv')
%d5=readtable('ryr1_to_cav1.csv')
%e5=readtable('nrx_to_cav1.csv')
%f5=readtable('cav1_to_cav1(nrx).csv')
%g5=readtable('nrx_to_ryr.csv')
%h5=readtable('nrx_to_nrx(ryr).csv')
%cd ..
cd ..
%%%%%%%%%%%%%%%%%%
cd 35
cd 1
a6=readtable('cav1_to_cav1(ryr1).csv')
b6=readtable('nrx_to_nrx(cav1).csv')
c6=readtable('cav1_to_nrx.csv')
d6=readtable('ryr1_to_cav1.csv')
e6=readtable('nrx_to_cav1.csv')
f6=readtable('cav1_to_cav1(nrx).csv')
g6=readtable('nrx_to_ryr.csv')
h6=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 2
a7=readtable('cav1_to_cav1(ryr1).csv')
b7=readtable('nrx_to_nrx(cav1).csv')
c7=readtable('cav1_to_nrx.csv')
d7=readtable('ryr1_to_cav1.csv')
e7=readtable('nrx_to_cav1.csv')
f7=readtable('cav1_to_cav1(nrx).csv')
g7=readtable('nrx_to_ryr.csv')
h7=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 3
a8=readtable('cav1_to_cav1(ryr1).csv')
b8=readtable('nrx_to_nrx(cav1).csv')
c8=readtable('cav1_to_nrx.csv')
d8=readtable('ryr1_to_cav1.csv')
e8=readtable('nrx_to_cav1.csv')
f8=readtable('cav1_to_cav1(nrx).csv')
g8=readtable('nrx_to_ryr.csv')
h8=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 4
a9=readtable('cav1_to_cav1(ryr1).csv')
b9=readtable('nrx_to_nrx(cav1).csv')
c9=readtable('cav1_to_nrx.csv')
d9=readtable('ryr1_to_cav1.csv')
e9=readtable('nrx_to_cav1.csv')
f9=readtable('cav1_to_cav1(nrx).csv')
g9=readtable('nrx_to_ryr.csv')
h9=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 5
a10=readtable('cav1_to_cav1(ryr1).csv')
b10=readtable('nrx_to_nrx(cav1).csv')
c10=readtable('cav1_to_nrx.csv')
d10=readtable('ryr1_to_cav1.csv')
e10=readtable('nrx_to_cav1.csv')
f10=readtable('cav1_to_cav1(nrx).csv')
g10=readtable('nrx_to_ryr.csv')
h10=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd ..
%%%%%%%%%%%%%%%%%%%%%%
cd 4
cd 1
a11=readtable('cav1_to_cav1(ryr1).csv')
b11=readtable('nrx_to_nrx(cav1).csv')
c11=readtable('cav1_to_nrx.csv')
d11=readtable('ryr1_to_cav1.csv')
e11=readtable('nrx_to_cav1.csv')
f11=readtable('cav1_to_cav1(nrx).csv')
g11=readtable('nrx_to_ryr.csv')
h11=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 2
a12=readtable('cav1_to_cav1(ryr1).csv')
b12=readtable('nrx_to_nrx(cav1).csv')
c12=readtable('cav1_to_nrx.csv')
d12=readtable('ryr1_to_cav1.csv')
e12=readtable('nrx_to_cav1.csv')
f12=readtable('cav1_to_cav1(nrx).csv')
g12=readtable('nrx_to_ryr.csv')
h12=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 3
a13=readtable('cav1_to_cav1(ryr1).csv')
b13=readtable('nrx_to_nrx(cav1).csv')
c13=readtable('cav1_to_nrx.csv')
d13=readtable('ryr1_to_cav1.csv')
e13=readtable('nrx_to_cav1.csv')
f13=readtable('cav1_to_cav1(nrx).csv')
g13=readtable('nrx_to_ryr.csv')
h13=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 4
a14=readtable('cav1_to_cav1(ryr1).csv')
b14=readtable('nrx_to_nrx(cav1).csv')
c14=readtable('cav1_to_nrx.csv')
d14=readtable('ryr1_to_cav1.csv')
e14=readtable('nrx_to_cav1.csv')
f14=readtable('cav1_to_cav1(nrx).csv')
g14=readtable('nrx_to_ryr.csv')
h14=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 5
a15=readtable('cav1_to_cav1(ryr1).csv')
b15=readtable('nrx_to_nrx(cav1).csv')
c15=readtable('cav1_to_nrx.csv')
d15=readtable('ryr1_to_cav1.csv')
e15=readtable('nrx_to_cav1.csv')
f15=readtable('cav1_to_cav1(nrx).csv')
g15=readtable('nrx_to_ryr.csv')
h15=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 6
a5=readtable('cav1_to_cav1(ryr1).csv')
b5=readtable('nrx_to_nrx(cav1).csv')
c5=readtable('cav1_to_nrx.csv')
d5=readtable('ryr1_to_cav1.csv')
e5=readtable('nrx_to_cav1.csv')
f5=readtable('cav1_to_cav1(nrx).csv')
g5=readtable('nrx_to_ryr.csv')
h5=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd ..
cd 8
cd 1
a16=readtable('cav1_to_cav1(ryr1).csv')
b16=readtable('nrx_to_nrx(cav1).csv')
c16=readtable('cav1_to_nrx.csv')
d16=readtable('ryr1_to_cav1.csv')
e16=readtable('nrx_to_cav1.csv')
f16=readtable('cav1_to_cav1(nrx).csv')
g16=readtable('nrx_to_ryr.csv')
h16=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 2
a17=readtable('cav1_to_cav1(ryr1).csv')
b17=readtable('nrx_to_nrx(cav1).csv')
c17=readtable('cav1_to_nrx.csv')
d17=readtable('ryr1_to_cav1.csv')
e17=readtable('nrx_to_cav1.csv')
f17=readtable('cav1_to_cav1(nrx).csv')
g17=readtable('nrx_to_ryr.csv')
h17=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 3
a18=readtable('cav1_to_cav1(ryr1).csv')
b18=readtable('nrx_to_nrx(cav1).csv')
c18=readtable('cav1_to_nrx.csv')
d18=readtable('ryr1_to_cav1.csv')
e18=readtable('nrx_to_cav1.csv')
f18=readtable('cav1_to_cav1(nrx).csv')
g18=readtable('nrx_to_ryr.csv')
h18=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 4
a19=readtable('cav1_to_cav1(ryr1).csv')
b19=readtable('nrx_to_nrx(cav1).csv')
c19=readtable('cav1_to_nrx.csv')
d19=readtable('ryr1_to_cav1.csv')
e19=readtable('nrx_to_cav1.csv')
f19=readtable('cav1_to_cav1(nrx).csv')
g19=readtable('nrx_to_ryr.csv')
h19=readtable('nrx_to_nrx(ryr).csv')
cd ..
cd 5
a20=readtable('cav1_to_cav1(ryr1).csv')
b20=readtable('nrx_to_nrx(cav1).csv')
c20=readtable('cav1_to_nrx.csv')
d20=readtable('ryr1_to_cav1.csv')
e20=readtable('nrx_to_cav1.csv')
f20=readtable('cav1_to_cav1(nrx).csv')
g20=readtable('nrx_to_ryr.csv')
h20=readtable('nrx_to_nrx(ryr).csv')
cd ..
% cd 2
% a21=readtable('cav1_to_cav1(ryr1).csv')
% b21=readtable('nrx_to_nrx(cav1).csv')
% c21=readtable('cav1_to_nrx.csv')
% d21=readtable('ryr1_to_cav1.csv')
% e21=readtable('nrx_to_cav1.csv')
% f21=readtable('cav1_to_cav1(nrx).csv')
% g21=readtable('nrx_to_ryr.csv')
% h21=readtable('nrx_to_nrx(ryr).csv')
% cd ..
% cd 3
% a22=readtable('cav1_to_cav1(ryr1).csv')
% b22=readtable('nrx_to_nrx(cav1).csv')
% c22=readtable('cav1_to_nrx.csv')
% d22=readtable('ryr1_to_cav1.csv')
% e22=readtable('nrx_to_cav1.csv')
% f22=readtable('cav1_to_cav1(nrx).csv')
% g22=readtable('nrx_to_ryr.csv')
% h22=readtable('nrx_to_nrx(ryr).csv')
% cd ..
% cd 4
% a23=readtable('cav1_to_cav1(ryr1).csv')
% b23=readtable('nrx_to_nrx(cav1).csv')
% c23=readtable('cav1_to_nrx.csv')
% d23=readtable('ryr1_to_cav1.csv')
% e23=readtable('nrx_to_cav1.csv')
% f23=readtable('cav1_to_cav1(nrx).csv')
% g23=readtable('nrx_to_ryr.csv')
% h23=readtable('nrx_to_nrx(ryr).csv')
% cd ..
% cd 5
% a24=readtable('cav1_to_cav1(ryr1).csv')
% b24=readtable('nrx_to_nrx(cav1).csv')
% c24=readtable('cav1_to_nrx.csv')
% d24=readtable('ryr1_to_cav1.csv')
% e24=readtable('nrx_to_cav1.csv')
% f24=readtable('cav1_to_cav1(nrx).csv')
% g24=readtable('nrx_to_ryr.csv')
% h24=readtable('nrx_to_nrx(ryr).csv')
% cd ..

%%%%%%%%%%%%%%%%%%%%%%
a = [a1; a2; a3; a4; a5; a6; a7; a8; a9; a11; a12; a13; a14; a15; a16; a17; a18; a19; a20]
b = [b1; b2; b3; b4; b5; b6; b7; b8; b9; b11; b12; b13; b14; b15; b16; b17; b18; b19; b20]
c = [c1; c2; c3; c4; c5; c6; c7; c8; c9; c11; c12; c13; c14; c15; c16; c17; c18; c19; c20]
d = [d1; d2; d3; d4; d5; d6; d7; d8; d9; d11; d12; d13; d14; d15; d16; d17; d18; d19; d20]
e = [e1; e2; e3; e4; e5; e6; e7; e8; e9; e11; e12; e13; e14; e15; e16; e17; e18; e19; e20]
f = [f1; f2; f3; f4; f5; f6; f7; f8; f9; f11; f12; f13; f14; f15; f16; f17; f18; f19; f20]
g = [g1; g2; g3; g4; g5; g6; g7; g8; g9; g11; g12; g13; g14; g15; g16; g17; g18; g19; g20]
h = [h1; h2; h3; h4; h5; h6; h7; h8; h9; h11; h12; h13; h14; h15; h16; h17; h18; h19; h20]

figure; hold on;
histogram(a.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33, 'FaceColor','#ffff00')
histogram(d.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33, 'FaceColor','#ffa64d')
title('RyR to CaV1')
set(gca,'Color','k')
hold off

figure; hold on;
histogram(b.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33,'FaceColor','#00FFFF')
histogram(c.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33,'FaceColor','#ffff00')
title('CaV1 to ELKS')
set(gca,'Color','k')
hold off

figure; hold on;
histogram(e.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33,'FaceColor','#00FFFF')
histogram(f.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33,'FaceColor','#ffff00')
title('ELKS to CaV1')
set(gca,'Color','k')
hold off

figure; hold on;
histogram(g.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33,'FaceColor','#00FFFF')
histogram(h.Var1,'Normalization','probability','BinLimits',[-700,700],'BinWidth',33,'FaceColor','#ffa64d')
title('RyR to NRX')
set(gca,'Color','k')
hold off