Prep stuff


In [1]:
drive_path = 'c:/'
import numpy as np
import pandas as pd
import os
import sys
import matplotlib.pyplot as plt
from scipy.stats import ks_2samp
from scipy.stats import anderson_ksamp
from scipy.stats import kruskal
from scipy.stats import variation
%matplotlib
import seaborn as sns


Using matplotlib backend: Qt4Agg

In [7]:
#composite=pd.read_csv('C:\Users\Annie\Documents\Data\Ca_Imaging\Analysis\Odor_Panel\Composite_MaxDF.csv')
#del composite['Mouse']
#comp_tmp=pd.melt(composite,"Group",var_name="Odor")

In [5]:
#composite=pd.melt(composite,"Group",var_name="Odor")
#sns.swarmplot(x="Odor",y="value",hue="Group",data=comp_tmp);

In [63]:
#composite.head()

In [64]:
#sns.boxplot(x="Odor", y="value", hue="Group", data=comp_tmp);

In [65]:
#sns.violinplot(x="Odor", y="value", hue="Group", data=comp_tmp);

In [66]:
#sns.barplot(x="Odor", y="value", hue="Group", data=comp_tmp);

Import/organize data


In [2]:
comp=pd.read_csv('C:\Users\Annie\Documents\Data\Ca_Imaging\Analysis\Odor_Panel\Composite_MaxDF_NoP.csv')
del comp['Mouse']
comp_sorted=comp.reindex_axis(comp.mean().sort_values().index, axis=1)
comp_labels=pd.DataFrame(comp.Group)
tmp=[comp_labels,comp_sorted]
composite_full=pd.concat(tmp,axis=1)
composite_full.head()
cfull=pd.melt(composite_full,"Group",var_name="Odor")

Mean, Median, COV

Calculate Mean


In [156]:
#Calculate means for each odor
Cctrl=composite_full[composite_full['Group']=='Control']
Cmean=Cctrl.mean()
M=composite_full[composite_full['Group']=='Mint']
Mmean=M.mean()
H=composite_full[composite_full['Group']=='Hexanal']
Hmean=H.mean()

CtrlMDFT=pd.DataFrame(Cmean).transpose()
MMDFT=pd.DataFrame(Mmean).transpose()
HMDFT=pd.DataFrame(Hmean).transpose()

#add group labels back
gnc = pd.DataFrame({'Group':['Control']})
gnm=pd.DataFrame({'Group':['Mint']})
gnh=pd.DataFrame({'Group':['Hexanal']})

Ctmp=[gnc,CtrlMDFT]
Mtmp=[gnm,MMDFT]
Htmp=[gnh,HMDFT]

CtrlMDF=pd.concat(Ctmp,axis=1)
MMDF=pd.concat(Mtmp,axis=1)
HMDF=pd.concat(Htmp,axis=1)

final=[CtrlMDF,MMDF,HMDF]
finalmean=pd.concat(final)
finalmeandf=pd.melt(finalmean,"Group",var_name="Odor")


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-156-6351343a42c3> in <module>()
      1 #Calculate means for each odor
----> 2 Cctrl=composite_full[composite_full['Group']=='Control']
      3 Cmean=Cctrl.mean()
      4 M=composite_full[composite_full['Group']=='Mint']
      5 Mmean=M.mean()

C:\Users\Annie\Anaconda2\lib\site-packages\pandas\core\ops.pyc in wrapper(self, other, axis)
    736             return self._constructor(na_op(self.values, other.values),
    737                                      index=self.index, name=name)
--> 738         elif isinstance(other, pd.DataFrame):  # pragma: no cover
    739             return NotImplemented
    740         elif isinstance(other, (np.ndarray, pd.Index)):

TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

