Пример #1
0
def main():
    """
        Imports an XLS file of Victor exported results.
        The Experiment ID is determined by the time-stamp of the first measurement.
    """

    options = MakeOpts().parse_args()

    if options.debug:
        db = CreateDummyDB()
    else:
        db = MySQLDatabase(host=options.host,
                           user='******',
                           port=3306,
                           passwd='a1a1a1',
                           db='tecan')

    if not os.path.exists(options.xls_file):
        print "File not found: " + options.xls_file
        sys.exit(-1)

    print "Importing from file: " + options.xls_file
    fp = open(options.xls_file, 'r')
    exp_id = VictorParser.ImportFileToDB(fp, db, options.exp_id)
    if options.debug:
        print "Done, go check out the results at %s" % db.filename
    else:
        print "Done, go check out the results at http://eladpc1/RoboSite/Exp/%s/0" % exp_id
Пример #2
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
from matplotlib.backends.backend_pdf import PdfPages
import sys, os

if (not os.path.exists('../res')):
    os.mkdir('../res')

vp = VictorParser()
fname = "../data/OD_eGFP_20100711_190.xls"
vp.parse_excel(fname)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()

fit_window_size = 1.5 # hours
fit_start_threshold = 0.01

columns = [('4K5',      0, 'y'),\
           ('GFP-A',     1, 'r'),\
           ('GFP-B',       2, 'g'),\
           ('GFP-C', 3, 'c'),\
           ('GFP-D',       4, 'c:'),\
Пример #3
0
    for vp in vp_vec:
        (time, value) = vp.get_data(index, row, col)
        time_array = hstack([time_array, time + last_t])
        value_array = hstack([value_array, value])
        if (len(time_array) > 0):
            last_t = time_array.max()

    return (time_array, value_array)


if (not os.path.exists('../res')):
    os.mkdir('../res')

name = "elad_100903_ace_lux"
vp_vec = []
vp = VictorParser()
vp.parse_excel("../data/%s.xls" % (name))
vp_vec.append(vp)

pp = PdfPages('../res/%s.pdf' % name)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()
Пример #4
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
from matplotlib.backends.backend_pdf import PdfPages
import sys, os

if (not os.path.exists('../res')):
    os.mkdir('../res')

vp = VictorParser()
name = "RBS-GFP 28-07-10"
fname = "../data/%s.xls" % name
if (not os.path.exists(fname)):
    raise Exception("Cannot locate the Excel file: " + fname)
vp.parse_excel(fname)
pp = PdfPages('../res/%s.pdf' % name)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()

fit_window_size = 1.5 # hours
fit_start_threshold = 0.01

plot_types = [(0, "OD", 0.001, 1), (1, "GFP", 1e3, 1e6), ("divide", "GFP/OD", 1e4, 2e6)]
Пример #5
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
import sys

vp = VictorParser()
fname = "../data/victor/Elad's OD600_20100629_186.xls"
vp.parse_excel(fname)
# (t, v) = vp.get_data(0, 0, 0)
# fit_growth(t, v, 1.5, plot_figure=True)
# sys.exit(0)

figure(figsize=(5, 7))
rcParams["text.usetex"] = True
rcParams["legend.fontsize"] = 6
rcParams["font.family"] = "sans-serif"
rcParams["font.size"] = 8
rcParams["lines.linewidth"] = 0.6
rcParams["lines.markersize"] = 2

fit_window_size = 1.5  # hours
fit_start_threshold = 0.01
leg = ["SOC+kana", "M9+CAS+Glu+kana", "M9+AA+Nt+Glu+kana", "M9+Glu+kana", "M9+Acetate+kana"]
color = ["g", "r", "b", "m", "c"]
gr_mat = zeros((5, 10))

subplot(2, 1, 1)
for c in range(0, 5):
    for r in range(5):
        (t, v) = vp.get_data(0, r, c)
        plot(t, v - min(v), color[r])
Пример #6
0
    last_t = 0
    for vp in vp_vec:
        (time, value) = vp.get_data(index, row, col)
        time_array = hstack([time_array, time + last_t])
        value_array = hstack([value_array, value])
        if (len(time_array) > 0):
            last_t = time_array.max()

    return (time_array, value_array)

if (not os.path.exists('../res')):
    os.mkdir('../res')

name = "elad_100903_ace_lux"
vp_vec = []
vp = VictorParser()
vp.parse_excel("../data/%s.xls" % (name))
vp_vec.append(vp)

pp = PdfPages('../res/%s.pdf' % name)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()
Пример #7
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
from matplotlib.backends.backend_pdf import PdfPages
import sys, os

if (not os.path.exists('../res')):
    os.mkdir('../res')

vp = VictorParser()
name = "d100805_elad_LUX"
fname = "../data/%s.xls" % name
if (not os.path.exists(fname)):
    raise Exception("Cannot locate the Excel file: " + fname)
vp.parse_excel(fname)
pp = PdfPages('../res/%s.pdf' % name)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()

fit_window_size = 1.5  # hours
fit_start_threshold = 0.01

plots = []  # (title, victor_index, (t_min, t_max), (y_min, y_max), y_label,
Пример #8
0
"""
    time       - a vector of the time of each measurement (in hours)
    cell_count - a vector of the cell-count at each time point
    window     - the size of the window for which to calculate the growth rates (in hours)
    start_time - the time point after which the input data can be trusted

    Note: the cell_count can be any measure that is proportional to the
    number of cells. For example, Optical Density (in OD), or level of
    luminescence (in CPS).
"""
from victor_parser import VictorParser
import pylab

if (__name__ == "__main__"):
    vp = VictorParser()
    fname = "../data/Elad's OD600_20100701_188.xls"
    vp.parse_excel(fname)
    (time, cell_count) = vp.get_data(0, 3, 0)

    pylab.figure()
    pylab.subplot(1,2,1)
    print "Logistic fit: gr = %.2f" % vp.fit_growth2(time, cell_count, plot_figure=True)
    pylab.subplot(1,2,2)
    print "linear fit in logscale: gr = %.2f" %  vp.fit_growth(time, cell_count, window_size=1.5, start_threshold=0.01, plot_figure=True)
    pylab.show()
Пример #9
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
from matplotlib.backends.backend_pdf import PdfPages
import sys

vp = VictorParser()
fname = "../data/Elad's OD600_20100701_188.xls"
vp.parse_excel(fname)
#(t, v) = vp.get_data(0, 0, 0)
#fit_growth(t, v, 1.5, plot_figure=True)
#sys.exit(0)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 8
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()

fit_window_size = 1.5 # hours
fit_start_threshold = 0.01

rows = [('SOC',      0, 'y'),\
        ('casa',     1, 'r'),\
        ('DO',       2, 'g'),\
        ('AA+dntos', 3, 'c'),\
        ('AA',       4, 'c:'),\
Пример #10
0
import sys, os


def get_data(index, row, col, vp1, vp2):
    (time1, value1) = vp1.get_data(index, row, col)
    (time2, value2) = vp2.get_data(index, row, col)
    
    last_t1 = time1.max()
    time = array([t for t in time1] + [(t + last_t1) for t in time2])
    value = hstack([value1, value2])
    return (time, value)

if (not os.path.exists('../res')):
    os.mkdir('../res')

vp1 = VictorParser()
vp2 = VictorParser()
name = "d100805_elad_LUX"
vp1.parse_excel("../data/%s_1.xls" % name)
vp2.parse_excel("../data/%s_2.xls" % name)
pp = PdfPages('../res/%s.pdf' % name)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()
Пример #11
0
"""
    time       - a vector of the time of each measurement (in hours)
    cell_count - a vector of the cell-count at each time point
    window     - the size of the window for which to calculate the growth rates (in hours)
    start_time - the time point after which the input data can be trusted

    Note: the cell_count can be any measure that is proportional to the
    number of cells. For example, Optical Density (in OD), or level of
    luminescence (in CPS).
"""
from victor_parser import VictorParser
import pylab

if (__name__ == "__main__"):
    vp = VictorParser()
    fname = "../data/Elad's OD600_20100701_188.xls"
    vp.parse_excel(fname)
    (time, cell_count) = vp.get_data(0, 3, 0)

    pylab.figure()
    pylab.subplot(1, 2, 1)
    print "Logistic fit: gr = %.2f" % vp.fit_growth2(
        time, cell_count, plot_figure=True)
    pylab.subplot(1, 2, 2)
    print "linear fit in logscale: gr = %.2f" % vp.fit_growth(
        time,
        cell_count,
        window_size=1.5,
        start_threshold=0.01,
        plot_figure=True)
    pylab.show()
Пример #12
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
from matplotlib.backends.backend_pdf import PdfPages
import sys, os

if (not os.path.exists('../res')):
    os.mkdir('../res')

vp = VictorParser()
name = "d100721_dor_PRK_IPTG"
fname = "../data/%s.xls" % name
pp = PdfPages('../res/%s.pdf' % name)

vp.parse_excel(fname)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()

fit_window_size = 1.5 # hours
fit_start_threshold = 0.01

#                  1          2         3          4        5       6       7      8
#               B(SN)PRK  B(SN)PRK  B(SN)PRK    B_GFP    B_GFP    B_GFP    NTC    NTC
Пример #13
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
import sys

vp = VictorParser()
fname = "../data/victor/Elad's OD600_20100629_186.xls"
vp.parse_excel(fname)
#(t, v) = vp.get_data(0, 0, 0)
#fit_growth(t, v, 1.5, plot_figure=True)
#sys.exit(0)

figure(figsize=(5, 7))
rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 6
rcParams['font.family'] = 'sans-serif'
rcParams['font.size'] = 8
rcParams['lines.linewidth'] = 0.6
rcParams['lines.markersize'] = 2

fit_window_size = 1.5  # hours
fit_start_threshold = 0.01
leg = [
    'SOC+kana', 'M9+CAS+Glu+kana', 'M9+AA+Nt+Glu+kana', 'M9+Glu+kana',
    'M9+Acetate+kana'
]
color = ['g', 'r', 'b', 'm', 'c']
gr_mat = zeros((5, 10))

subplot(2, 1, 1)
for c in range(0, 5):
Пример #14
0
from victor_parser import VictorParser
from pylab import *
from matplotlib import font_manager
from matplotlib.backends.backend_pdf import PdfPages
import sys, os

if (not os.path.exists('../res')):
    os.mkdir('../res')

vp = VictorParser()
name = "d100805_elad_LUX"
fname = "../data/%s.xls" % name
if (not os.path.exists(fname)):
    raise Exception("Cannot locate the Excel file: " + fname)
vp.parse_excel(fname)
pp = PdfPages('../res/%s.pdf' % name)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()

fit_window_size = 1.5 # hours
fit_start_threshold = 0.01

plots = [] # (title, victor_index, (t_min, t_max), (y_min, y_max), y_label, 
Пример #15
0
    for vp in vp_vec:
        (time, value) = vp.get_data(index, row, col)
        time_array = hstack([time_array, time + last_t])
        value_array = hstack([value_array, value])
        if (len(time_array) > 0):
            last_t = time_array.max()

    return (time_array, value_array)

if (not os.path.exists('../res')):
    os.mkdir('../res')

name = "elad_100819_ace_lux"
vp_vec = []
for i in range(1, 3):
    vp = VictorParser()
    vp.parse_excel("../data/%s_%d.xls" % (name, i))
    vp_vec.append(vp)

pp = PdfPages('../res/%s.pdf' % name)

#rcParams['text.usetex'] = True
rcParams['legend.fontsize'] = 12
#rcParams['font.family'] = 'sans-serif'
#rcParams['font.size'] = 8
#rcParams['lines.linewidth'] = 0.3
#rcParams['lines.markersize'] = 2
#rcParams['figure.figsize'] = [5, 10]
#rcParams['figure.subplot.hspace'] = 0.3
#figure()