Exemplo n.º 1
0
def protocolPage(protocol_id):
    protocol = getProtocol(protocol_id)
    if not os.path.exists('protocol_files/{}.py'.format(protocol_id)):
        getDownload(protocol_id)
    labware = findLabware(protocol_id)
    pipettes = findPipettes(protocol_id)
    metadata = findMetadata(protocol_id)
    modFields = []
    wellmap = 'false'
    for data in metadata:
        if data['field'].lower() == 'modify':
            if data['value'].lower() == 'true':
                modFields = findModFields(protocol_id)
        if data['field'].lower() == 'well-map':
            if data['value'].lower() == 'true':
                wellmap = 'true'
    return render_template('protocol.html',
                           id=protocol_id,
                           name=protocol['name'],
                           modifiedTime=protocol['modifiedTime'],
                           pipettes=pipettes,
                           labware=labware,
                           metadata=metadata,
                           modFields=modFields,
                           wellmap=wellmap)
Exemplo n.º 2
0
def ApplyWellMap(filename, wellmap):
    folder = "TemporaryFiles"
    temp_filename = 'temp_' + filename
    editScriptRTPCR(folder, temp_filename, wellmap)
    modFields = findModFields(folder, temp_filename)
    if modFields != []:
        return redirect(url_for('Modify', filename=filename))
    return redirect(url_for('Confirm', filename=filename))
Exemplo n.º 3
0
def HistoryConfirm(filename):
    folder = "History/{}".format(filename)
    labware = findLabware(folder, filename)
    pipettes = findPipettes(folder, filename)
    metadata = findMetadata(folder, filename)
    modFields = findModFields(folder, filename)
    description = getHistoryDescription(folder)
    return render_template('confirm.html', protocol=filename, labwareList=labware, pipetteList=pipettes, metadataList = metadata, modFieldList=modFields, history=True, description=description)
Exemplo n.º 4
0
def Protocol(filename):
    folder = "ProtocolFiles"
    labware = findLabware(folder, filename)
    pipettes = findPipettes(folder, filename)
    metadata = findMetadata(folder, filename)
    modFields = findModFields(folder, filename)
    makeTempFile(filename)
    wellMap = wellMapEnabled(metadata)
    return render_template('protocol.html', protocol=filename, labwareList=labware, pipetteList=pipettes, metadataList=metadata, modFieldList=modFields, wellMapEnabled=wellMap)
Exemplo n.º 5
0
def ProtocolHistory(filename):
    folder = "History/{}".format(filename)
    labware = findLabware(folder, filename)
    pipettes = findPipettes(folder, filename)
    metadata = findMetadata(folder, filename)
    modFields = findModFields(folder, filename)
    wellmap = findWellmap(folder, filename)
    simulationLog = simulateScript(folder, filename)
    description = getHistoryDescription(folder)
    return render_template('confirm.html', protocol=filename, labwareList=labware, pipetteList=pipettes, metadataList = metadata, modFieldList=modFields, history=True, wellmap=wellmap, simulationLog=simulationLog[1], error=simulationLog[0], description=description)
Exemplo n.º 6
0
def Confirm(filename):
    temp_filename = 'temp_' + filename
    folder = "TemporaryFiles"
    labware = findLabware(folder, temp_filename)
    pipettes = findPipettes(folder, temp_filename)
    metadata = findMetadata(folder, temp_filename)
    modFields = findModFields(folder, temp_filename)
    wellmap = findWellmap(folder, temp_filename)
    simulationLog = simulateScript(folder, temp_filename)
    return render_template('confirm.html', protocol=filename, labwareList=labware, pipetteList=pipettes, metadataList = metadata, modFieldList=modFields, history=False, wellmap=wellmap, simulationLog=simulationLog[1], error=simulationLog[0])
Exemplo n.º 7
0
def Modify(filename):
    folder = "ProtocolFiles"
    modFields = findModFields(folder, filename)
    form = modifyForm(fields=modFields)
    if form.validate_on_submit():
        results=[]
        for data in enumerate(form.fields.data):
            results.append(data)
        editModFields(filename, results)
        return redirect(url_for('Confirm', filename=filename))
    return render_template('modify.html', protocol=filename, form=form, modFieldList=modFields)
Exemplo n.º 8
0
def protocolConfirm(protocol_id):
    protocol = getProtocol(protocol_id)
    modfields = []
    modFields = findModFields(protocol_id)
    return render_template('confirm.html',
                           protocol_id=protocol_id,
                           protocol_name=protocol['name'],
                           modifiedTimeProtocol=protocol['modifiedTime'],
                           wellmap_info=None,
                           wellmap_name=None,
                           wellmapdata=None,
                           modFields=modFields)
Exemplo n.º 9
0
def wellMapConfirm(protocol_id, wellmap_id):
    protocol = getProtocol(protocol_id)
    wellmap = getWellMap(wellmap_id)
    wellmapdata = getWellMapData(wellmap_id)
    editScriptRTPCR(protocol_id, wellmapdata)
    modfields = []
    modFields = findModFields(protocol_id)
    return render_template('confirm.html',
                           protocol_id=protocol_id,
                           protocol_name=protocol['name'],
                           modifiedTimeProtocol=protocol['modifiedTime'],
                           wellmap_id=wellmap_id,
                           wellmap_name=wellmap['name'],
                           wellmapdata=wellmapdata,
                           modifiedTimeWellmap=wellmap['modifiedTime'],
                           modFields=modFields)
Exemplo n.º 10
0
def modifyPage(protocol_id):
    modFields = findModFields(protocol_id)
    # fields = []
    # for field in modFields:
    #     fields.append(field['value'])
    form = modifyForm(fields=modFields)
    if form.validate_on_submit():
        results = []
        for data in enumerate(form.fields.data):
            results.append(data)
        editModFields(protocol_id, results)
        return redirect(url_for('protocolPage', protocol_id=protocol_id))
    protocol = getProtocol(protocol_id)
    return render_template('modify.html',
                           id=protocol_id,
                           name=protocol['name'],
                           form=form,
                           modFields=modFields)
Exemplo n.º 11
0
def sendPage(protocol_id):
    protocol = getProtocol(protocol_id)
    wellmap = None
    modfields = []
    modFields = findModFields(protocol_id)

    fields = ['description']
    form = modifyForm(fields=fields)
    if form.validate_on_submit():
        results = []
        for data in enumerate(form.fields.data):
            results.append(data)
        sendProtocol(protocol)
        saveHistory(protocol, wellmap, modFields, results)
        return render_template('send.html',
                               id=protocol_id,
                               name=protocol['name'])
    return render_template('description.html',
                           id=protocol_id,
                           name=protocol['name'],
                           form=form)