#!python

import sys

from subprocess import call

from reStUtil import *
from tecan_reader import parse

if __name__ == '__main__' :

    p = parse(sys.argv[1])

    for sheet, d in p.runs.items() :
        print 'Processing',sheet
        sheet_fn = '%s_run.rst'%sheet.replace(' ','_')
        doc = ReStDocument(sheet_fn,title=sheet+' Tecan Reads')
        label_plates = zip(d.get('labels',[]),d.get('plates',[]))
        for label, plate in label_plates :
            print plate
            plot_fn = '%s_%s.png'%(sheet.replace(' ','_'),label.replace(' ','_'))
            plate.plot_plate(''+plot_fn)
            doc.add(ReStImage(plot_fn))
        doc.write()
        doc.close()

        call('rst2pdf %s -o %s'%(sheet_fn,sheet_fn.replace('.rst','.pdf')),shell=True)
#!python

import sys

import numpy

from subprocess import call

from matplotlib.pyplot import *

from reStUtil import *
from tecan_reader import parse

if __name__ == "__main__":

    p = parse("20120821_4hr.xlsx")

    # these are the experiment and control wells for this specific run
    expt = ("A9", "B9")
    cntl = ("A10", "B10")

    # first get the average OD
    od_sheet = p.runs["OD Scan"]
    od_scans = dict(zip(od_sheet["labels"], od_sheet["scans"]))

    # we're gonna just pick 586, which I know to be index 3
    od_scan = od_scans["OD Scan"][3]
    print od_scan

    # now do the Fluorescence Scan worksheet
    fl_sheet = p.runs["Fluorescence Scan"]
import os
import sys

import numpy

from subprocess import call

from matplotlib.pyplot import *

from reStUtil import *
from tecan_reader import parse

if __name__ == '__main__' :

    fn = 'All_FPs_intensity_scans.xlsx'
    p = parse(fn)

    print "found sheets: %s"%(', '.join(p.runs.keys()))

    blank_plate1 = ('D1','E1')
    blank_plate2 = ('A2','B2')
    wt_plate1 = ('D2','E2')
    wt_plate2 = ('C2','D2')

    sn_ratios = {'RFP': (('D3','E3'),wt_plate1),
                 'mCherry': (('A6','B6'),wt_plate2),
                 'mOrange': (('D5','E5'),wt_plate1),
                 'YFP': (('D7','E7'),wt_plate1),
                 'Venus': (('D9','E9'),wt_plate1),
                 'EYFP': (('A8','B8'),wt_plate2),
                 'CFP': (('D11','E11'),wt_plate1),