Executed: Mon Mar 27 11:38:35 2017
Duration: 3 seconds.
In [1]:
data_file = 'results/usALEX-5samples-PR-raw-dir_ex_aa-fit-AexAem.csv'
The data has been generated by running the template notebook usALEX-5samples-PR-raw-dir_ex_aa-fit-AexAem for each sample.
To recompute the PR data used by this notebook run the 8-spots paper analysis notebook.
In [2]:
from __future__ import division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format='retina' # for hi-dpi displays
sns.set_style('whitegrid')
palette = ('Paired', 10)
sns.palplot(sns.color_palette(*palette))
sns.set_palette(*palette)
In [3]:
data = pd.read_csv(data_file).set_index('sample')
data
Out[3]:
In [4]:
data.columns
Out[4]:
In [5]:
d = data[[c for c in data.columns if c.startswith('dir')]]
d.plot(kind='line', lw=3, title='Direct Excitation Coefficient')
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0., frameon=False);
In [6]:
dir_ex_aa = np.average(data.dir_ex_S_kde_w5, weights=data.n_bursts_aa)
'%.5f' % dir_ex_aa
Out[6]:
In [7]:
with open('results/usALEX - direct excitation coefficient dir_ex_aa.csv', 'w') as f:
f.write('%.5f' % dir_ex_aa)
In [8]: