This notebook contains some charts to validate our solid media growth assays and to compare the two machines (Tecan and SpectraMax) we used.
In [1]:
%pylab inline
import pandas as pd
In [2]:
df = pd.DataFrame.from_csv('OD600_tecan.csv')
In [51]:
plot( df.index/24, df['Bacillus safensis'], label='Bacillus safensis' )
plot( df.index/24, df['Microbacterium arborescens'], label='Microbacterium arborescens' )
plot( df.index/24, df['Empty'], label='Empty' )
lgd = legend(bbox_to_anchor=(0, -0.35), loc=3, ncol=2, frameon=False )
xticks( [1,2,3,4] )
xlabel('Days')
yticks( [0.2, 0.4, 0.6, 0.8, 1.0] )
ylim(0,1.2)
ylabel('OD600')
title('OD600 on solid media (Tecan)')
savefig('OD600_tecan.png', bbox_extra_artists=(lgd,), bbox_inches='tight')
savefig('OD600_tecan.pdf', bbox_extra_artists=(lgd,), bbox_inches='tight')
In [146]:
ground1 = pd.read_csv( 'Tecan_final_ground1.csv', index_col='Well' )
ground2 = pd.read_csv( 'Tecan_final_ground2.csv', index_col='Well' )
ground3 = pd.read_csv( 'Tecan_final_ground3.csv', index_col='Well' )
space1 = pd.read_csv( 'Tecan_final_space1.csv', index_col='Well' )
space2 = pd.read_csv( 'Tecan_final_space2.csv', index_col='Well' )
space3 = pd.read_csv( 'Tecan_final_space3.csv', index_col='Well' )
ground1.head()
Out[146]:
In [147]:
rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' ]
cols = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12' ]
ground1_map = pd.read_csv( 'platemap_ground1.csv', index_col=False, header=None, names=cols )
ground2_map = pd.read_csv( 'platemap_ground2.csv', index_col=False, header=None, names=cols )
ground3_map = pd.read_csv( 'platemap_ground3.csv', index_col=False, header=None, names=cols )
space1_map = pd.read_csv( 'platemap_space1.csv', index_col=False, header=None, names=cols )
space2_map = pd.read_csv( 'platemap_space2.csv', index_col=False, header=None, names=cols )
space3_map = pd.read_csv( 'platemap_space3.csv', index_col=False, header=None, names=cols )
ground1_map.index = rows
ground2_map.index = rows
ground3_map.index = rows
space1_map.index = rows
space2_map.index = rows
space3_map.index = rows
ground1_map
Out[147]:
In [148]:
def flatten_platemap( platemap ) :
rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' ]
cols = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12' ]
flatmap = {}
for row in rows :
for col in cols :
flatmap[row+col] = ground1_map[col][row]
return flatmap
ground1 = ground1.join( pd.DataFrame( { 'team' : flatten_platemap(ground1_map) } ) )
ground2 = ground2.join( pd.DataFrame( { 'team' : flatten_platemap(ground2_map) } ) )
ground3 = ground3.join( pd.DataFrame( { 'team' : flatten_platemap(ground3_map) } ) )
space1 = space1.join( pd.DataFrame( { 'team' : flatten_platemap(space1_map) } ) )
space2 = space2.join( pd.DataFrame( { 'team' : flatten_platemap(space2_map) } ) )
space3 = space3.join( pd.DataFrame( { 'team' : flatten_platemap(space3_map) } ) )
ground1.head()
Out[148]:
In [149]:
teams = pd.read_csv( 'spacebugs.tsv', sep='\t', names=['team','source','species','short name'] )
ground1 = ground1.merge( teams, on='team' )
ground2 = ground2.merge( teams, on='team' )
ground3 = ground3.merge( teams, on='team' )
space1 = space1.merge( teams, on='team' )
space2 = space2.merge( teams, on='team' )
space3 = space3.merge( teams, on='team' )
groundmeans = ground1[ ['Mean', 'short name'] ]
groundmeans = groundmeans.append( ground2[ ['Mean', 'short name'] ] )
groundmeans = groundmeans.append( ground3[ ['Mean', 'short name'] ] )
spacemeans = space1[ ['Mean', 'short name'] ]
spacemeans = spacemeans.append( space2[ ['Mean', 'short name'] ] )
spacemeans = spacemeans.append( space3[ ['Mean', 'short name'] ] )
In [150]:
ground = {}
for name in set(groundmeans['short name']) :
ground[name] = mean(groundmeans[ groundmeans['short name'] == name ]['Mean'])
space = {}
for name in set(spacemeans['short name']) :
space[name] = mean(spacemeans[ spacemeans['short name'] == name ]['Mean'])
data = pd.DataFrame( { 'tecan_ground' : ground, 'tecan_space' : space } )
In [152]:
df_sptmx = pd.read_csv( 'Space_vs_Ground.tsv', sep='\t', index_col=False ).set_index('n')
data = df_sptmx.join( data, on='short name' )
data.head()
Out[152]:
In [153]:
figure(figsize=(8, 4))
subplot(1,2,1)
plot( data['space 96h OD'], data['tecan_space'], 'ro' )
title('Space')
xlabel('SpetraMax OD600')
ylabel('Tecan OD600')
subplot(1,2,2)
plot( data['ground 96h OD'], data['tecan_ground'], 'ro' )
title('Ground')
xlabel('SpetraMax OD600')
ylabel('Tecan OD600')
tight_layout()
In [154]:
from scipy.stats import pearsonr
# Pearson's correlation of Tecan and SpectraMax data for space
pcc, p = pearsonr( data['space 96h OD'], data['tecan_space'] )
print 'PCC :', pcc
print 'p value :', p
In [159]:
# Pearson's correlation of Tecan and SpectraMax data for ground
pcc, p = pearsonr( data['ground 96h OD'], data['tecan_ground'] )
print 'PCC :', pcc
print 'p value :', p
In [160]:
figure(figsize=(8, 4))
subplot(1,2,1)
plot( data['tecan_ground'], data['tecan_space'], 'ro' )
title( 'Space vs. Ground (Tecan)' )
xlabel('ground')
ylabel('space')
subplot(1,2,2)
plot( data['ground 96h OD'], data['space 96h OD'], 'ro' )
title( 'Space vs. Ground (SpectraMax)' )
xlabel('ground')
ylabel('space')
tight_layout()
In [157]:
# Pearson's correlation of ground and space data for Tecan data
pcc, p = pearsonr( data['tecan_ground'], data['tecan_space'] )
print 'PCC :', pcc
print 'p value :', p
In [161]:
# Pearson's correlation of ground and space data for SpectraMax data
pcc, p = pearsonr( data['ground 96h OD'], data['space 96h OD'] )
print 'PCC :', pcc
print 'p value :', p