In [157]:
#plot means
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=1.8);
plt.figure(figsize=(55,20));
sns.pointplot(x="Odor", y="value", hue="Group", data=finalmeandf,palette={"Control": "r", "Mint": "g",'Hexanal':'b'});
sns.despine()
plt.ylabel('DF/F', fontsize=48);
plt.title('Mean Peak DF/F',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

Calculate Medians


In [8]:
#Calculate medians for each odor
Cctrl=composite_full[composite_full['Group']=='Control']
Cmedian=Cctrl.median()
M=composite_full[composite_full['Group']=='Mint']
Mmedian=M.median()
H=composite_full[composite_full['Group']=='Hexanal']
Hmedian=H.median()

CtrlMedT=pd.DataFrame(Cmedian).transpose()
MMedT=pd.DataFrame(Mmedian).transpose()
HMedT=pd.DataFrame(Hmedian).transpose()

#add group labels back
gnc = pd.DataFrame({'Group':['Control']})
gnm=pd.DataFrame({'Group':['Mint']})
gnh=pd.DataFrame({'Group':['Hexanal']})

Ctmp=[gnc,CtrlMedT]
Mtmp=[gnm,MMedT]
Htmp=[gnh,HMedT]

CtrlMed=pd.concat(Ctmp,axis=1)
MMed=pd.concat(Mtmp,axis=1)
HMed=pd.concat(Htmp,axis=1)

finalmed=[CtrlMed,MMed,HMed]
finalmedian=pd.concat(finalmed)
finalmediandf=pd.melt(finalmedian,"Group",var_name="Odor")

In [9]:
#Plot medians
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=1.8);
plt.figure(figsize=(55,20));
sns.pointplot(x="Odor", y="value", hue="Group", data=finalmediandf,palette={"Control": "r", "Mint": "g",'Hexanal':'b'});
sns.despine()
plt.ylabel('DF/F', fontsize=48);
plt.title('Median Peak DF/F',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

Calculate and Plot Variance


In [10]:
# Calculate variance
CC=composite_full[composite_full['Group']=='Control']
MM=composite_full[composite_full['Group']=='Mint']
HH=composite_full[composite_full['Group']=='Hexanal']
del CC['Group']
del MM['Group']
del HH['Group']

CvarT=pd.DataFrame(variation(CC)).transpose()
MvarT=pd.DataFrame(variation(MM)).transpose()
HvarT=pd.DataFrame(variation(HH)).transpose()

#add group labels back
gnc = pd.DataFrame({'Group':['Control']})
gnm=pd.DataFrame({'Group':['Mint']})
gnh=pd.DataFrame({'Group':['Hexanal']})

Ctmp=[gnc,CvarT]
Mtmp=[gnm,MvarT]
Htmp=[gnh,HvarT]

CV=pd.concat(Ctmp,axis=1)
MV=pd.concat(Mtmp,axis=1)
HV=pd.concat(Htmp,axis=1)

gn=['Group']
gname = np.array(gn)
odornames=CC.columns.values
columnnames=np.append(gname,odornames)
CV.columns=columnnames
MV.columns=columnnames
HV.columns=columnnames

#Fix BLANK NaNs
CCNB=pd.DataFrame(CC['BLANK'])
CCNB=CCNB.dropna()
CCNBvar=variation(CCNB)
CCNBvars=np.asscalar(CCNBvar)
CV=CV.replace(CV.BLANK[0],CCNBvars)

MMNB=pd.DataFrame(MM['BLANK'])
MMNB=MMNB.dropna()
MMNBvar=variation(MMNB)
MMNBvars=np.asscalar(MMNBvar)
MV=MV.replace(MV.BLANK[0],MMNBvars)

HHNB=pd.DataFrame(HH['BLANK'])
HHNB=HHNB.dropna()
HHNBvar=variation(HHNB)
HHNBvars=np.asscalar(HHNBvar)
HV=HV.replace(HV.BLANK[0],HHNBvars)

complete=[CV,HV,MV]
finalvariance=pd.concat(complete)
finalvariancedf=pd.melt(finalvariance,"Group",var_name="Odor")

In [11]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=1.8);
plt.figure(figsize=(55,20));
sns.pointplot(x="Odor", y="value", hue="Group", data=finalvariancedf,palette={"Control": "r", "Mint": "g",'Hexanal':'b'});
sns.despine()
plt.ylabel('COV', fontsize=48);
plt.title('COV Peak DF/F',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

Calculate and plot variance for each odor concentration


In [12]:
MSconcvar=finalvariance[['Group','MS 0.01','MS 0.05','MS 0.1']]
Hexconcvar=finalvariance[['Group','Hexanal 0.01','Hexanal 0.05','Hexanal 0.1']]
IAAconcvar=finalvariance[['Group','IAA 0.01','IAA 0.05','IAA 0.1']]

MSconcvardf=pd.melt(MSconcvar,"Group",var_name="Odor")
Hexconcvardf=pd.melt(Hexconcvar,'Group', var_name='Odor')
IAAconcvardf=pd.melt(IAAconcvar,'Group',var_name='Odor')

In [13]:
#Plot COV MS Concentration
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=1.8);
plt.figure(figsize=(55,20));
sns.pointplot(x="Odor", y="value", hue="Group", data=MSconcvardf,palette={"Control": "r", "Mint": "g",'Hexanal':'b'});
sns.despine()
plt.ylabel('COV', fontsize=48);
plt.title('COV Peak DF/F - Methyl Salicylate',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

In [211]:
# Plot COV Hexanal Concentration
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=1.8);
plt.figure(figsize=(55,20));
sns.pointplot(x="Odor", y="value", hue="Group", data=Hexconcvardf,palette={"Control": "r", "Mint": "g",'Hexanal':'b'});
sns.despine()
plt.ylabel('COV', fontsize=48);
plt.title('COV Peak DF/F - Hexanal',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

In [212]:
# Plot COV IAA Concentration
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=1.8);
plt.figure(figsize=(55,20));
sns.pointplot(x="Odor", y="value", hue="Group", data=IAAconcvardf,palette={"Control": "r", "Mint": "g",'Hexanal':'b'});
sns.despine()
plt.ylabel('COV', fontsize=48);
plt.title('COV Peak DF/F - Isoamyl acetate',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

Correlate Baseline with DF/F


In [3]:
#Get Baselines
bl=pd.read_csv('C:\Users\Annie\Documents\Data\Ca_Imaging\Analysis\Odor_Panel\Composite_Baseline_NoP.csv')
del bl['Mouse']
bl_sorted=bl.reindex_axis(bl.mean().sort_values().index, axis=1)
bl_labels=pd.DataFrame(bl.Group)
tmp=[bl_labels,bl_sorted]
bdf=pd.concat(tmp,axis=1)
bdfull=pd.melt(bdf,"Group",var_name="Odor")
bdfull=bdfull.dropna()

In [64]:
#no NaNs allowed
bdf2=bdf
del bdf2['BLANK']
# cdf2=composite_full
# del cdf2['BLANK']

In [4]:
cdf2_cn=cdf2.columns.tolist()
bdf2=bdf2[cdf2_cn]
bdf2.head()


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-936071b8112a> in <module>()
----> 1 cdf2_cn=cdf2.columns.tolist()
      2 bdf2=bdf2[cdf2_cn]
      3 bdf2.head()

NameError: name 'cdf2' is not defined

In [73]:
bdf2.corr()


Out[73]:
THA MS 0.01 AP MS 0.1 MS 0.05 IAA 0.05 IAA 0.01 PA IAA 0.1 Hexanone Hexanal 0.1 Hexanal 0.01 Hexanal 0.05 EB
THA 1.000000 0.984700 0.986985 0.980504 0.984799 0.983704 0.986801 0.982524 0.982955 0.982562 0.982675 0.985492 0.984447 0.991061
MS 0.01 0.984700 1.000000 0.987332 0.979586 0.984802 0.981330 0.988178 0.983096 0.980689 0.986068 0.981652 0.987859 0.983496 0.985675
AP 0.986985 0.987332 1.000000 0.978633 0.982400 0.978695 0.988490 0.980479 0.981833 0.990922 0.982489 0.992143 0.985579 0.988872
MS 0.1 0.980504 0.979586 0.978633 1.000000 0.988357 0.989349 0.981329 0.976675 0.993409 0.977748 0.992520 0.977823 0.984851 0.979477
MS 0.05 0.984799 0.984802 0.982400 0.988357 1.000000 0.991971 0.982678 0.982205 0.990829 0.981907 0.989187 0.979588 0.989948 0.983375
IAA 0.05 0.983704 0.981330 0.978695 0.989349 0.991971 1.000000 0.984058 0.981012 0.990014 0.978422 0.989451 0.975866 0.987917 0.981460
IAA 0.01 0.986801 0.988178 0.988490 0.981329 0.982678 0.984058 1.000000 0.985531 0.982384 0.986726 0.980245 0.986749 0.983363 0.984833
PA 0.982524 0.983096 0.980479 0.976675 0.982205 0.981012 0.985531 1.000000 0.979045 0.978421 0.976690 0.978359 0.979289 0.980243
IAA 0.1 0.982955 0.980689 0.981833 0.993409 0.990829 0.990014 0.982384 0.979045 1.000000 0.979582 0.994727 0.980081 0.988562 0.982099
Hexanone 0.982562 0.986068 0.990922 0.977748 0.981907 0.978422 0.986726 0.978421 0.979582 1.000000 0.979907 0.988657 0.982554 0.982775
Hexanal 0.1 0.982675 0.981652 0.982489 0.992520 0.989187 0.989451 0.980245 0.976690 0.994727 0.979907 1.000000 0.979343 0.990883 0.983497
Hexanal 0.01 0.985492 0.987859 0.992143 0.977823 0.979588 0.975866 0.986749 0.978359 0.980081 0.988657 0.979343 1.000000 0.983848 0.985874
Hexanal 0.05 0.984447 0.983496 0.985579 0.984851 0.989948 0.987917 0.983363 0.979289 0.988562 0.982554 0.990883 0.983848 1.000000 0.985340
EB 0.991061 0.985675 0.988872 0.979477 0.983375 0.981460 0.984833 0.980243 0.982099 0.982775 0.983497 0.985874 0.985340 1.000000

In [74]:
cdf2.corr()


Out[74]:
THA MS 0.01 AP MS 0.1 MS 0.05 IAA 0.05 IAA 0.01 PA IAA 0.1 Hexanone Hexanal 0.1 Hexanal 0.01 Hexanal 0.05 EB
THA 1.000000 0.903917 0.894578 0.900715 0.907587 0.909662 0.840436 0.824768 0.893253 0.836796 0.894164 0.762327 0.873705 0.799995
MS 0.01 0.903917 1.000000 0.952636 0.947882 0.916606 0.914039 0.919039 0.897387 0.907058 0.895643 0.876366 0.820637 0.890935 0.872434
AP 0.894578 0.952636 1.000000 0.921658 0.914807 0.923781 0.945530 0.942893 0.920781 0.903916 0.880293 0.875842 0.911388 0.902708
MS 0.1 0.900715 0.947882 0.921658 1.000000 0.963295 0.953065 0.908744 0.870939 0.926905 0.874752 0.934394 0.832568 0.914758 0.834994
MS 0.05 0.907587 0.916606 0.914807 0.963295 1.000000 0.970777 0.898516 0.891731 0.933959 0.836596 0.950984 0.864079 0.938233 0.837516
IAA 0.05 0.909662 0.914039 0.923781 0.953065 0.970777 1.000000 0.907031 0.891275 0.946012 0.853487 0.961188 0.885477 0.939178 0.866530
IAA 0.01 0.840436 0.919039 0.945530 0.908744 0.898516 0.907031 1.000000 0.924075 0.938100 0.887381 0.866086 0.892736 0.899066 0.896188
PA 0.824768 0.897387 0.942893 0.870939 0.891731 0.891275 0.924075 1.000000 0.882518 0.834363 0.849483 0.902975 0.885359 0.924251
IAA 0.1 0.893253 0.907058 0.920781 0.926905 0.933959 0.946012 0.938100 0.882518 1.000000 0.885805 0.926787 0.862461 0.927907 0.865509
Hexanone 0.836796 0.895643 0.903916 0.874752 0.836596 0.853487 0.887381 0.834363 0.885805 1.000000 0.830275 0.791349 0.876775 0.818534
Hexanal 0.1 0.894164 0.876366 0.880293 0.934394 0.950984 0.961188 0.866086 0.849483 0.926787 0.830275 1.000000 0.866120 0.952067 0.835747
Hexanal 0.01 0.762327 0.820637 0.875842 0.832568 0.864079 0.885477 0.892736 0.902975 0.862461 0.791349 0.866120 1.000000 0.917448 0.898416
Hexanal 0.05 0.873705 0.890935 0.911388 0.914758 0.938233 0.939178 0.899066 0.885359 0.927907 0.876775 0.952067 0.917448 1.000000 0.873693
EB 0.799995 0.872434 0.902708 0.834994 0.837516 0.866530 0.896188 0.924251 0.865509 0.818534 0.835747 0.898416 0.873693 1.000000

In [5]:
composite_cn=composite_full.columns.tolist()
bdf=bdf[composite_cn]
bdf.head()


Out[5]:
Group THA MS 0.01 BLANK AP MS 0.1 MS 0.05 IAA 0.05 IAA 0.01 PA IAA 0.1 Hexanone Hexanal 0.1 Hexanal 0.01 Hexanal 0.05 EB
0 Control 2191.580000 2156.251500 NaN 2604.431208 2342.740333 2438.371125 2430.727208 1916.923958 2174.460083 2295.764583 2202.500042 2446.136083 2515.360375 2457.603625 2406.386167
1 Control 1733.676000 1897.166667 NaN 1805.344875 1946.681708 1828.752875 1864.458375 1685.373583 1748.060375 1850.529417 1865.847750 1903.826250 1841.318875 1795.494250 1929.843458
2 Control 1567.613708 1688.818208 NaN 1678.700042 1694.186292 1619.368000 1643.305542 1556.993000 1536.563083 1662.997500 1504.910333 1681.573792 1648.710833 1688.000667 1663.836417
3 Control 829.527875 888.688458 NaN 865.015708 856.108625 861.587750 857.491250 835.064458 822.373417 847.159000 853.859458 857.543458 871.575583 853.299500 843.551167
4 Control 886.599167 1019.396583 NaN 924.648000 929.562417 916.596208 916.315333 955.118500 895.472083 914.607042 948.426042 899.221875 918.836292 914.384250 942.410958

In [ ]:
from scipy.stats import

In [83]:
bdf.corr()


Out[83]:
THA MS 0.01 BLANK AP MS 0.1 MS 0.05 IAA 0.05 IAA 0.01 PA IAA 0.1 Hexanone Hexanal 0.1 Hexanal 0.01 Hexanal 0.05 EB
THA 1.000000 0.984700 0.975764 0.986985 0.980504 0.984799 0.983704 0.986801 0.982524 0.982955 0.982562 0.982675 0.985492 0.984447 0.991061
MS 0.01 0.984700 1.000000 0.975554 0.987332 0.979586 0.984802 0.981330 0.988178 0.983096 0.980689 0.986068 0.981652 0.987859 0.983496 0.985675
BLANK 0.975764 0.975554 1.000000 0.978921 0.963828 0.973664 0.973565 0.977412 0.977870 0.969927 0.982680 0.968745 0.980131 0.968450 0.971579
AP 0.986985 0.987332 0.978921 1.000000 0.978633 0.982400 0.978695 0.988490 0.980479 0.981833 0.990922 0.982489 0.992143 0.985579 0.988872
MS 0.1 0.980504 0.979586 0.963828 0.978633 1.000000 0.988357 0.989349 0.981329 0.976675 0.993409 0.977748 0.992520 0.977823 0.984851 0.979477
MS 0.05 0.984799 0.984802 0.973664 0.982400 0.988357 1.000000 0.991971 0.982678 0.982205 0.990829 0.981907 0.989187 0.979588 0.989948 0.983375
IAA 0.05 0.983704 0.981330 0.973565 0.978695 0.989349 0.991971 1.000000 0.984058 0.981012 0.990014 0.978422 0.989451 0.975866 0.987917 0.981460
IAA 0.01 0.986801 0.988178 0.977412 0.988490 0.981329 0.982678 0.984058 1.000000 0.985531 0.982384 0.986726 0.980245 0.986749 0.983363 0.984833
PA 0.982524 0.983096 0.977870 0.980479 0.976675 0.982205 0.981012 0.985531 1.000000 0.979045 0.978421 0.976690 0.978359 0.979289 0.980243
IAA 0.1 0.982955 0.980689 0.969927 0.981833 0.993409 0.990829 0.990014 0.982384 0.979045 1.000000 0.979582 0.994727 0.980081 0.988562 0.982099
Hexanone 0.982562 0.986068 0.982680 0.990922 0.977748 0.981907 0.978422 0.986726 0.978421 0.979582 1.000000 0.979907 0.988657 0.982554 0.982775
Hexanal 0.1 0.982675 0.981652 0.968745 0.982489 0.992520 0.989187 0.989451 0.980245 0.976690 0.994727 0.979907 1.000000 0.979343 0.990883 0.983497
Hexanal 0.01 0.985492 0.987859 0.980131 0.992143 0.977823 0.979588 0.975866 0.986749 0.978359 0.980081 0.988657 0.979343 1.000000 0.983848 0.985874
Hexanal 0.05 0.984447 0.983496 0.968450 0.985579 0.984851 0.989948 0.987917 0.983363 0.979289 0.988562 0.982554 0.990883 0.983848 1.000000 0.985340
EB 0.991061 0.985675 0.971579 0.988872 0.979477 0.983375 0.981460 0.984833 0.980243 0.982099 0.982775 0.983497 0.985874 0.985340 1.000000

In [85]:
composite_full.corr()


Out[85]:
THA MS 0.01 BLANK AP MS 0.1 MS 0.05 IAA 0.05 IAA 0.01 PA IAA 0.1 Hexanone Hexanal 0.1 Hexanal 0.01 Hexanal 0.05 EB
THA 1.000000 0.903917 0.876239 0.894578 0.900715 0.907587 0.909662 0.840436 0.824768 0.893253 0.836796 0.894164 0.762327 0.873705 0.799995
MS 0.01 0.903917 1.000000 0.915911 0.952636 0.947882 0.916606 0.914039 0.919039 0.897387 0.907058 0.895643 0.876366 0.820637 0.890935 0.872434
BLANK 0.876239 0.915911 1.000000 0.937221 0.922023 0.941782 0.926210 0.878418 0.922038 0.878561 0.822288 0.892572 0.913834 0.875238 0.874409
AP 0.894578 0.952636 0.937221 1.000000 0.921658 0.914807 0.923781 0.945530 0.942893 0.920781 0.903916 0.880293 0.875842 0.911388 0.902708
MS 0.1 0.900715 0.947882 0.922023 0.921658 1.000000 0.963295 0.953065 0.908744 0.870939 0.926905 0.874752 0.934394 0.832568 0.914758 0.834994
MS 0.05 0.907587 0.916606 0.941782 0.914807 0.963295 1.000000 0.970777 0.898516 0.891731 0.933959 0.836596 0.950984 0.864079 0.938233 0.837516
IAA 0.05 0.909662 0.914039 0.926210 0.923781 0.953065 0.970777 1.000000 0.907031 0.891275 0.946012 0.853487 0.961188 0.885477 0.939178 0.866530
IAA 0.01 0.840436 0.919039 0.878418 0.945530 0.908744 0.898516 0.907031 1.000000 0.924075 0.938100 0.887381 0.866086 0.892736 0.899066 0.896188
PA 0.824768 0.897387 0.922038 0.942893 0.870939 0.891731 0.891275 0.924075 1.000000 0.882518 0.834363 0.849483 0.902975 0.885359 0.924251
IAA 0.1 0.893253 0.907058 0.878561 0.920781 0.926905 0.933959 0.946012 0.938100 0.882518 1.000000 0.885805 0.926787 0.862461 0.927907 0.865509
Hexanone 0.836796 0.895643 0.822288 0.903916 0.874752 0.836596 0.853487 0.887381 0.834363 0.885805 1.000000 0.830275 0.791349 0.876775 0.818534
Hexanal 0.1 0.894164 0.876366 0.892572 0.880293 0.934394 0.950984 0.961188 0.866086 0.849483 0.926787 0.830275 1.000000 0.866120 0.952067 0.835747
Hexanal 0.01 0.762327 0.820637 0.913834 0.875842 0.832568 0.864079 0.885477 0.892736 0.902975 0.862461 0.791349 0.866120 1.000000 0.917448 0.898416
Hexanal 0.05 0.873705 0.890935 0.875238 0.911388 0.914758 0.938233 0.939178 0.899066 0.885359 0.927907 0.876775 0.952067 0.917448 1.000000 0.873693
EB 0.799995 0.872434 0.874409 0.902708 0.834994 0.837516 0.866530 0.896188 0.924251 0.865509 0.818534 0.835747 0.898416 0.873693 1.000000

In [97]:
correlated=bdf.corrwith(composite_full)

In [101]:
CC=composite_full[composite_full['Group']=='Control']
MM=composite_full[composite_full['Group']=='Mint']
HH=composite_full[composite_full['Group']=='Hexanal']

CB=bdf[bdf['Group']=='Control']
MB=bdf[bdf['Group']=='Mint']
HB=bdf[bdf['Group']=='Hexanal']

CCcorr=CC.corr()
MMcorr=MM.corr()
HHcorr=HH.corr()
CBcorr=CB.corr()
MBcorr=MB.corr()
HBcorr=HB.corr()

Ctrlcorr=CC.corrwith(CB)
Mintcorr=MM.corrwith(MB)
Hexcorr=HH.corrwith(HB)

In [134]:
CtrlCdf=pd.DataFrame(Ctrlcorr)
CtrlCdf=CtrlCdf.transpose()
MintCdf=pd.DataFrame(Mintcorr)
MintCdf=MintCdf.transpose()
HexCdf=pd.DataFrame(Hexcorr)
HexCdf=HexCdf.transpose()
tmp=[CtrlCdf,MintCdf,HexCdf]

CompleteCorrDF=pd.concat(tmp)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-134-6a3fabb0f51c> in <module>()
----> 1 CtrlCdf=pd.DataFrame(Ctrlcorr)
      2 CtrlCdf=CtrlCdf.transpose()
      3 MintCdf=pd.DataFrame(Mintcorr)
      4 MintCdf=MintCdf.transpose()
      5 HexCdf=pd.DataFrame(Hexcorr)

TypeError: 'dict' object is not callable

In [133]:
pd.DataFrame(Groups)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-133-239a6867b0dc> in <module>()
----> 1 pd.DataFrame(Groups)

TypeError: 'dict' object is not callable

In [128]:
CompleteCorrDF


Out[128]:
THA MS 0.01 BLANK AP MS 0.1 MS 0.05 IAA 0.05 IAA 0.01 PA IAA 0.1 Hexanone Hexanal 0.1 Hexanal 0.01 Hexanal 0.05 EB
0 -0.382352 -0.399837 -0.076281 -0.402633 -0.38667 -0.419902 -0.431872 -0.422037 -0.428054 -0.435041 -0.435566 -0.409890 -0.396637 -0.436438 -0.407805
0 -0.167143 -0.121270 -0.381027 -0.122565 -0.14027 -0.108158 -0.066482 -0.159720 -0.092611 -0.169299 -0.183750 -0.072866 -0.098453 -0.086612 -0.041338
0 -0.428224 -0.392794 -0.413189 -0.417419 -0.41546 -0.421567 -0.409944 -0.414434 -0.373285 -0.453984 -0.419060 -0.396527 -0.392408 -0.363501 -0.334419

In [126]:
plt.plot(CompleteCorrDF)


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-126-dc913ddfe3a5> in <module>()
----> 1 plt.plot(CompleteCorrDF)

C:\Users\Annie\Anaconda2\lib\site-packages\matplotlib\pyplot.pyc in plot(*args, **kwargs)
   3152         ax.hold(hold)
   3153     try:
-> 3154         ret = ax.plot(*args, **kwargs)
   3155     finally:
   3156         ax.hold(washold)

C:\Users\Annie\Anaconda2\lib\site-packages\matplotlib\__init__.pyc in inner(ax, *args, **kwargs)
   1809                     warnings.warn(msg % (label_namer, func.__name__),
   1810                                   RuntimeWarning, stacklevel=2)
-> 1811             return func(ax, *args, **kwargs)
   1812         pre_doc = inner.__doc__
   1813         if pre_doc is None:

C:\Users\Annie\Anaconda2\lib\site-packages\matplotlib\axes\_axes.pyc in plot(self, *args, **kwargs)
   1423 
   1424         for line in self._get_lines(*args, **kwargs):
-> 1425             self.add_line(line)
   1426             lines.append(line)
   1427 

C:\Users\Annie\Anaconda2\lib\site-packages\matplotlib\axes\_base.pyc in add_line(self, line)
   1706             line.set_clip_path(self.patch)
   1707 
-> 1708         self._update_line_limits(line)
   1709         if not line.get_label():
   1710             line.set_label('_line%d' % len(self.lines))

C:\Users\Annie\Anaconda2\lib\site-packages\matplotlib\axes\_base.pyc in _update_line_limits(self, line)
   1728         Figures out the data limit of the given line, updating self.dataLim.
   1729         """
-> 1730         path = line.get_path()
   1731         if path.vertices.size == 0:
   1732             return

C:\Users\Annie\Anaconda2\lib\site-packages\matplotlib\lines.pyc in get_path(self)
    923         """
    924         if self._invalidy or self._invalidx:
--> 925             self.recache()
    926         return self._path
    927 

C:\Users\Annie\Anaconda2\lib\site-packages\matplotlib\lines.pyc in recache(self, always)
    610                 x = ma.asarray(xconv, np.float_).filled(np.nan)
    611             else:
--> 612                 x = np.asarray(xconv, np.float_)
    613             x = x.ravel()
    614         else:

C:\Users\Annie\Anaconda2\lib\site-packages\numpy\core\numeric.pyc in asarray(a, dtype, order)
    480 
    481     """
--> 482     return array(a, dtype, copy=False, order=order)
    483 
    484 def asanyarray(a, dtype=None, order=None):

ValueError: could not convert string to float: Hexanal

In [ ]:


In [ ]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=1.8);
plt.figure(figsize=(55,20));
sns.pointplot();
sns.despine()
plt.ylabel('COV', fontsize=48);
plt.title('COV Peak DF/F - Methyl Salicylate',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

Composite Graphs


In [317]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=2.2);
plt.figure(figsize=(45,20));
ax=sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=cfull);
sns.despine()
plt.ylabel('Peak DF/F', fontsize=48);
plt.title('Peak DF/F',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

In [14]:
# sns.set_context("talk",font_scale=1.9);
# sns.set(style="white", palette="muted", color_codes=True);
# plt.figure(figsize=(8, 6));
# violinplot=sns.violinplot(x="Odor", y="value", hue="Group", data=cfull);
# violinplot.set(ylabel='Peak DF/F');

In [318]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=2.2);
plt.figure(figsize=(45,20));
ax=sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=cfull);
sns.despine()
plt.ylabel('Peak DF/F', fontsize=48);
plt.title('Peak DF/F',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':48});

Concentration based graphs

MS


In [230]:
MS_full=composite_full[['Group','MS 0.01','MS 0.05','MS 0.1']]
MSdf=pd.melt(MS_full,"Group",var_name="Odor")
MSdf.head()


Out[230]:
Group Odor value
0 Control MS 0.01 0.127301
1 Control MS 0.01 0.074838
2 Control MS 0.01 0.094999
3 Control MS 0.01 0.107146
4 Control MS 0.01 0.147167

In [325]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=4.3);
plt.figure(figsize=(30, 20));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MSdf);
sns.despine()
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [326]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=4.3);
plt.figure(figsize=(30, 20));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MSdf);
sns.despine()
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

Histograms (MS)


In [78]:
MSctrl=MS_full[MS_full['Group'] == 'Control']
MSMS=MS_full[MS_full['Group'] == 'Mint']
MShex=MS_full[MS_full['Group'] == 'Hexanal']
MSctrl.tail()


Out[78]:
Group MS 0.01 MS 0.05 MS 0.1
261 Control 0.297978 0.343609 0.404345
262 Control 0.375490 0.350197 0.420784
263 Control 0.047742 0.213791 0.271523
264 Control 0.159659 0.141683 0.151191
265 Control 0.184315 0.192566 0.260542

In [366]:
# Control, MS Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30, 20), sharex=True)
# f.suptitle("Control, MS Concentration", fontsize=40)
sns.despine(left=True)

#data
d = MSctrl['MS 0.01']
e = MSctrl['MS 0.05']
f = MSctrl['MS 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="MS 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="MS 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="MS 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [368]:
# Hexanal, MS Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Hexanal, MS Concentration", fontsize=44)
sns.despine(left=True)

#data
d = MShex['MS 0.01']
e = MShex['MS 0.05']
f = MShex['MS 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="MS 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="MS 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="MS 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [369]:
# Mint, MS Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Mint, MS Concentration", fontsize=44)
sns.despine(left=True)

#data
d = MSMS['MS 0.01']
e = MSMS['MS 0.05']
f = MSMS['MS 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="MS 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="MS 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="MS 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

Hexanal


In [23]:
H_full=composite_full[['Group','Hexanal 0.01','Hexanal 0.05','Hexanal 0.1']]
Hdf=pd.melt(H_full,"Group",var_name="Odor")

In [370]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=4.3);
plt.figure(figsize=(30,20));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=Hdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [328]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=4.3);
plt.figure(figsize=(30,20));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=Hdf);
sns.despine()
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

Histograms (Hexanal)


In [178]:
Hctrl=H_full[H_full['Group'] == 'Control']
HMS=H_full[H_full['Group'] == 'Mint']
HH=H_full[H_full['Group'] == 'Hexanal']
HH.head()


Out[178]:
Group Hexanal 0.01 Hexanal 0.05 Hexanal 0.1
266 Hexanal 0.346753 0.300836 0.290083
267 Hexanal 0.269426 0.349465 0.236634
268 Hexanal 0.359969 0.422324 0.416844
269 Hexanal 0.136656 0.135468 0.124364
270 Hexanal 0.188876 0.200218 0.136488

In [373]:
# Control, Hexanal Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Control, Hexanal Concentration", fontsize=44)
sns.despine(left=True)

#data
d = Hctrl['Hexanal 0.01']
e = Hctrl['Hexanal 0.05']
f = Hctrl['Hexanal 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Hexanal 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Hexanal 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [372]:
# Hexanal, Hexanal Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Hexanal, Hexanal Concentration", fontsize=44)
sns.despine(left=True)

#data
d = HH['Hexanal 0.01']
e = HH['Hexanal 0.05']
f = HH['Hexanal 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Hexanal 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Hexanal 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [374]:
# Mint, Hexanal Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Mint, Hexanal Concentration", fontsize=44)
sns.despine(left=True)

#data
d = HMS['Hexanal 0.01']
e = HMS['Hexanal 0.05']
f = HMS['Hexanal 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Hexanal 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Hexanal 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

IAA


In [35]:
IAA_full=composite_full[['Group','IAA 0.01','IAA 0.05','IAA 0.1']]
IAAdf=pd.melt(MS_full,"Group",var_name="Odor")

In [329]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=4.3);
plt.figure(figsize=(30,20));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAAdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [331]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=4.3);
plt.figure(figsize=(30,20));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAAdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

Histograms (IAA)


In [182]:
Ictrl=IAA_full[IAA_full['Group'] == 'Control']
IMS=IAA_full[IAA_full['Group'] == 'Mint']
IH=IAA_full[IAA_full['Group'] == 'Hexanal']
IH.head()


Out[182]:
Group IAA 0.01 IAA 0.05 IAA 0.1
266 Hexanal 0.210982 0.082528 0.382490
267 Hexanal 0.207433 0.068120 0.402160
268 Hexanal 0.350660 0.130934 0.439151
269 Hexanal 0.099299 0.042892 0.090707
270 Hexanal 0.103156 0.026460 0.154604

In [375]:
# Control, IAA Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Control, IAA Concentration", fontsize=44)
sns.despine(left=True)

#data
d = Ictrl['IAA 0.01']
e = Ictrl['IAA 0.05']
f = Ictrl['IAA 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="IAA 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="IAA 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="IAA 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [376]:
# Hexanal, IAA Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Hexanal, IAA Concentration", fontsize=44)
sns.despine(left=True)

#data
d = IH['IAA 0.01']
e = IH['IAA 0.05']
f = IH['IAA 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="IAA 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="IAA 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="IAA 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [377]:
# Mint, IAA Concentration
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Mint, IAA Concentration", fontsize=44)
sns.despine(left=True)

#data
d = IMS['IAA 0.01']
e = IMS['IAA 0.05']
f = IMS['IAA 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="IAA 0.01")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="IAA 0.05")
sns.distplot(f, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="IAA 0.1")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="b", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="r", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="b",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="r",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

Stats

Methyl Salicylate


In [38]:
MSctrl=MS_full[MS_full['Group'] == 'Control']
MSMS=MS_full[MS_full['Group'] == 'Mint']
MShex=MS_full[MS_full['Group'] == 'Hexanal']
MSctrl.tail()


Out[38]:
Group MS 0.01 MS 0.05 MS 0.1
261 Control 0.297978 0.343609 0.404345
262 Control 0.375490 0.350197 0.420784
263 Control 0.047742 0.213791 0.271523
264 Control 0.159659 0.141683 0.151191
265 Control 0.184315 0.192566 0.260542

In [39]:
kruskal(MSctrl['MS 0.01'],MSctrl['MS 0.05'],MSctrl['MS 0.1'],nan_policy='omit')


Out[39]:
KruskalResult(statistic=1.9725528869809088, pvalue=0.37296285696071418)

In [40]:
kruskal(MSMS['MS 0.01'],MSMS['MS 0.05'],MSMS['MS 0.1'],nan_policy='omit')


Out[40]:
KruskalResult(statistic=13.539494458225329, pvalue=0.0011479847913647104)

In [41]:
kruskal(MShex['MS 0.01'],MShex['MS 0.05'],MShex['MS 0.1'],nan_policy='omit')


Out[41]:
KruskalResult(statistic=5.7933408549275871, pvalue=0.055206729192718254)

Hexanal


In [43]:
Hctrl=H_full[H_full['Group'] == 'Control']
HMS=H_full[H_full['Group'] == 'Mint']
HH=H_full[H_full['Group'] == 'Hexanal']
HH.head()


Out[43]:
Group Hexanal 0.01 Hexanal 0.05 Hexanal 0.1
266 Hexanal 0.346753 0.300836 0.290083
267 Hexanal 0.269426 0.349465 0.236634
268 Hexanal 0.359969 0.422324 0.416844
269 Hexanal 0.136656 0.135468 0.124364
270 Hexanal 0.188876 0.200218 0.136488

In [44]:
kruskal(Hctrl['Hexanal 0.01'],Hctrl['Hexanal 0.05'],Hctrl['Hexanal 0.1'],nan_policy='omit')


Out[44]:
KruskalResult(statistic=4.4640795238193043, pvalue=0.1073093212807168)

In [45]:
kruskal(HMS['Hexanal 0.01'],HMS['Hexanal 0.05'],HMS['Hexanal 0.1'],nan_policy='omit')


Out[45]:
KruskalResult(statistic=4.1404582218539545, pvalue=0.12615687447522853)

In [46]:
kruskal(HH['Hexanal 0.01'],HH['Hexanal 0.05'],HH['Hexanal 0.1'],nan_policy='omit')


Out[46]:
KruskalResult(statistic=32.384359703646624, pvalue=9.2859350217332081e-08)

IAA


In [47]:
Ictrl=IAA_full[IAA_full['Group'] == 'Control']
IMS=IAA_full[IAA_full['Group'] == 'Mint']
IH=IAA_full[IAA_full['Group'] == 'Hexanal']
IH.head()


Out[47]:
Group IAA 0.01 IAA 0.05 IAA 0.1
266 Hexanal 0.210982 0.082528 0.382490
267 Hexanal 0.207433 0.068120 0.402160
268 Hexanal 0.350660 0.130934 0.439151
269 Hexanal 0.099299 0.042892 0.090707
270 Hexanal 0.103156 0.026460 0.154604

In [48]:
kruskal(Ictrl['IAA 0.01'],Ictrl['IAA 0.05'],Ictrl['IAA 0.1'],nan_policy='omit')


Out[48]:
KruskalResult(statistic=19.499111604184485, pvalue=5.8320563850495121e-05)

In [49]:
kruskal(IMS['IAA 0.01'],IMS['IAA 0.05'],IMS['IAA 0.1'],nan_policy='omit')


Out[49]:
KruskalResult(statistic=31.735812204406784, pvalue=1.2842688251749286e-07)

In [50]:
kruskal(IH['IAA 0.01'],IH['IAA 0.05'],IH['IAA 0.1'],nan_policy='omit')


Out[50]:
KruskalResult(statistic=38.874224328353328, pvalue=3.6188405076274751e-09)

By odor

MS 0.01


In [402]:
MS001_full=composite_full[['Group','MS 0.01']]
MS001df=pd.melt(MS001_full,"Group",var_name="Odor")

In [403]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MS001df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [404]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MS001df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [405]:
MS001ctrl=MS001_full[MS001_full['Group'] == 'Control']
MS001MS=MS001_full[MS001_full['Group'] == 'Mint']
MS001H=MS001_full[MS001_full['Group'] == 'Hexanal']
MS001H.head()


Out[405]:
Group MS 0.01
266 Hexanal 0.161091
267 Hexanal 0.032355
268 Hexanal 0.260874
269 Hexanal 0.034293
270 Hexanal 0.042151

In [406]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("MS 0.01", fontsize=44)
sns.despine(left=True)

#data
d = MS001ctrl['MS 0.01']
e = MS001MS['MS 0.01']
f = MS001H['MS 0.01']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [407]:
kruskal(MS001_full[MS001_full['Group'] == 'Control']['MS 0.01'],MS001_full[MS001_full['Group'] == 'Mint']['MS 0.01'],MS001_full[MS001_full['Group'] == 'Hexanal']['MS 0.01'],nan_policy='omit')


Out[407]:
KruskalResult(statistic=17.779511707365906, pvalue=0.00013779329560080323)

MS 0.05


In [408]:
MS005_full=composite_full[['Group','MS 0.05']]
MS005df=pd.melt(MS005_full,"Group",var_name="Odor")

In [409]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MS005df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [410]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MS005df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [411]:
MS005ctrl=MS005_full[MS005_full['Group'] == 'Control']
MS005MS=MS005_full[MS005_full['Group'] == 'Mint']
MS005H=MS005_full[MS005_full['Group'] == 'Hexanal']
MS005H.head()


Out[411]:
Group MS 0.05
266 Hexanal 0.096774
267 Hexanal 0.081605
268 Hexanal 0.158723
269 Hexanal 0.024024
270 Hexanal 0.014518

In [412]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("MS 0.05", fontsize=44)
sns.despine(left=True)

#data
d = MS005ctrl['MS 0.05']
e = MS005MS['MS 0.05']
f = MS005H['MS 0.05']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [413]:
kruskal(MS005_full[MS005_full['Group'] == 'Control']['MS 0.05'],MS005_full[MS005_full['Group'] == 'Mint']['MS 0.05'],MS005_full[MS005_full['Group'] == 'Hexanal']['MS 0.05'],nan_policy='omit')


Out[413]:
KruskalResult(statistic=22.348493455193285, pvalue=1.4030925116132286e-05)

MS 0.1


In [414]:
MS10_full=composite_full[['Group','MS 0.1']]
MS10df=pd.melt(MS10_full,"Group",var_name="Odor")

In [415]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MS10df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [416]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=MS10df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [417]:
MS10ctrl=MS10_full[MS10_full['Group'] == 'Control']
MS10MS=MS10_full[MS10_full['Group'] == 'Mint']
MS10H=MS10_full[MS10_full['Group'] == 'Hexanal']
MS10H.head()


Out[417]:
Group MS 0.1
266 Hexanal 0.149891
267 Hexanal 0.094942
268 Hexanal 0.250858
269 Hexanal 0.048251
270 Hexanal 0.080076

In [418]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("MS 0.1", fontsize=44)
sns.despine(left=True)

#data
d = MS10ctrl['MS 0.1']
e = MS10MS['MS 0.1']
f = MS10H['MS 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [126]:
kruskal(THA_full[THA_full['Group'] == 'Control']['THA'],THA_full[THA_full['Group'] == 'Mint']['THA'],THA_full[THA_full['Group'] == 'Hexanal']['THA'],nan_policy='omit')


Out[126]:
KruskalResult(statistic=26.646950444965789, pvalue=1.6356419143785338e-06)

IAA 1%


In [419]:
IAA001_full=composite_full[['Group','IAA 0.01']]
IAA001df=pd.melt(IAA001_full,"Group",var_name="Odor")

In [420]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAA001df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [421]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAA001df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [422]:
IAA001ctrl=IAA001_full[IAA001_full['Group'] == 'Control']
IAA001MS=IAA001_full[IAA001_full['Group'] == 'Mint']
IAA001H=IAA001_full[IAA001_full['Group'] == 'Hexanal']
IAA001H.head()


Out[422]:
Group IAA 0.01
266 Hexanal 0.210982
267 Hexanal 0.207433
268 Hexanal 0.350660
269 Hexanal 0.099299
270 Hexanal 0.103156

In [423]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("IAA 0.01", fontsize=44)
sns.despine(left=True)

#data
d = IAA001ctrl['IAA 0.01']
e = IAA001MS['IAA 0.01']
f = IAA001H['IAA 0.01']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [424]:
kruskal(IAA001_full[IAA001_full['Group'] == 'Control']['IAA 0.01'],IAA001_full[IAA001_full['Group'] == 'Mint']['IAA 0.01'],IAA001_full[IAA001_full['Group'] == 'Hexanal']['IAA 0.01'],nan_policy='omit')


Out[424]:
KruskalResult(statistic=22.979999688546172, pvalue=1.0231904325257964e-05)

IAA 0.05


In [425]:
IAA005_full=composite_full[['Group','IAA 0.05']]
IAA005df=pd.melt(IAA005_full,"Group",var_name="Odor")

In [426]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAA005df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [427]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAA005df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [428]:
IAA005ctrl=IAA005_full[IAA005_full['Group'] == 'Control']
IAA005MS=IAA005_full[IAA005_full['Group'] == 'Mint']
IAA005H=IAA005_full[IAA005_full['Group'] == 'Hexanal']
IAA005H.head()


Out[428]:
Group IAA 0.05
266 Hexanal 0.082528
267 Hexanal 0.068120
268 Hexanal 0.130934
269 Hexanal 0.042892
270 Hexanal 0.026460

In [429]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("IAA 0.05", fontsize=44)
sns.despine(left=True)

#data
d = IAA005ctrl['IAA 0.05']
e = IAA005MS['IAA 0.05']
f = IAA005H['IAA 0.05']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [430]:
kruskal(IAA005_full[IAA005_full['Group'] == 'Control']['IAA 0.05'],IAA005_full[IAA005_full['Group'] == 'Mint']['IAA 0.05'],IAA005_full[IAA005_full['Group'] == 'Hexanal']['IAA 0.05'],nan_policy='omit')


Out[430]:
KruskalResult(statistic=7.2116318108394726, pvalue=0.027165271476384416)

IAA 0.1


In [437]:
IAA10_full=composite_full[['Group','IAA 0.1']]
IAA10df=pd.melt(IAA10_full,"Group",var_name="Odor")

In [438]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAA10df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [439]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=IAA10df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [440]:
IAA10ctrl=IAA10_full[IAA10_full['Group'] == 'Control']
IAA10MS=IAA10_full[IAA10_full['Group'] == 'Mint']
IAA10H=IAA10_full[IAA10_full['Group'] == 'Hexanal']
IAA10H.head()


Out[440]:
Group IAA 0.1
266 Hexanal 0.382490
267 Hexanal 0.402160
268 Hexanal 0.439151
269 Hexanal 0.090707
270 Hexanal 0.154604

In [441]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("IAA 0.1", fontsize=44)
sns.despine(left=True)

#data
d = IAA10ctrl['IAA 0.1']
e = IAA10MS['IAA 0.1']
f = IAA10H['IAA 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [436]:
kruskal(IAA10_full[IAA10_full['Group'] == 'Control']['IAA 0.1'],IAA10_full[IAA10_full['Group'] == 'Mint']['IAA 0.1'],IAA10_full[IAA10_full['Group'] == 'Hexanal']['IAA 0.1'],nan_policy='omit')


Out[436]:
KruskalResult(statistic=30.073164294270121, pvalue=2.9491397092061267e-07)

Hexanal 1%


In [448]:
H001_full=composite_full[['Group','Hexanal 0.01']]
H001df=pd.melt(H001_full,"Group",var_name="Odor")

In [449]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=H001df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [450]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=H001df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [451]:
H001ctrl=H001_full[H001_full['Group'] == 'Control']
H001MS=H001_full[H001_full['Group'] == 'Mint']
H001H=H001_full[H001_full['Group'] == 'Hexanal']
H001H.head()


Out[451]:
Group Hexanal 0.01
266 Hexanal 0.346753
267 Hexanal 0.269426
268 Hexanal 0.359969
269 Hexanal 0.136656
270 Hexanal 0.188876

In [452]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Hexanal 0.01", fontsize=44)
sns.despine(left=True)

#data
d = H001ctrl['Hexanal 0.01']
e = H001MS['Hexanal 0.01']
f = H001H['Hexanal 0.01']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [453]:
kruskal(H001_full[H001_full['Group'] == 'Control']['Hexanal 0.01'],H001_full[H001_full['Group'] == 'Mint']['Hexanal 0.01'],H001_full[H001_full['Group'] == 'Hexanal']['Hexanal 0.01'],nan_policy='omit')


Out[453]:
KruskalResult(statistic=24.469118887167379, pvalue=4.8595756261645399e-06)

Hexanal 0.05


In [455]:
H005_full=composite_full[['Group','Hexanal 0.05']]
H005df=pd.melt(H005_full,"Group",var_name="Odor")

In [456]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=H005df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [457]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=H005df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [458]:
H005ctrl=H005_full[H005_full['Group'] == 'Control']
H005MS=H005_full[H005_full['Group'] == 'Mint']
H005H=H005_full[H005_full['Group'] == 'Hexanal']
H005H.head()


Out[458]:
Group Hexanal 0.05
266 Hexanal 0.300836
267 Hexanal 0.349465
268 Hexanal 0.422324
269 Hexanal 0.135468
270 Hexanal 0.200218

In [460]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Hexanal 0.05", fontsize=44)
sns.despine(left=True)

#data
d = H005ctrl['Hexanal 0.05']
e = H005MS['Hexanal 0.05']
f = H005H['Hexanal 0.05']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [461]:
kruskal(H005_full[H005_full['Group'] == 'Control']['Hexanal 0.05'],H005_full[H005_full['Group'] == 'Mint']['Hexanal 0.05'],H005_full[H005_full['Group'] == 'Hexanal']['Hexanal 0.05'],nan_policy='omit')


Out[461]:
KruskalResult(statistic=66.921585593621458, pvalue=2.9387478759540041e-15)

Hexanal 0.1


In [462]:
H10_full=composite_full[['Group','Hexanal 0.1']]
H10df=pd.melt(H10_full,"Group",var_name="Odor")

In [463]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=H10df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [464]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=H10df);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [465]:
H10ctrl=H10_full[H10_full['Group'] == 'Control']
H10MS=H10_full[H10_full['Group'] == 'Mint']
H10H=H10_full[H10_full['Group'] == 'Hexanal']
H10H.head()


Out[465]:
Group Hexanal 0.1
266 Hexanal 0.290083
267 Hexanal 0.236634
268 Hexanal 0.416844
269 Hexanal 0.124364
270 Hexanal 0.136488

In [466]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("IAA 0.05", fontsize=44)
sns.despine(left=True)

#data
d = H10ctrl['Hexanal 0.1']
e = H10MS['Hexanal 0.1']
f = H10H['Hexanal 0.1']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [468]:
kruskal(H10_full[H10_full['Group'] == 'Control']['Hexanal 0.1'],H10_full[dH10_full['Group'] == 'Mint']['Hexanal 0.1'],H10_full[H10_full['Group'] == 'Hexanal']['Hexanal 0.1'],nan_policy='omit')


Out[468]:
KruskalResult(statistic=15.839109543591839, pvalue=0.00036356415948386392)

THA


In [296]:
THA_full=composite_full[['Group','THA']]
THAdf=pd.melt(THA_full,"Group",var_name="Odor")

In [360]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=THAdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');

In [362]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=THAdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [341]:
THActrl=THA_full[THA_full['Group'] == 'Control']
THAMS=THA_full[THA_full['Group'] == 'Mint']
THAH=THA_full[THA_full['Group'] == 'Hexanal']
THAH.head()


Out[341]:
Group THA
266 Hexanal 0.032360
267 Hexanal 0.068896
268 Hexanal 0.141124
269 Hexanal 0.031333
270 Hexanal 0.029448

In [357]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("2-hydroxyacetophenone", fontsize=44)
sns.despine(left=True)

#data
d = THActrl['THA']
e = THAMS['THA']
f = THAH['THA']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [126]:
kruskal(THA_full[THA_full['Group'] == 'Control']['THA'],THA_full[THA_full['Group'] == 'Mint']['THA'],THA_full[THA_full['Group'] == 'Hexanal']['THA'],nan_policy='omit')


Out[126]:
KruskalResult(statistic=26.646950444965789, pvalue=1.6356419143785338e-06)

AP


In [264]:
AP_full=composite_full[['Group','AP']]
APdf=pd.melt(AP_full,"Group",var_name="Odor")

In [335]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=APdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [336]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=APdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [358]:
APctrl=AP_full[AP_full['Group'] == 'Control']
APMS=AP_full[AP_full['Group'] == 'Mint']
APH=AP_full[AP_full['Group'] == 'Hexanal']
APH.head()


Out[358]:
Group AP
266 Hexanal 0.150098
267 Hexanal 0.074321
268 Hexanal 0.180250
269 Hexanal 0.113269
270 Hexanal 0.028062

In [359]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("2-hydroxyacetophenone", fontsize=44)
sns.despine(left=True)

#data
d = APctrl['AP']
e = APMS['AP']
f = APH['AP']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [131]:
kruskal(AP_full[AP_full['Group'] == 'Control']['AP'],AP_full[AP_full['Group'] == 'Mint']['AP'],AP_full[AP_full['Group'] == 'Hexanal']['AP'],nan_policy='omit')


Out[131]:
KruskalResult(statistic=46.307698447912315, pvalue=8.7985488016197506e-11)

EB


In [332]:
EB_full=composite_full[['Group','EB']]
EBdf=pd.melt(EB_full,"Group",var_name="Odor")

In [337]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=EBdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [338]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=EBdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [363]:
EBctrl=EB_full[EB_full['Group'] == 'Control']
EBMS=EB_full[EB_full['Group'] == 'Mint']
EBH=EB_full[EB_full['Group'] == 'Hexanal']
EBH.head()


Out[363]:
Group EB
266 Hexanal 0.209884
267 Hexanal 0.193009
268 Hexanal 0.335625
269 Hexanal 0.082340
270 Hexanal 0.023194

In [364]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("2-hydroxyacetophenone", fontsize=44)
sns.despine(left=True)

#data
d = EBctrl['EB']
e = EBMS['EB']
f = EBH['EB']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [135]:
kruskal(EB_full[EB_full['Group'] == 'Control']['EB'],EB_full[EB_full['Group'] == 'Mint']['EB'],EB_full[EB_full['Group'] == 'Hexanal']['EB'],nan_policy='omit')


Out[135]:
KruskalResult(statistic=20.686023094405726, pvalue=3.2217152941460278e-05)

Hexanone


In [378]:
Hone_full=composite_full[['Group','Hexanone']]
Honedf=pd.melt(Hone_full,"Group",var_name="Odor")

In [379]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=Honedf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [380]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=Honedf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [381]:
Honectrl=Hone_full[Hone_full['Group'] == 'Control']
HoneMS=Hone_full[Hone_full['Group'] == 'Mint']
HoneH=Hone_full[Hone_full['Group'] == 'Hexanal']
HoneH.head()


Out[381]:
Group Hexanone
266 Hexanal 0.378703
267 Hexanal 0.330326
268 Hexanal 0.501147
269 Hexanal 0.073911
270 Hexanal 0.117332

In [382]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("Hexanone", fontsize=44)
sns.despine(left=True)

#data
d = Honectrl['Hexanone']
e = HoneMS['Hexanone']
f = HoneH['Hexanone']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [383]:
kruskal(Hone_full[Hone_full['Group'] == 'Control']['Hexanone'],Hone_full[Hone_full['Group'] == 'Mint']['Hexanone'],Hone_full[Hone_full['Group'] == 'Hexanal']['Hexanone'],nan_policy='omit')


Out[383]:
KruskalResult(statistic=20.558063665415894, pvalue=3.4345765132367753e-05)

PA


In [384]:
PA_full=composite_full[['Group','PA']]
PAdf=pd.melt(PA_full,"Group",var_name="Odor")

In [385]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=PAdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [386]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=PAdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [387]:
PActrl=PA_full[PA_full['Group'] == 'Control']
PAMS=PA_full[PA_full['Group'] == 'Mint']
PAH=PA_full[PA_full['Group'] == 'Hexanal']
PAH.head()


Out[387]:
Group PA
266 Hexanal 0.043617
267 Hexanal 0.032337
268 Hexanal 0.000000
269 Hexanal 0.004714
270 Hexanal 0.032430

In [388]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("2-hydroxyacetophenone", fontsize=44)
sns.despine(left=True)

#data
d = PActrl['PA']
e = PAMS['PA']
f = PAH['PA']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [389]:
kruskal(PA_full[PA_full['Group'] == 'Control']['PA'],PA_full[PA_full['Group'] == 'Mint']['PA'],PA_full[PA_full['Group'] == 'Hexanal']['PA'],nan_policy='omit')


Out[389]:
KruskalResult(statistic=36.777881600341829, pvalue=1.032249027618262e-08)

Blank


In [391]:
B_full=composite_full[['Group','BLANK']]
Bdf=pd.melt(B_full,"Group",var_name="Odor")

In [392]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=Bdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [393]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=3);
plt.figure(figsize=(15,18));
sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=Bdf);
sns.despine();
plt.legend(loc='upper right');
plt.ylabel('Peak DF/F');
plt.title('Peak DF/F');
plt.xlabel('Odor');

In [398]:
Bctrl=B_full[B_full['Group'] == 'Control']
Bctrl=Bctrl.dropna()
BMS=B_full[B_full['Group'] == 'Mint']
BMS=BMS.dropna()
BH=B_full[B_full['Group'] == 'Hexanal']
BH=BH.dropna()
BH.head()


Out[398]:
Group BLANK
287 Hexanal 0.059379
288 Hexanal 0.027291
289 Hexanal 0.069221
290 Hexanal 0.121546
291 Hexanal 0.055183

In [399]:
sns.set(style="white", palette="muted", color_codes=True)
sns.set_context("talk", font_scale=2)
# Set up the matplotlib figure
f, axes = plt.subplots(2, 2, figsize=(30,20), sharex=True)
# f.suptitle("2-hydroxyacetophenone", fontsize=44)
sns.despine(left=True)

#data
d = Bctrl['BLANK']
e = BMS['BLANK']
f = BH['BLANK']

# Plot a simple histogram with binsize determined automatically
sns.distplot(d, kde=False, color="r", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(e, kde=False, color="g", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])
sns.distplot(f, kde=False, color="b", hist_kws={"histtype":'step',"linewidth":3,"alpha":0.7},axlabel= False,ax=axes[0, 0])

# Plot a kernel density estimate and rug plot
sns.distplot(d, hist=False, rug=True, color="r", axlabel= False,ax=axes[0, 1],label="Control")
sns.distplot(e, hist=False, rug=True, color="g", axlabel= False,ax=axes[0, 1],label="Mint")
sns.distplot(f, hist=False, rug=True, color="b", axlabel= False,ax=axes[0, 1],label="Hexanal")

# Plot a filled kernel density estimate
sns.distplot(d, hist=False, color="r", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(e, hist=False, color="g", kde_kws={"shade": True}, axlabel=False,ax=axes[1, 0])
sns.distplot(f, hist=False, color="b", kde_kws={"shade": True}, axlabel= False,ax=axes[1, 0])

# Plot a historgram and kernel density estimate
sns.distplot(d, color="r",axlabel= False,ax=axes[1, 1])
sns.distplot(e, color="g",axlabel= False,ax=axes[1, 1])
sns.distplot(f, color="b",axlabel= False,ax=axes[1, 1])

plt.setp(axes, yticks=[])
plt.tight_layout()

In [400]:
kruskal(B_full[B_full['Group'] == 'Control']['BLANK'],B_full[B_full['Group'] == 'Mint']['BLANK'],B_full[B_full['Group'] == 'Hexanal']['BLANK'],nan_policy='omit')


Out[400]:
KruskalResult(statistic=109.93241092905365, pvalue=1.3442507132896537e-24)

Baseline, by group


In [15]:
bl=pd.read_csv('C:\Users\Annie\Documents\Data\Ca_Imaging\Analysis\Odor_Panel\Composite_Baseline_NoP.csv')
del bl['Mouse']
bl_sorted=bl.reindex_axis(bl.mean().sort_values().index, axis=1)
bl_labels=pd.DataFrame(bl.Group)
tmp=[bl_labels,bl_sorted]
bdf=pd.concat(tmp,axis=1)
bdfull=pd.melt(bdf,"Group",var_name="Odor")
bdfull=bdfull.dropna()

Composite Graphs - Baseline


In [498]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=2.2);
plt.figure(figsize=(45,20));
ax=sns.barplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=bdfull);
sns.despine()
plt.ylabel('Intensity', fontsize=48);
plt.title('Baseline F',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':30});

In [518]:
# sns.set_context("talk",font_scale=1.9);
# sns.set(style="white", palette="muted", color_codes=True);
# plt.figure(figsize=(8, 6));
# violinplot=sns.violinplot(x="Odor", y="value", hue="Group", data=bdfull);
# violinplot.set(ylabel='Intensity');

In [502]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=2.2);
plt.figure(figsize=(45,20));
ax=sns.boxplot(x="Odor", y="value", hue="Group",palette={"Control": "r", "Hexanal": "b","Mint":"g"}, data=bdfull);
sns.despine()
plt.ylabel('Intensity', fontsize=48);
plt.title('Baseline F',fontsize=55);
plt.xlabel('Odor',fontsize=48);
plt.legend(loc=2,prop={'size':30});

Odor, by Mouse


In [20]:
readms=pd.read_csv('C:\Users\Annie\Documents\Data\Ca_Imaging\Analysis\Odor_Panel\Composite_MaxDF_NoP.csv')
ms = readms
del ms['Group']
ms_sorted=ms.reindex_axis(ms.mean().sort_values().index, axis=1)
ms_labels=pd.DataFrame(ms.Mouse)
tmp=[ms_labels,ms_sorted]
msdf=pd.concat(tmp,axis=1)
msfull=pd.melt(msdf,"Mouse",var_name="Odor")
msfull=msfull.dropna()
msfull.head()


Out[20]:
Mouse Odor value
0 160321_3 THA 0.212200
1 160321_3 THA 0.066122
2 160321_3 THA 0.022259
3 160321_3 THA 0.145203
4 160321_3 THA 0.155862

In [522]:
#dictionary of imaging session and labels
msgroups={'160321_3':'r', '160421_2':'r', '160502_1':'r', '160503_1':'r', '160420_1':'r',
       '160420_2':'r', '160420_3':'r', '160421_1':'r', '160421_3':'r', '160503_2':'r',
       '160310_2':'r', '160310_3':'r', '160321_1':'r', '160321_2':'r', '160517_2':'b',
       '160525_1':'b', '160620_1':'b', '160517_1':'b', '160517_3':'b', '160525_2':'b',
       '160525_3':'b', '160620_2':'b', '160620_3':'b', '160621_1':'b', '160621_2':'b',
       '160622_1':'b', '160622_2':'b', '160626_1':'b', '160626_2':'b', '160330_3':'g',
       '160328_1_B':'g', '160428_1_B':'g', '160429_1':'g', '160429_2':'g', '160325_1':'g',
       '160325_2':'g', '160325_4':'g', '160328_2':'g', '160328_3':'g', '160330_2':'g',
       '160401_1':'g'}

Composite Graphs - by session


In [529]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=2.2);
plt.figure(figsize=(45,20));
ax=sns.barplot(x="Odor", y="value", hue="Mouse",palette={'160321_3':'r', '160421_2':'r', '160502_1':'r', '160503_1':'r', '160420_1':'r',
       '160420_2':'r', '160420_3':'r', '160421_1':'r', '160421_3':'r', '160503_2':'r',
       '160310_2':'r', '160310_3':'r', '160321_1':'r', '160321_2':'r', '160517_2':'b',
       '160525_1':'b', '160620_1':'b', '160517_1':'b', '160517_3':'b', '160525_2':'b',
       '160525_3':'b', '160620_2':'b', '160620_3':'b', '160621_1':'b', '160621_2':'b',
       '160622_1':'b', '160622_2':'b', '160626_1':'b', '160626_2':'b', '160330_3':'g',
       '160328_1_B':'g', '160428_1_B':'g', '160429_1':'g', '160429_2':'g', '160325_1':'g',
       '160325_2':'g', '160325_4':'g', '160328_2':'g', '160328_3':'g', '160330_2':'g',
       '160401_1':'g'}, data=msfull);
sns.despine()
plt.ylabel('Peak DF/F', fontsize=48);
plt.title('Odor-evoked response, by session',fontsize=55);
plt.xlabel('Odor',fontsize=48);
ax.legend_.remove()

In [14]:
# sns.set(style="white", palette="muted", color_codes=True);
# sns.set_context("talk",font_scale=2.2);
# plt.figure(figsize=(45,20));
# ax=sns.violinplot(x="Odor", y="value", hue="Mouse",palette={'160321_3':'r', '160421_2':'r', '160502_1':'r', '160503_1':'r', '160420_1':'r',
#        '160420_2':'r', '160420_3':'r', '160421_1':'r', '160421_3':'r', '160503_2':'r',
#        '160310_2':'r', '160310_3':'r', '160321_1':'r', '160321_2':'r', '160517_2':'b',
#        '160525_1':'b', '160620_1':'b', '160517_1':'b', '160517_3':'b', '160525_2':'b',
#        '160525_3':'b', '160620_2':'b', '160620_3':'b', '160621_1':'b', '160621_2':'b',
#        '160622_1':'b', '160622_2':'b', '160626_1':'b', '160626_2':'b', '160330_3':'g',
#        '160328_1_B':'g', '160428_1_B':'g', '160429_1':'g', '160429_2':'g', '160325_1':'g',
#        '160325_2':'g', '160325_4':'g', '160328_2':'g', '160328_3':'g', '160330_2':'g',
#        '160401_1':'g'}, data=msfull);
# sns.despine()
# plt.ylabel('Peak DF/F', fontsize=48);
# plt.title('Odor-evoked response, by session',fontsize=55);
# plt.xlabel('Odor',fontsize=48);
# ax.legend_.remove()

In [531]:
sns.set(style="white", palette="muted", color_codes=True);
sns.set_context("talk",font_scale=2.2);
plt.figure(figsize=(55,40));
ax=sns.boxplot(x="Odor", y="value", hue="Mouse",palette={'160321_3':'r', '160421_2':'r', '160502_1':'r', '160503_1':'r', '160420_1':'r',
       '160420_2':'r', '160420_3':'r', '160421_1':'r', '160421_3':'r', '160503_2':'r',
       '160310_2':'r', '160310_3':'r', '160321_1':'r', '160321_2':'r', '160517_2':'b',
       '160525_1':'b', '160620_1':'b', '160517_1':'b', '160517_3':'b', '160525_2':'b',
       '160525_3':'b', '160620_2':'b', '160620_3':'b', '160621_1':'b', '160621_2':'b',
       '160622_1':'b', '160622_2':'b', '160626_1':'b', '160626_2':'b', '160330_3':'g',
       '160328_1_B':'g', '160428_1_B':'g', '160429_1':'g', '160429_2':'g', '160325_1':'g',
       '160325_2':'g', '160325_4':'g', '160328_2':'g', '160328_3':'g', '160330_2':'g',
       '160401_1':'g'}, data=msfull);
sns.despine()
plt.ylabel('Peak DF/F', fontsize=48);
plt.title('Odor-evoked response, by session',fontsize=55);
plt.xlabel('Odor',fontsize=48);
ax.legend_.remove()

In [ ]: