Skip to content
Snippets Groups Projects
Commit b2edec45 authored by Mark Winter's avatar Mark Winter
Browse files

Stats results export and plotting updates

parent 9bbdb111
Branches
No related tags found
No related merge requests found
......@@ -8,5 +8,7 @@ size_tbl = readtable('ecto_size_stats_bb94.csv');
fid = fopen('mmpl_sigs.csv', 'wt');
%% Write size comparison
sum_tbl = Stats.write_summary(fid, size_tbl, 'size', 'Vesicle Size', {'Control';'Metalloproteinase Inhibition'});
Stats.write_compare(fid, size_tbl, sum_tbl, 'size', 'Vesicle Size Comparison', {'Control';'Metalloproteinase Inhibition'});
sum_tbl = Stats.write_summary(fid, size_tbl, 'size', 'Vesicle Size', {'Mesoderm';'Ectoderm'}, {'Control';'Metalloproteinase Inhibition'});
Stats.write_compare(fid, size_tbl, sum_tbl, 'size', 'Vesicle Size Comparison', {'Mesoderm';'Ectoderm'}, {'Control';'Metalloproteinase Inhibition'});
fclose(fid);
%%
Stats.export_ecto_stats;
Stats.export_spicule_stats;
% Stats.export_spicule_stats;
%% Create tables for easier data access
size_tbl = readtable('ecto_size_stats_axtinib.csv');
......@@ -10,21 +10,23 @@ spc_tbl = readtable('spicule_stats.csv');
%% Create csv with comparisons
fid = fopen('ecto_sigs.csv', 'wt');
types = {'Control';'VEGFR Inhibition'};
regions = {'Mesoderm';'Ectoderm'};
%% Write size comparison
sum_tbl = Stats.write_summary(fid, size_tbl, 'size', 'Vesicle Size');
Stats.write_compare(fid, size_tbl, sum_tbl, 'size', 'Vesicle Size Comparison');
sum_tbl = Stats.write_summary(fid, size_tbl, 'size', 'Vesicle Size', regions,types);
Stats.write_compare(fid, size_tbl, sum_tbl, 'size', 'Vesicle Size Comparison', regions,types);
%% Speed comparison
sum_tbl = Stats.write_summary(fid, vesicle_tbl, 'avg_speed', 'Vesicle Speed');
Stats.write_compare(fid, vesicle_tbl, sum_tbl, 'avg_speed', 'Vesicle Speed Comparison');
sum_tbl = Stats.write_summary(fid, vesicle_tbl, 'avg_speed', 'Vesicle Speed', regions,types);
Stats.write_compare(fid, vesicle_tbl, sum_tbl, 'avg_speed', 'Vesicle Speed Comparison', regions,types);
%% Directionality comparison
sum_tbl = Stats.write_summary(fid, vesicle_tbl, 'dir_index', 'Vesicle Directionality');
Stats.write_compare(fid, vesicle_tbl, sum_tbl, 'dir_index', 'Vesicle Directionality Comparison');
sum_tbl = Stats.write_summary(fid, vesicle_tbl, 'dir_index', 'Vesicle Directionality', regions,types);
Stats.write_compare(fid, vesicle_tbl, sum_tbl, 'dir_index', 'Vesicle Directionality Comparison', regions,types);
%% Diffusion comparison
sum_tbl = Stats.write_summary(fid, vesicle_tbl, 'msd_D', 'Vesicle Diffusion');
Stats.write_compare(fid, vesicle_tbl, sum_tbl, 'msd_D', 'Vesicle Diffusion Comparison');
sum_tbl = Stats.write_summary(fid, vesicle_tbl, 'msd_D', 'Vesicle Diffusion', regions,types);
Stats.write_compare(fid, vesicle_tbl, sum_tbl, 'msd_D', 'Vesicle Diffusion Comparison', regions,types);
%% Spicule motion stats
sum_tbl = Stats.write_summary_spicule(fid, spc_tbl, 'abs_vel', 'Instantaneous Speed');
......
myo_tbl = readtable('C:/Users/mwinter/Desktop/figs/final-ish versions/final/Plos CB/Resubmission/Myosin.csv');
pha_tbl = readtable('C:/Users/mwinter/Desktop/figs/final-ish versions/final/Plos CB/Resubmission/Phalloidin.csv');
%% Create csv with comparisons
fid = fopen('myo_pha_sigs.csv', 'wt');
regions = {'Skeletogenic Cells','Ectoderm'};
types = {'Control';'VEGFR Inhibition'};
%% Write Myo comparison
sum_tbl = Stats.write_summary(fid, myo_tbl, 'RedRatio', 'Mysoin Ratio', regions,types);
Stats.write_compare(fid, myo_tbl, sum_tbl, 'RedRatio', 'Mysoin Ratio Comparison', regions,types);
%% Write phalloidin comparison
sum_tbl = Stats.write_summary(fid, pha_tbl, 'RedRatio', 'Phalloidin Ratio', regions,types);
Stats.write_compare(fid, pha_tbl, sum_tbl, 'RedRatio', 'Phalloidin Ratio Comparison', regions,types);
fclose(fid);
function tbl = write_compare(fid, stats_tbl, sum_tbl, vname, title, types)
function tbl = write_compare(fid, stats_tbl, sum_tbl, vname, title, regions,types)
sgrp = cellfun(@(x,y)([x ':' y]), stats_tbl.region, stats_tbl.type, 'UniformOutput',false);
[p,tbl,stats] = kruskalwallis(stats_tbl.(vname), sgrp, 'off');
[c,~,~,gn] = multcompare(stats, 'CType','dunn-sidak', 'Display','off');
......@@ -16,7 +16,7 @@ function tbl = write_compare(fid, stats_tbl, sum_tbl, vname, title, types)
midx = [];
%% Assumed regions/types (to get proper sorting)
regions = {'Mesoderm';'Ectoderm'};
% regions = {'Mesoderm';'Ectoderm'};
% types = {'Control';'VEGFR Inhibition'};
for i=1:length(regions)
for j=1:(length(types)-1)
......
function stbl = write_summary(fid, stats_tbl, vname, title, types)
function stbl = write_summary(fid, stats_tbl, vname, title, regions,types)
%% Assumed regions/types (to get proper sorting)
regions = {'Mesoderm';'Ectoderm'};
% regions = {'Mesoderm';'Ectoderm'};
% types = {'Control';'VEGFR Inhibition'};
tnames = cell(length(regions),length(types));
......
......@@ -24,7 +24,8 @@ ax.tick_params(labelsize=16)
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
plt.savefig('C:/Users/mwinter/Desktop/figs/size_axt.svg')
plt.show()
# plt.savefig('C:/Users/mwinter/Desktop/figs/size_axt.svg')
#####################
......@@ -49,7 +50,8 @@ ax.tick_params(labelsize=16)
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
plt.savefig('C:/Users/mwinter/Desktop/figs/track_speed.svg')
plt.show()
# plt.savefig('C:/Users/mwinter/Desktop/figs/track_speed.svg')
# ##
# plt.figure()
......@@ -94,47 +96,50 @@ ax.tick_params(labelsize=16)
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
plt.savefig('C:/Users/mwinter/Desktop/figs/track_di.svg')
plt.show()
# plt.savefig('C:/Users/mwinter/Desktop/figs/track_di.svg')
##
plt.figure(figsize=(5,4.5))
# matplotlib.rcParams['figure.dpi'] = 200
ax = sns.boxplot(x="region", y="nimsd_D", hue="type", showmeans=True, data=data, palette='Set1',
meanprops={"marker":"s","markerfacecolor":"white", "markeredgecolor":"black"})
ax.set_ylim(0.0,0.05)
ax.set_ylabel('')
ax.set_xlabel('')
ax.yaxis.set_major_locator(plt.MaxNLocator(4))
# ax.set_title('Vesicle Average Speed [um/s]', fontsize=20)
# ax.set_title('Non-Ideal Diffusion Coefficient [um^2/s]')
ax.legend().set_title('')
ax.legend(loc='upper left')
ax.tick_params(labelsize=16)
# ax.set(xticklabels=['Control','VEGFR Inhibition'])
# ax.yaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
plt.savefig('C:/Users/mwinter/Desktop/figs/track_nidiff_D.svg')
# ##
# plt.figure(figsize=(5,4.5))
# # matplotlib.rcParams['figure.dpi'] = 200
# ax = sns.boxplot(x="region", y="nimsd_D", hue="type", showmeans=True, data=data, palette='Set1',
# meanprops={"marker":"s","markerfacecolor":"white", "markeredgecolor":"black"})
# ax.set_ylim(0.0,0.05)
# ax.set_ylabel('')
# ax.set_xlabel('')
# ax.yaxis.set_major_locator(plt.MaxNLocator(4))
# # ax.set_title('Vesicle Average Speed [um/s]', fontsize=20)
# # ax.set_title('Non-Ideal Diffusion Coefficient [um^2/s]')
# ax.legend().set_title('')
# ax.legend(loc='upper left')
# ax.tick_params(labelsize=16)
# # ax.set(xticklabels=['Control','VEGFR Inhibition'])
# # ax.yaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
# # ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
# plt.setp(ax.get_legend().get_texts(), fontsize=16)
# plt.tight_layout()
# plt.show()
# # plt.savefig('C:/Users/mwinter/Desktop/figs/track_nidiff_D.svg')
##
plt.figure(figsize=(5,4.5))
# matplotlib.rcParams['figure.dpi'] = 200
ax = sns.boxplot(x="region", y="nimsd_alpha", hue="type", showmeans=True, data=data, palette='Set1',
meanprops={"marker":"s","markerfacecolor":"white", "markeredgecolor":"black"})
ax.set_ylim(0.5,2.5)
ax.set_ylabel('')
ax.set_xlabel('')
ax.yaxis.set_major_locator(plt.MaxNLocator(4))
ax.legend().set_title('')
ax.legend(loc='upper left')
ax.tick_params(labelsize=16)
# ax.set(xticklabels=['Control','VEGFR Inhibition'])
# ax.yaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
plt.savefig('C:/Users/mwinter/Desktop/figs/track_nidiff_alpha.svg')
# ##
# plt.figure(figsize=(5,4.5))
# # matplotlib.rcParams['figure.dpi'] = 200
# ax = sns.boxplot(x="region", y="nimsd_alpha", hue="type", showmeans=True, data=data, palette='Set1',
# meanprops={"marker":"s","markerfacecolor":"white", "markeredgecolor":"black"})
# ax.set_ylim(0.5,2.5)
# ax.set_ylabel('')
# ax.set_xlabel('')
# ax.yaxis.set_major_locator(plt.MaxNLocator(4))
# ax.legend().set_title('')
# ax.legend(loc='upper left')
# ax.tick_params(labelsize=16)
# # ax.set(xticklabels=['Control','VEGFR Inhibition'])
# # ax.yaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
# # ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
# plt.setp(ax.get_legend().get_texts(), fontsize=16)
# plt.tight_layout()
# plt.show()
# # plt.savefig('C:/Users/mwinter/Desktop/figs/track_nidiff_alpha.svg')
##
plt.figure(figsize=(5,4.5))
......@@ -153,7 +158,8 @@ ax.tick_params(labelsize=16)
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
plt.savefig('C:/Users/mwinter/Desktop/figs/track_diff_D.svg')
plt.show()
# plt.savefig('C:/Users/mwinter/Desktop/figs/track_diff_D.svg')
##
plt.figure(figsize=(5,4.5))
......@@ -163,4 +169,5 @@ ax = sns.distplot(msdr2, kde=False, norm_hist=False, color=[0.07,0.30,0.59], his
ax.set_ylabel('')
ax.set_xlabel('')
plt.tight_layout()
plt.savefig('C:/Users/mwinter/Desktop/figs/track_diff_R_hist.svg')
plt.show()
# plt.savefig('C:/Users/mwinter/Desktop/figs/track_diff_R_hist.svg')
......@@ -23,3 +23,4 @@ ax.tick_params(labelsize=14)
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=14)
plt.savefig('C:/Users/mwinter/Desktop/figs/mmpl/size_bb94.svg')
# plt.show()
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
# import statannot as sta
data = pd.read_csv("C:/Users/mwinter/Desktop/figs/final-ish versions/final/Plos CB/Resubmission/Myosin.csv")
##
plt.figure(figsize=(10,5))
# matplotlib.rcParams['figure.dpi'] = 200
# ax = sns.boxplot(x="region", y="RedRatio", hue="type", showmeans=True, showfliers = False, data=data, palette='Set1',
# meanprops={"marker":"s","markerfacecolor":"white", "markeredgecolor":"black"})
# ax = sns.stripplot(x="region", y="RedRatio", hue="type", dodge=True, data=data, color=".25", jitter=0.1)
ax = sns.boxplot(x="region", y="RedRatio", hue="type", showmeans=True, data=data, palette='Set1',
meanprops={"marker":"s","markerfacecolor":"white", "markeredgecolor":"black"})
ax.set_ylabel('')
ax.set_xlabel('')
# ax.set_title('Vesicle Average Volume [um^3]', fontsize=20)
ax.set_title('')
# Don't show data-points on legend (only boxplot info)
h,l = ax.get_legend_handles_labels()
ax.legend().set_title('')
ax.legend(h[:2], l[:2], loc='upper left')
# ax.legend(loc='upper left')
ax.tick_params(labelsize=16)
# ax.set(xticklabels=['Control','VEGFR Inhibition'])
# ax.yaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
# plt.show()
# plt.savefig('C:/Users/mwinter/Desktop/figs/myosin_boxplot.png')
plt.savefig('C:/Users/mwinter/Desktop/figs/myosin_boxplot_nodatapt.svg')
data = pd.read_csv("C:/Users/mwinter/Desktop/figs/final-ish versions/final/Plos CB/Resubmission/Phalloidin.csv")
##
plt.figure(figsize=(10,5))
ax = sns.boxplot(x="region", y="RedRatio", hue="type", showmeans=True, data=data, palette='Set1',
meanprops={"marker":"s","markerfacecolor":"white", "markeredgecolor":"black"})
ax.set_ylabel('')
ax.set_xlabel('')
ax.set_title('')
# Don't show data-points on legend (only boxplot info)
h,l = ax.get_legend_handles_labels()
ax.legend().set_title('')
ax.legend(h[:2], l[:2], loc='upper left')
# ax.legend(loc='upper left')
ax.tick_params(labelsize=16)
# ax.set(xticklabels=['Control','VEGFR Inhibition'])
# ax.yaxis.set_major_locator(matplotlib.ticker.MultipleLocator(5))
# ax.yaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.setp(ax.get_legend().get_texts(), fontsize=16)
plt.tight_layout()
# plt.show()
# plt.savefig('C:/Users/mwinter/Desktop/figs/myosin_boxplot.png')
plt.savefig('C:/Users/mwinter/Desktop/figs/phalloidin_boxplot_nodatapt.svg')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment