Using the platereader software

The software corrects fluorescence for autofluorescence, calculates the fluorescence per cell, and estimates the growth rate and other growth characteristics.

We first import some standard packages, although these packages are only necessary if you wish to develop additional analysis beyond what the software provides. The command

%matplotlib inline

causes figures to be displayed in Jupyter rather than opening new windows.

In [1]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline 

Loading the software

The uncustomized code can be imported using

from platereader import platereader

but we have a version that takes advantages of some of the methods developed in the lab:

In [2]:
from platereader import slpr

Two files are needed: one produced by the plate reader and the other describing the contents of the wells of the plate.

In [3]:
p= slpr('ExampleData.xlsx', 'ExampleContents.xlsx')
Platereader 4.78 : loading data

ExampleData
---
Conditions:
	 2% Raf
	 0.25% Mal
	 0.5% Mal
	 1% Mal
	 1.5% Mal
	 2% Mal
	 3% Mal
	 4% Mal
Strains:
	 Mal12:GFP
	 Mal12:mCherry
	 Mal12:mCherry,Gal10:GFP
	 WT
	 null
Data types:
	 OD
	 GFP        (gain  60)
	 AutoFL     (gain  60)
	 mCherry    (gain 100)
Ignored wells:
	 None

Alternatively, with the uncustomized code,

p= platereader('ExampleData.xlsx', 'ExampleContents.xlsx')

You can also change the type of plate reader (the default is Tecan),

p= slpr('ExampleData.xlsx', 'ExampleContents.xlsx', platereadertype= 'Sunrise')

the datasheet for the data,

p= slpr('ExampleData.xlsx', 'ExampleContents.xlsx', dsheetnumber= 1)

and specify a working directory

p= slpr('ExampleData.xlsx', 'ExampleContents.xlsx', wdir= 'prdata/')

To see what variables have been created that summarize the data for each condition and strain, use

In [4]:
p.datavariables()
	AutoFL
	AutoFLmn
	AutoFLvar
	GFP
	GFPmn
	GFPvar
	OD
	ODmn
	ODvar
	ignoredwells
	mCherry
	mCherrymn
	mCherryvar
	plateloc
	time

Checking the data

You can display the data by the wells in the plate. In this example, columns 11 and 12 contain only media and no cells.

In [5]:
p.plot('OD', plate= True)
p.plot('GFP', plate= True)

You can also see the labels for each well (from ExampleContents.xlsx).

In [6]:
p.plot('labels')

Ignoring wells

Wells that appear to have substantial measurement error can be ignored. For example:

In [7]:
p.ignorewells(['B2', 'B3'])
p.plot('OD', plate= True)
Ignoring well B2
Ignoring well B3
Warning: analysis routines should be re-run

and reinstated:

In [8]:
p.ignorewells(clearall= True)
p.plot('OD', plate= True)
Warning: analysis routines should be re-run

Getting help

You can use

p.info()

to see the current status of the data processing.

Typing

help(p)

gives information on all the methods available in platereader.

Typing, for example,

help(p.correctauto)

gives information on a particular method.

The data structure

The data are stored in a Python dictionary indexed by condition and strain. The dictionary is

p.d

and you can find the variables that have been created with

In [9]:
p.datavariables()
	AutoFL
	AutoFLmn
	AutoFLvar
	GFP
	GFPmn
	GFPvar
	OD
	ODmn
	ODvar
	ignoredwells
	mCherry
	mCherrymn
	mCherryvar
	plateloc
	time
In [10]:
p.d['2% Raf']['Mal12:GFP']['plateloc'], p.d['2% Raf']['Mal12:GFP']['ODmn']
Out[10]:
(['A1', 'A2', 'A3'],
 array([ 0.25496666,  0.267     ,  0.27703333,  0.28816667,  0.2967    ,
         0.30886667,  0.31753333,  0.32866667,  0.34056666,  0.3507    ,
         0.3641    ,  0.3789    ,  0.3952    ,  0.4122    ,  0.43113333,
         0.44973334,  0.46896667,  0.48933333,  0.51016667,  0.53093334,
         0.55173335,  0.57313333,  0.59359999,  0.61360002,  0.63336668,
         0.65266669,  0.67169998,  0.6905    ,  0.70800002,  0.7246    ,
         0.74013333,  0.75533334,  0.76983333,  0.78343332,  0.79663334,
         0.80886666,  0.82013333,  0.83113335,  0.84146667,  0.85106667,
         0.86026667,  0.86913333,  0.87703333,  0.88476668,  0.89183335,
         0.89883335,  0.90523334,  0.91196666,  0.91723333,  0.92363334,
         0.9284    ,  0.9338    ,  0.93846667,  0.94260001,  0.94709998,
         0.95056667,  0.9546    ,  0.95823334,  0.96159999,  0.96520001,
         0.9685    ,  0.97110001,  0.97426667,  0.97653333,  0.97913335,
         0.9818    ,  0.98423334,  0.98616666,  0.98836666,  0.99029998,
         0.99246667,  0.99439998,  0.9965    ,  0.99803332,  0.99973333,
         1.00143333,  1.00356666,  1.00510001,  1.00636669,  1.00773335,
         1.00903336,  1.0108    ,  1.01196667,  1.01353335,  1.01453332,
         1.01590002,  1.01693336,  1.01816666,  1.01913329,  1.02013334,
         1.0211333 ,  1.02210001,  1.02326663,  1.02459999,  1.02583333,
         1.02599998,  1.02699999,  1.02803338,  1.02910002,  1.02953331,
         1.03049997,  1.03120001,  1.03246665,  1.03316665,  1.03396666]))

for example, gives the wells where the strain is located on the plate and the mean OD at each time point averaged across all replicates. You can use

p.info()

or

p.allconditions

or

p.allstrains

or

p.alldata

to find the conditions and strains that exist in the data set.

Analysing OD data: correcting for non-linearities and for the media

There is a non-linear relationship between OD and cell number. We have calibration data that allows you to correct for this non-linearity.

You can change this calibration data when you first load your data. The default file (which need not be specified) is

p= slpr('ExampleData.xlsx', 'ExampleContents.xlsx', 
    ODfname= 'ODcorrection_Glucose_Haploid.txt')

but there is data for haploids growing in raffinose and for diploids growing in glucose.

There is also a signal from the media in which the cells are growing. Running p.correctOD() automatically calls p.correctmedia(), but you can call this first explicitly:

p.correctmedia()

Typically, there is a well for each media, but you can also use one media to correct all the strains regardless of the media that they are actually growing in:

p.correctmedia(commonmedia= 'SD 2% Glu')

or, to be more specific,

p.correctmedia(conditionincludes= 'Glu', conditionexcludes= ['NaCl', 'HP'], 
               commonmedia= 'SD 2% Glu')

which uses SD 2% Glu to correct all wells whose condition contains the word Glu but not the words NaCl and HP.

In [11]:
p.correctOD()
Correcting OD in 0.25% Mal for media
Correcting OD in 0.5% Mal for media
Correcting OD in 1% Mal for media
Correcting OD in 1.5% Mal for media
Correcting OD in 2% Mal for media
 Warning: linear algebra error - trying a different initial condition
Correcting OD in 2% Raf for media
Correcting OD in 3% Mal for media
Correcting OD in 4% Mal for media
Fitting dilution data for OD correction for non-linearities
Using ODcorrection_Glucose_Haploid.txt

Wells are first corrected for the contribution of the media to the OD and then the OD is corrected for non-linearities. The function used for this correction is also plotted. Note that the corrected values (the relative cell density) are in arbitrary units.

You can change the calibration data used here too:

p.correctOD(ODfname= 'ODcorrection_Raffinose_Haploid.txt')

Analysing OD data: plotting

When plotting, useful options are:

p.plot('OD', onefig= True)

to have all the data plotted in a single figure, and specifying

conditionincludes

and

strainincludes

Both these commands include only conditions or strains whose names contain the text specified. You do not need to specify the full name.

The two options

conditionexcludes

and

strainexcludes

ignore conditions or strains whose names contain the text specified.

In [12]:
p.plot('OD', onefig= True, strainincludes= 'Gal10:GFP')
p.plot('OD', onefig= True, conditionincludes= '0.25')
p.plot('OD', onefig= True, conditionincludes= '0.25', strainexcludes= 'null')
p.plot('ODmn', conditions= '0.25% Mal', strains= 'Mal12:GFP', errors= True)

The numbers of the wells for each strain are also specified to allow you to check if any wells should not be included in the data analysis.

Analysing OD data: estimating growth rates

You can estimate growth rates using all replicates for each strain in each condition using a Gaussian process-based algorithm.

In [13]:
p.getstats(strainincludes='Mal12:GFP', conditionincludes= '0.25')
Fitting OD for Mal12:GFP in 0.25% Mal
Taking natural logarithm of the data.
Fitting measurement errors.
Using a squared exponential Gaussian process.
hparam[0] determines the amplitude of variation
hparam[1] determines the flexibility
hparam[2] determines the variance of the measurement error
log(max likelihood)= 7.277067e+02
hparam[0]= 2.356003e+00 [1.000000e-05, 1.000000e+05]
hparam[1]= 7.449836e-02 [1.000000e-06, 1.000000e+02]
hparam[2]= 3.973799e-04 [1.000000e-05, 1.000000e+02]

Calculating statistics with 100 samples
	(displaying mean +/- standard deviation [standard error])

         max growth rate= 2.388723e-01 +/- 3.966608e-03 [3.966608e-04]
 time of max growth rate= 3.254213e+00 +/- 4.016614e-02 [4.016614e-03]
           doubling time= 2.902549e+00 +/- 4.829303e-02 [4.829303e-03]
                  max OD= 2.220511e-01 +/- 1.541645e-03 [1.541645e-04]
                lag time= 1.062556e+00 +/- 4.902381e-02 [4.902381e-03]