# Data Analysis: Molecular Predators-Prey Ecosystem Experiment¶

In this report, we try to analyse the data from the experience "Molecular Predators-Prey Ecosystem Experiment" cuducted at the ENS Lyon during the 2017 Winter school Molecular programing: from theory to wet lab nano-scale computation.

## Data pre-processing¶

In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.style
import matplotlib.lines as mlines

%matplotlib inline
matplotlib.style.use('ggplot')


In [2]:
data = pd.read_csv("exp.csv")


After that we treat the data: we separate the experiment in different tables.

In [3]:
letters = 'ABCDEFGHIJKL'
results = {
(letters[j], 3.5-0.5*i): data.loc[data['Well'] == letters[i] + str(j+1)]
for i in range(8) for j in range(12)
}


## 1) Evolution plots¶

Let's define beautiful colors:

In [4]:
red = "firebrick"
blue = "steelblue"


Then we plot the data in a 8x12 matrix (or see the attached file fig1.svg). The order is the same as the table in the TP sheet.

In [5]:
f, ax = plt.subplots(8, 12, sharex='col', sharey='row', figsize=(32,24))

for j, L in enumerate(letters):
for i, g in enumerate(g / 2 for g in range(7,-1,-1)):
fam = results[L, g].plot(x='Cycle', y='FAM', style='-', ax = ax[i][j], color=red)
joe = results[L, g].plot(x='Cycle', y='JOE', style='-', ax = ax[i][j], color=blue)
ax[i][j].legend().remove()
ax[i][j].axis('auto')

red_line = mlines.Line2D([], [], color=red, markersize=15, label='FAM')
blue_line = mlines.Line2D([], [], color=blue, markersize=15, label='JOE')

handles = [red_line,blue_line]
labels = [h.get_label() for h in handles]

f.legend(handles=handles, labels=labels)

f.savefig("fig1.svg")