Example #1
0
 def get(self, process_id):
     process = LibraryPrepShotgunProcess(int(process_id))
     text = process.generate_echo_picklist()
     compressed_plate_name = process.normalization_process.compressed_plate\
         .external_id
     name_pieces = [compressed_plate_name, "indices"]
     self.deliver_text(name_pieces, process, text)
    def get(self, process_id):
        process = LibraryPrepShotgunProcess(int(process_id))
        text = process.generate_echo_picklist()

        self.set_header('Content-Description', 'text/csv')
        self.set_header('Expires', '0')
        self.set_header('Cache-Control', 'no-cache')
        self.set_header(
            'Content-Disposition', 'attachment; filename='
            'LibraryPrepShotgunSheet_%s.csv' % process_id)
        self.write(text)
        self.finish()
    def get(self):
        plate_ids = self.get_arguments('plate_id')
        process_id = self.get_argument('process_id', None)
        kappa = None
        stub = None
        volume = None
        norm_plate = None
        i5plate = None
        i7plate = None
        if process_id is not None:
            try:
                process = LibraryPrepShotgunProcess(process_id)
            except LabmanUnknownIdError:
                raise HTTPError(404,
                                reason="Shotgun library prep process %s "
                                "doesn't exist" % process_id)
            kappa = process.kappa_hyper_plus_kit.external_lot_id
            stub = process.stub_lot.external_lot_id
            norm_plate = process.normalized_plate.id
            i5plate = process.i5_primer_plate.id
            i7plate = process.i7_primer_plate.id
            volume = process.volume
        primer_plates = Plate.list_plates(['primer'])

        self.render('library_prep_shotgun.html',
                    plate_ids=plate_ids,
                    primer_plates=primer_plates,
                    process_id=process_id,
                    kappa=kappa,
                    stub=stub,
                    volume=volume,
                    norm_plate=norm_plate,
                    i5plate=i5plate,
                    i7plate=i7plate)
Example #4
0
def create_shotgun_process(user, norm_plate):
    kappa = ReagentComposition(4)
    stub = ReagentComposition(5)
    shotgun_process = LibraryPrepShotgunProcess.create(
        user, norm_plate, 'Test Shotgun Library %s' % datetime.now(), kappa,
        stub, 4000, Plate(19), Plate(20))
    shotgun_plate = shotgun_process.plates[0]
    return shotgun_process, shotgun_plate
Example #5
0
def create_shotgun_process(user, norm_plate):
    kappa = ReagentComposition(4)
    stub = ReagentComposition(5)
    primer_a, primer_b = get_primer_plate(is_96=False)
    shotgun_process = LibraryPrepShotgunProcess.create(
        user, norm_plate, 'Test Shotgun Library %s' % datetime.now(), kappa,
        stub, 4000, primer_a, primer_b)
    shotgun_plate = shotgun_process.plates[0]
    return shotgun_process, shotgun_plate
    def post(self):
        plate_name = self.get_argument('plate_name')
        volume = self.get_argument('volume')
        plate = self.get_argument('plate')
        i5_plate = self.get_argument('i5_plate')
        i7_plate = self.get_argument('i7_plate')
        kappa_hyper_plus_kit = self.get_argument('kappa_hyper_plus_kit')
        stub_lot = self.get_argument('stub_lot')

        process = LibraryPrepShotgunProcess.create(
            self.current_user, Plate(plate), plate_name,
            ReagentComposition.from_external_id(kappa_hyper_plus_kit),
            ReagentComposition.from_external_id(stub_lot), volume,
            Plate(i5_plate), Plate(i7_plate))

        self.write({'process': process.id})
    def post(self):
        user = self.current_user
        plates_info = self.get_argument('plates_info')
        volume = self.get_argument('volume')
        kappa_hyper_plus_kit = self.get_argument('kappa_hyper_plus_kit')
        stub_lot = self.get_argument('stub_lot')

        processes = [[
            pid,
            LibraryPrepShotgunProcess.create(
                user, Plate(pid), plate_name,
                ReagentComposition.from_external_id(kappa_hyper_plus_kit),
                ReagentComposition.from_external_id(stub_lot), volume,
                Plate(i5p), Plate(i7p)).id
        ] for pid, plate_name, i5p, i7p in json_decode(plates_info)]

        self.write({'processes': processes})