Пример #1
0
 def __plate_setup_name_form(self, setup=None):
     project_field = fl.project_field(setup.project.id if setup and setup.project else None, active_only=True, empty='')
     author_field = fl.person_field(setup.author.id if setup and setup.author else None)
     person_field = fl.person_field(setup.droplet_maker_id if setup and setup.droplet_maker_id else None)
     return h.LiteralFormSelectPatch(
         value = {'author_id': unicode(author_field['value']),
                  'project_id': unicode(project_field['value']),
                  'droplet_maker_id': unicode(person_field['value']),
                  'name': setup.name if setup else ''},
         option = {'author_id': author_field['options'],
                   'project_id': project_field['options'],
                   'droplet_maker_id': person_field['options']}
     )
Пример #2
0
    def enzyme_conc_edit(self, id=None):
        if id is None:
            abort(404)

        conc = Session.query(EnzymeConcentration).get(id)
        if not conc:
            abort(404)

        c.conc = conc

        enzyme_field = fl.enzyme_field(selected=unicode(conc.enzyme_id))
        assay_field = fl.assay_field(blank=True, selected=unicode(conc.assay.id))
        author_field = fl.person_field(selected=unicode(conc.author_id))
        c.plate = None
        c.form = h.LiteralFormSelectPatch(
            value={
                "enzyme_id": enzyme_field["value"],
                "assay_id": assay_field["value"],
                "author_id": author_field["value"],
                "minimum_conc": conc.minimum_conc,
                "maximum_conc": conc.maximum_conc,
                "source_plate_id": conc.source_plate_id,
                "notes": conc.notes,
            },
            option={
                "enzyme_id": enzyme_field["options"],
                "assay_id": assay_field["options"],
                "author_id": author_field["options"],
            },
        )
        return render("/assay/enzyme/edit.html")
Пример #3
0
    def enzyme_conc_new(self):
        enzyme_field = fl.enzyme_field()
        assay_field = fl.assay_field(blank=True, empty="", selected=request.params.get("assay_id", None))
        author_field = fl.person_field()

        c.plate = None
        if request.params.get("plate_id", None):
            plate = Session.query(Plate).get(int(request.params.get("plate_id")))
            if plate:
                c.plate = plate

        c.form = h.LiteralFormSelectPatch(
            value={
                "enzyme_id": enzyme_field["value"],
                "assay_id": assay_field["value"],
                "author_id": author_field["value"],
            },
            option={
                "enzyme_id": enzyme_field["options"],
                "assay_id": assay_field["options"],
                "author_id": author_field["options"],
            },
        )

        return render("/assay/enzyme/new.html")
Пример #4
0
 def __setup_groove_fields(self):
     c.droplet_makers = fl.person_field()
     # TODO: limit?
     c.plate_types = groove_plate_type_field()
     c.droplet_types = droplet_type_field()
     c.droplet_generators = groove_droplet_generator_field()
     c.plate_layouts = groove_plate_layout_field()
Пример #5
0
    def edit(self, id):
        """
        Edits an assay.
        """
        assay_q = Session.query(Assay)
        assay = assay_q.filter_by(id=id).first()
        dye_field = fl.assay_dye_field(assay.dye)
        quencher_field = fl.assay_quencher_field(assay.quencher)
        secondary_structure = fl.tertiary_field(assay.secondary_structure)

        if assay is None:
            abort(404)
        else:
            c.assay = assay

        owner_field = fl.person_field(c.assay.owner_id)
        c.form = h.LiteralFormSelectPatch(
            value={
                "dye": dye_field["value"],
                "quencher": quencher_field["value"],
                "owner_id": unicode(owner_field["value"]),
                "secondary_structure": secondary_structure["value"],
            },
            option={
                "chromosome": [("", "--")] + [(chr, chr) for chr in Chromosome.chrom_list],
                "owner_id": owner_field["options"],
                "dye": dye_field["options"],
                "quencher": quencher_field["options"],
                "secondary_structure": secondary_structure["options"],
            },
        )
        values = {
            "name": assay.name,
            "gene": assay.gene,
            "owner_id": unicode(assay.owner_id),
            "primer_fwd": assay.primer_fwd,
            "primer_rev": assay.primer_rev,
            "chromosome": assay.chromosome,
            "probe_pos": assay.probe_pos,
            "probe_seq": assay.probe_seq,
            "dye": assay.dye,
            "quencher": assay.quencher,
            "secondary_structure": secondary_structure["value"],
            "amplicon_width": assay.amplicon_width,
            "snp_rsid": assay.snp_rsid,
            "notes": assay.notes,
            "reference_source": assay.reference_source,
            "optimal_anneal_temp": assay.optimal_anneal_temp,
        }

        if assay.assay_type == Assay.TYPE_LOCATION:
            c.selectedTab = 1
        elif assay.assay_type == Assay.TYPE_SNP:
            c.selectedTab = 2
        else:
            c.selectedTab = 0
        return htmlfill.render(render("/assay/edit.html"), values)
Пример #6
0
 def __plate_list_query_form(self):   
     project_field = fl.project_field(c.project_id if hasattr(c, 'project_id') else None)
     author_field = fl.person_field(c.author_id if hasattr(c, 'author_id') else None)
     return h.LiteralFormSelectPatch(
         value = {'project_id': unicode(project_field['value']),
                  'author_id': unicode(author_field['value'])},
         option = {'project_id': project_field['options'],
                   'author_id': author_field['options']}
     )
Пример #7
0
    def reader_fix(self, id=None):
        box2 = self.__setup_box2_context_by_code(id)
        c.admin = True
        
        reporter_field = fl.person_field()
        c.form = h.LiteralForm(
            option = {
                'reporter_id': [('','--')] + reporter_field['options']
            }
        )

        return render('/admin/reader_fix.html')
Пример #8
0
    def reader_status(self, id=None):
        box2 = self.__setup_box2_context_by_code(id)
        c.admin = True
        
        reporter_field = fl.person_field()
        c.form = h.LiteralForm(
            value = {'status': box2.status},
            option = {
                'status': [(0, 'Restricted/Off-line'),
                           (1, 'Caution'),
                           (2, 'OK')],
                'reporter_id': [('','--')] + reporter_field['options']
            }
        )

        return render('/admin/reader_status.html')
Пример #9
0
    def new(self):
        dye_field = fl.assay_dye_field()
        quencher_field = fl.assay_quencher_field()
        owner_field = fl.person_field()
        secondary_structure = fl.tertiary_field()
        c.form = h.LiteralFormSelectPatch(
            value={
                "dye": dye_field["value"],
                "quencher": quencher_field["value"],
                "owner_id": owner_field["value"],
                "secondary_structure": secondary_structure["value"],
            },
            option={
                "chromosome": [("", "--")] + [(chr, chr) for chr in Chromosome.chrom_list],
                "owner_id": [("", "--")] + owner_field["options"],
                "dye": dye_field["options"],
                "quencher": quencher_field["options"],
                "secondary_structure": secondary_structure["options"],
            },
        )

        return render("/assay/new.html")
Пример #10
0
 def _edit_base(self):
     c.people = fl.person_field()
     return render('/sequence/group_edit.html')
Пример #11
0
 def __setup_batch_fields(self):
     c.people = fl.person_field()
     c.dg_method = dg_method_field()
     c.plate_type = plate_type_field()