示例#1
0
def LoadCSV2DB(filename):
    db = MySQLDatabase(host='132.77.80.238',
                       user='******',
                       passwd='a1a1a1',
                       db='primero')
    counter = 1
    for row in csv.reader(open(filename, 'r')):
        loc_id = int(row[1])
        name = row[2]
        seq = row[3]
        seq = seq.replace(" ", "")

        if name == "":
            continue

        box = int(floor(loc_id / 81)) + 1
        residual = loc_id % 81
        row = chr(int(floor(residual / 9)) + 65)
        residual = residual % 9
        col = residual + 1

        db.Insert('primers_primer',
                  [counter, name, box, row, col, seq, '', loc_id])
        counter += 1
        db.Commit()
示例#2
0
def main():

    options = MakeOpts().parse_args()
    VOL = options.vol
    LABWARE = 'GRID40SITE3' 
    LIQ = options.liquid_class
    
    # We should also state which directory where the evoware could find the worklist file

    db = MySQLDatabase(host=options.host, user='******', port=3306,
                       passwd='a1a1a1', db='tecan')
    
    plate_id = options.iteration % options.num_plates

    exp_id, max_time = GetLastPlate(db, plate_id, options.reading_label)
    data = GetMeasuredData(db, exp_id, max_time, plate_id, options.reading_label)
    dilution_rows = GetDilutionRows(db, exp_id, plate_id, max_time, options.row_split)
    print "dilution_rows:\n", dilution_rows
    
    worklist = []
    for split in xrange(dilution_rows.shape[0]):
        for col in xrange(dilution_rows.shape[1]):
            row = dilution_rows[split, col]
            meas = data[row, col]
            print col, row, meas
            if (meas > options.threshold) and ( (row+1) % (8/options.row_split) != 0 ):
                msg = "OD = %f --> dilute cell %s%d into cell %s%d" % (meas, chr(ord('A') + row), col+1, chr(ord('A') + row + 1), col+1)
                print msg
                worklist += [UserPrompt(msg)]
                worklist += [Comm('A',LABWARE,row,col,VOL,LIQ)]
                worklist += [Comm('D',LABWARE,row+1,col,VOL,LIQ)]
                #labware,volume and liquid_class would be hard coded for now ...
                worklist += [Tip()]
                IncrementRow(db, exp_id, plate_id, col, row+1, max_time)
    
    db.Commit()
    
    if len(worklist) == 0:
        sys.exit(0)
    
    worklist = Header() + worklist + Footer()
    f = open(options.worklist[0], 'w')
    f.write('\n'.join(worklist))
    f.close()
    print "Done!"
    sys.exit(1)
示例#3
0
def main():

    options = MakeOpts().parse_args()
    path_dict = ReadPathCsv(options)

    VOL = options.vol
    MEDIA_VOL = 150 - VOL  #volune of fresh media in designated well

    LABWARE = 'GRID40SITE3'
    EPNSTAND = 'EpnStand'

    LIQ = options.liquid_class

    # We should also state which directory where the evoware could find the worklist file

    db = MySQLDatabase(host=options.host,
                       user='******',
                       port=3306,
                       passwd='a1a1a1',
                       db='tecan')

    exp_id_dict, plate_id = read_exp_id_csv(options.exp_id_csv)

    if options.plate not in exp_id_dict:
        error(
            'The measured plate (%d) does not have an exp_id in the CSV file' %
            options.plate)

    exp_id = exp_id_dict[options.plate]

    max_time = GetLastPlate(db, exp_id, plate_id, options.reading_label)
    data = GetMeasuredData(db, exp_id, max_time, plate_id,
                           options.reading_label)
    path_step_dict = GetPathSteps(db, exp_id, plate_id, max_time, path_dict)

    worklist = []
    for path_label, path_step in path_step_dict.iteritems():
        row, col = path_dict[path_label][path_step]
        meas = data[row, col]
        print path_label, path_step, col, row, meas
        if (meas > options.threshold) and (path_step <
                                           len(path_dict[path_label]) - 1):
            next_row, next_col = path_dict[path_label][path_step + 1]
            msg = "Current plate is : %d ) %s __ OD = %f --> dilute cell %s%d into cell %s%d" % (
                options.plate, exp_id, meas, chr(ord('A') + row), col + 1,
                chr(ord('A') + next_row), next_col + 1)
            print msg
            worklist += [UserPrompt(msg)]
            worklist += [Comm('A', EPNSTAND, 0, 0, MEDIA_VOL, LIQ)]
            worklist += [
                Comm('D', LABWARE, next_row, next_col, MEDIA_VOL, LIQ)
            ]
            worklist += [Comm('A', LABWARE, row, col, VOL, LIQ)]
            worklist += [Comm('D', LABWARE, next_row, next_col, VOL, LIQ)]
            #labware,volume and liquid_class would be hard coded for now ...
            worklist += [Tip()]
            IncrementRow(db, exp_id, plate_id, path_label, path_step + 1,
                         max_time, row, col, next_row, next_col)

    db.Commit()

    if len(worklist) == 0:
        sys.exit(0)

    worklist = Header() + worklist + Footer()
    f = open(options.worklist[0], 'w')
    f.write('\n'.join(worklist))
    f.close()
    print "Done!"
    sys.exit(1)