<jupyter_start><jupyter_text>Original Paperhttps://doi.org/10.1016/j.bbrc.2018.04.095<jupyter_code>import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
metadata = pd.read_csv('../data/wu_chen_2018/metadata_cleaned_chen_2018.txt', sep='\t', index_col=0)
metadata<jupyter_output><empty_output><jupyter_text>PCoA<jupyter_code>pcoa = pd.read_csv('../data/wu_chen_2018/SI_1085_wUF_pcoa.txt', sep='\t', usecols=range(4), index_col=0)
pcoa.head()
named_pcoa = pd.merge(pcoa, metadata[metadata['feeding_pattern'] == 'ad libitum'], left_index=True, right_index=True)
named_pcoa.head()
named_pcoa.niche.unique()
niche_pcoa = named_pcoa[named_pcoa['niche'] != 'epithelium']
lumen_pcoa = named_pcoa[named_pcoa['niche'] == 'lumen']
mucosal_pcoa = named_pcoa[named_pcoa['niche'] == 'mucosal']
ax = sns.stripplot(x="time", y="Axis1_25.2", hue='organ', dodge=True,
                   edgecolor='k', linewidth=1, size=9,
                   data=lumen_pcoa,
                   #data=lumen_pcoa[lumen_pcoa["group"] == 'LD'],
                     order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
plt.ylabel('Axis1 25.2%')
plt.title('Colon wUF PCoA Axis1')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
#plt.savefig('../figures/chen_colon_wUF_pcoa_Axis1.svg', dpi=300, bbox_inches="tight")
ax = sns.stripplot(x="time", y="Axis1_25.2", hue='niche', 
                   palette=['lightblue', 'darkgreen'], edgecolor='k', linewidth=1, size=9,
                   data=niche_pcoa[niche_pcoa['organ'] == 'colon'], order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
plt.ylabel('Axis1 25.2%')
plt.title('Colon wUF PCoA Axis1')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_colon_wUF_pcoa_Axis1.svg', dpi=300, bbox_inches="tight")
niche_pcoa[niche_pcoa['organ'] == 'colon']
niche_pcoa[niche_pcoa['organ'] == 'colon'].time.value_counts()
ax = sns.stripplot(x="time", y="Axis1_25.2", hue='group', 
                   palette=['darkgreen', 'lightblue'], edgecolor='k', linewidth=1, size=9,
                   data=mucosal_pcoa, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
plt.ylabel('Axis1 25.2%')
plt.title('Mucosal wUF PCoA Axis1')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_mucosal_wUF_pcoa_Axis1.svg', dpi=300, bbox_inches="tight")
ax = sns.stripplot(x="time", y="Axis1_25.2", hue='group', 
                   palette=['lightblue', 'darkgreen'], edgecolor='k', linewidth=1, size=9,
                   data=lumen_pcoa, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
plt.ylabel('Axis1 25.2%')
plt.title('Lumen wUF PCoA Axis1')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_lumen_wUF_pcoa_Axis1.svg', dpi=300, bbox_inches="tight")
ax = sns.scatterplot(x="Axis2_16_2", y="Axis1_25.2", hue='group', palette=['lightblue', 'darkgreen'], 
                   edgecolor='k', linewidth=1,
                   data=niche_pcoa)
plt.title('Chen SI wUF PCoA Axis1&2')
plt.ylabel('Axis1 25.2%')
plt.xlabel('Axis2 16.2%')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_SI_wUF_pcoa_groups.svg', dpi=300, bbox_inches="tight")
ax = sns.scatterplot(x="Axis2_16_2", y="Axis1_25.2", hue='niche', palette=['lightblue', 'darkgreen'], 
                   edgecolor='k', linewidth=1,
                   data=niche_pcoa[niche_pcoa['organ'] == 'jejunum'])
plt.title('Jejunum wUF PCoA Axis1&2')
plt.ylabel('Axis1 25.2%')
plt.xlabel('Axis2 16.2%')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_jejunum_wUF_pcoa_groups.svg', dpi=300, bbox_inches="tight")
ax = sns.scatterplot(x="Axis2_16_2", y="Axis1_25.2", hue='group', 
                     palette=['lightblue', 'darkgreen'], 
                   edgecolor='k', linewidth=1,
                   data=lumen_pcoa)
plt.title('Chen Lumen wUF PCoA Axis1&2')
plt.ylabel('Axis1 25.2%')
plt.xlabel('Axis2 16.2%')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_lumen_wUF_pcoa_groups.svg', dpi=300, bbox_inches="tight")
ax = sns.scatterplot(x="Axis2_16_2", y="Axis1_25.2", hue='group', 
                     palette=['darkgreen', 'lightblue'], 
                   edgecolor='k', linewidth=1,
                   data=mucosal_pcoa)
plt.title('Chen Mucosal wUF PCoA Axis1&2')
plt.ylabel('Axis1 25.2%')
plt.xlabel('Axis2 16.2%')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_mucosal_wUF_pcoa_groups.svg', dpi=300, bbox_inches="tight")<jupyter_output><empty_output><jupyter_text>Boxplots  All SI Together<jupyter_code>SI_wUF_dm = pd.read_csv('../data/wu_chen_2018/SI_wUF_DM_1085.tsv', sep='\t', index_col=0)
SI_wUF_dm.head()
named_SI_wUF_dm = pd.merge(metadata[['combined4']], SI_wUF_dm, left_index=True, right_index=True)
named_SI_wUF_dm.head()
named2_SI_wUF_dm = named_SI_wUF_dm.set_index('combined4')
Named_SI_wUF_dm = named_SI_wUF_dm[['combined4']].copy()
Named_SI_wUF_dm.head()
named3_SI_wUF_dm = pd.merge(named2_SI_wUF_dm.T, Named_SI_wUF_dm, left_index=True, right_index=True)
named4_SI_wUF_dm = named3_SI_wUF_dm.set_index('combined4')
named4_SI_wUF_dm
LD = named4_SI_wUF_dm.filter(regex='LD')
LD2 = LD.T.filter(regex='LD')
LD2.head()
LD_lum_dm = LD2.filter(regex='lumen')
LD_lum_muc_dm = LD_lum_dm.T.filter(regex='mucosal')
LD_lum_muc_dm.shape
LD_lum_muc_dm2 = LD_lum_muc_dm.copy()
LD_lum_muc_dm3 = LD_lum_muc_dm2.stack().reset_index()
LD_lum_muc_dm3.columns = ['Lumen','Mucosal','Value']
LD_lum_muc_dm3
LD_lum_muc_dm3['timepoints'] = LD_lum_muc_dm3['Lumen'].str.split('_').str[-1] + "_" + LD_lum_muc_dm3['Mucosal'].str.split('_').str[-1]
LD_lum_muc_dm3.timepoints.unique()
zt_tps = ['ZT2_ZT2', 'ZT6_ZT6', 'ZT10_ZT10', 'ZT14_ZT14', 'ZT18_ZT18', 'ZT22_ZT22']
LD_lum_muc_dm4 = LD_lum_muc_dm3.loc[LD_lum_muc_dm3['timepoints'].isin(zt_tps)]
LD_lum_muc_dm4
LD_lum_muc_dm5 = LD_lum_muc_dm4.copy()
LD_lum_muc_dm5['ZT'] = LD_lum_muc_dm5['timepoints'].str.split('_').str[-1]
LD_lum_muc_dm5
LD_lum_muc_dm5.Value.mean()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LD_lum_muc_dm5, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LD_lum_muc_dm5, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.ylabel('All SI LD wUF BCD-Lum v Muc')
ax.axhline(0.6123719478224652, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_allSI_LD_lummuc_wUF_boxplot.svg', dpi=300, bbox_inches="tight")
LD_all = named4_SI_wUF_dm.filter(regex='LD')
LD_all2 = LD_all.T.filter(regex='DD')
LD_all2.head()
LD_all3 = LD_all2.filter(regex='lumen')
LD_all_lum = LD_all3.T.filter(regex='lumen')
LD_all_lum.head()
LD_all_lum2 = LD_all_lum.copy()
LD_all_lum3 = LD_all_lum2.stack().reset_index()
LD_all_lum3.columns = ['LD','DD','Value']
LD_all_lum3.head()
LD_all_lum3['timepoints'] = LD_all_lum3['LD'].str.split('_').str[-1] + "_" + LD_all_lum3['DD'].str.split('_').str[-1]
LD_all_lum3.timepoints.unique()
LD_all_lum3['organs'] = LD_all_lum3['LD'].str.split('_').str[1] + "_" + LD_all_lum3['DD'].str.split('_').str[1]
LD_all_lum3.organs.unique()
LD_all_lum4 = LD_all_lum3.loc[LD_all_lum3['timepoints'].isin(zt_tps)]
LD_all_lum4
LD_all_lum5 = LD_all_lum4.copy()
LD_all_lum5['ZT'] = LD_all_lum5['timepoints'].str.split('_').str[-1]
LD_all_lum5
LDvDD_lum_ileum = LD_all_lum5[LD_all_lum5['organs'] == 'ileum_ileum'].copy()
LDvDD_lum_jejunum = LD_all_lum5[LD_all_lum5['organs'] == 'jejunum_jejunum'].copy()
LDvDD_lum_colon = LD_all_lum5[LD_all_lum5['organs'] == 'colon_colon'].copy()
LDvDD_lum_ileum.shape
from statannot import add_stat_annotation
LDvDD_lum_ileum.Value.median()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LDvDD_lum_ileum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LDvDD_lum_ileum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Ileum Luminal Contents wUF', fontsize=14)
plt.ylabel('BCD-LDvDD')
ax.axhline(0.5343440198723557, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_ileum_lum_LDvDD_wUF_boxplot.svg', dpi=300, bbox_inches="tight")
boxpairs = [('ZT22', 'ZT6'), ('ZT2', 'ZT22'), ('ZT22', 'ZT14'), ('ZT22', 'ZT18'), ('ZT10', 'ZT22')] 

ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LDvDD_lum_ileum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LDvDD_lum_ileum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Ileum Luminal Contents wUF', fontsize=14)
plt.ylabel('BCD-LDvDD')
ax.axhline(0.5343440198723557, color='k', ls='--')

ax, test_results = add_stat_annotation(ax, data=LDvDD_lum_ileum, x="ZT", y="Value", 
                                       order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'], 
                                       box_pairs = boxpairs,
                                       test='Mann-Whitney', text_format='star', loc='outside', verbose=2)

plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_ileum_lum_LDvDD_wUF_boxplot2.svg', dpi=300, bbox_inches="tight")
LDvDD_lum_jejunum.Value.mean()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LDvDD_lum_jejunum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LDvDD_lum_jejunum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Ileum Luminal Contents wUF', fontsize=14)
plt.ylabel('BCD-LDvDD')
ax.axhline(0.4940588498583712, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_jejunum_lum_LDvDD_wUF_boxplot.svg', dpi=300, bbox_inches="tight")
boxpairs = [('ZT10', 'ZT6'), ('ZT2', 'ZT10'), ('ZT10', 'ZT14'), ('ZT10', 'ZT18'), ('ZT10', 'ZT22')] 

ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LDvDD_lum_jejunum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LDvDD_lum_jejunum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Ileum Luminal Contents wUF', fontsize=14)
plt.ylabel('BCD-LDvDD')
ax.axhline(0.5343440198723557, color='k', ls='--')

ax, test_results = add_stat_annotation(ax, data=LDvDD_lum_jejunum, x="ZT", y="Value", 
                                       order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'], 
                                       box_pairs = boxpairs,
                                       test='Mann-Whitney', text_format='star', loc='outside', verbose=2)

plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_jejunum_lum_LDvDD_wUF_boxplot2.svg', dpi=300, bbox_inches="tight")
LDvDD_lum_colon.Value.mean()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LDvDD_lum_colon, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LDvDD_lum_colon, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Ileum Luminal Contents wUF', fontsize=14)
plt.ylabel('BCD-LDvDD')
ax.axhline(0.5694627506274029, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_colon_lum_LDvDD_wUF_boxplot.svg', dpi=300, bbox_inches="tight")<jupyter_output><empty_output><jupyter_text>Separate by Organ<jupyter_code>named_SI_wUF_dm = pd.merge(metadata[['combined4']], SI_wUF_dm, left_index=True, right_index=True)
named_SI_wUF_dm.head()
named2_SI_wUF_dm = named_SI_wUF_dm.set_index('combined4')
Named_SI_wUF_dm = named_SI_wUF_dm[['combined4']].copy()
Named_SI_wUF_dm.head()
named3_SI_wUF_dm = pd.merge(named2_SI_wUF_dm.T, Named_SI_wUF_dm, left_index=True, right_index=True)
named4_SI_wUF_dm = named3_SI_wUF_dm.set_index('combined4')
named4_SI_wUF_dm
LD = named4_SI_wUF_dm.filter(regex='LD')
LD2 = LD.T.filter(regex='LD')
LD2.head()
LD_lum_dm = LD2.filter(regex='lumen')
LD_lum_muc_dm = LD_lum_dm.T.filter(regex='mucosal')
LD_lum_muc_dm.shape
LD_lum_muc_dm2 = LD_lum_muc_dm.copy()
LD_lum_muc_dm3 = LD_lum_muc_dm2.stack().reset_index()
LD_lum_muc_dm3.columns = ['Lumen','Mucosal','Value']
LD_lum_muc_dm3
LD_lum_muc_dm3['organ'] = LD_lum_muc_dm3['Lumen'].str.split('_').str[1] + "_" + LD_lum_muc_dm3['Mucosal'].str.split('_').str[1]
LD_lum_muc_dm3.organ.unique()
LD_lum_muc_dm3['timepoints'] = LD_lum_muc_dm3['Lumen'].str.split('_').str[-1] + "_" + LD_lum_muc_dm3['Mucosal'].str.split('_').str[-1]
LD_lum_muc_dm3.timepoints.unique()
LD_lum_muc_dm4 = LD_lum_muc_dm3.loc[LD_lum_muc_dm3['timepoints'].isin(zt_tps)]
LD_lum_muc_dm4
LD_lum_muc_dm5 = LD_lum_muc_dm4.copy()
LD_lum_muc_dm5['ZT'] = LD_lum_muc_dm5['timepoints'].str.split('_').str[-1]
LD_lum_muc_dm5
LD_LM_ileum = LD_lum_muc_dm5[LD_lum_muc_dm5['organ'] == 'ileum_ileum'].copy()
LD_LM_jejunum = LD_lum_muc_dm5[LD_lum_muc_dm5['organ'] == 'jejunum_jejunum'].copy()
LD_LM_colon = LD_lum_muc_dm5[LD_lum_muc_dm5['organ'] == 'colon_colon'].copy()<jupyter_output><empty_output><jupyter_text>Ileum<jupyter_code>LD_LM_ileum.head()
LD_LM_ileum.Value.median()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LD_LM_ileum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LD_LM_ileum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Ileum LD wUF', fontsize=14)
plt.ylabel('BCD-Lum v Muc')
ax.axhline(0.4499902753393743, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_ileum_LD_lummuc_wUF_boxplot.svg', dpi=300, bbox_inches="tight")<jupyter_output><empty_output><jupyter_text>Jejunum<jupyter_code>LD_LM_jejunum.head()
LD_LM_jejunum.Value.median()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LD_LM_jejunum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LD_LM_jejunum, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Jejunum LD wUF', fontsize=14)
plt.ylabel('BCD-Lum v Muc')
ax.axhline(0.5061979110581645, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_jejunum_LD_lummuc_wUF_boxplot.svg', dpi=300, bbox_inches="tight")<jupyter_output><empty_output><jupyter_text>Colon<jupyter_code>LD_LM_colon.head()
LD_LM_colon.Value.mean()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=LD_LM_colon, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=LD_LM_colon, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Colon LD wUF')
plt.ylabel('BCD-Lum v Muc')
ax.axhline(0.5099110235276807, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
plt.savefig('../figures/chen_colon_LD_lummuc_wUF_boxplot.svg', dpi=300, bbox_inches="tight")<jupyter_output><empty_output><jupyter_text>Colon v Jejunum (LD only)<jupyter_code>lumen_dm = named4_SI_wUF_dm.filter(regex='lumen')
lumen_dm2 = LD.T.filter(regex='lumen')
lumen_dm2.head()
colon_lum_dm = lumen_dm2.filter(regex='colon')
colon_jejunum_lum_dm2 = colon_lum_dm.T.filter(regex='jejunum')
colon_jejunum_lum_dm2.shape
colon_jejunum_lum_dms = colon_jejunum_lum_dm2.copy()
colon_jejunum_lum_dms2 = colon_jejunum_lum_dms.stack().reset_index()
colon_jejunum_lum_dms2.columns = ['colon','jejunum','Value']
colon_jejunum_lum_dms2
colon_jejunum_lum_dms2['timepoints'] = colon_jejunum_lum_dms2['colon'].str.split('_').str[-1] + "_" + colon_jejunum_lum_dms2['jejunum'].str.split('_').str[-1]
colon_jejunum_lum_dms2.timepoints.unique()
colon_jejunum_lum_dms3 = colon_jejunum_lum_dms2.loc[colon_jejunum_lum_dms2['timepoints'].isin(zt_tps)]
colon_jejunum_lum_dms3
colon_jejunum_lum_dms4 = colon_jejunum_lum_dms3.copy()
colon_jejunum_lum_dms4['ZT'] = colon_jejunum_lum_dms4['timepoints'].str.split('_').str[-1]
colon_jejunum_lum_dms4
colon_jejunum_lum_dms4.Value.mean()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=colon_jejunum_lum_dms4, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=colon_jejunum_lum_dms4, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Luminal Contents', fontsize=14)
plt.ylabel('wUF BCD Jejunum-v-Colon')
ax.axhline(0.801909399398105, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
#plt.savefig('../figures/chen_jejunum_LD_lummuc_wUF_boxplot.svg', dpi=300, bbox_inches="tight")<jupyter_output><empty_output><jupyter_text>Colon v Jejunum (LD only)<jupyter_code>LD_lum_dm = LD2.filter(regex='lumen')
LD_lum_dm2 = LD_lum_dm.T.filter(regex='lumen')
LD_lum_dm2.shape
colon_LD_lum_dm = LD_lum_dm2.filter(regex='colon')
colon_jejunum_LD_lum_dm2 = colon_LD_lum_dm.T.filter(regex='jejunum')
colon_jejunum_LD_lum_dm2.shape
colon_jejunum_LD_lum_dms = colon_jejunum_LD_lum_dm2.copy()
colon_jejunum_LD_lum_dms2 = colon_jejunum_LD_lum_dms.stack().reset_index()
colon_jejunum_LD_lum_dms2.columns = ['colon','jejunum','Value']
colon_jejunum_LD_lum_dms2
colon_jejunum_LD_lum_dms2['timepoints'] = colon_jejunum_LD_lum_dms2['colon'].str.split('_').str[-1] + "_" + colon_jejunum_LD_lum_dms2['jejunum'].str.split('_').str[-1]
colon_jejunum_LD_lum_dms2.timepoints.unique()
colon_jejunum_LD_lum_dms3 = colon_jejunum_LD_lum_dms2.loc[colon_jejunum_LD_lum_dms2['timepoints'].isin(zt_tps)]
colon_jejunum_LD_lum_dms3
colon_jejunum_LD_lum_dms4 = colon_jejunum_LD_lum_dms3.copy()
colon_jejunum_LD_lum_dms4['ZT'] = colon_jejunum_LD_lum_dms4['timepoints'].str.split('_').str[-1]
colon_jejunum_LD_lum_dms4
colon_jejunum_LD_lum_dms4.Value.mean()
ax = sns.boxplot(x="ZT", y="Value", palette="BuGn",
                 data=colon_jejunum_LD_lum_dms4, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
ax = sns.stripplot(x="ZT", y="Value", palette="BuGn", edgecolor='k', linewidth=1, size=9,
                   data=colon_jejunum_LD_lum_dms4, order=['ZT2', 'ZT6', 'ZT10', 'ZT14', 'ZT18', 'ZT22'])
plt.title('Luminal Contents LD', fontsize=14)
plt.ylabel('wUF BCD Jejunum-v-Colon')
ax.axhline(0.801909399398105, color='k', ls='--')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = 'Arial'
plt.rcParams['svg.fonttype'] = 'none'
#plt.savefig('../figures/chen_jejunum_LD_lummuc_wUF_boxplot.svg', dpi=300, bbox_inches="tight")<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup