Esempio n. 1
0
func Steps(params Parameters, inputs Inputs) Outputs {
	var outputs Outputs

	ctx := execution.GetContext()

	em := ctx.EquipmentManager
	rqout := em.MakeDeviceRequest("liquidhandler", "Manual")
	response := <-rqout

	// handle response problems
	if response["status"] == "FAIL" {
		log.Fatal("Error requesting liquid handler service")
	}

	liquidhandler := response["devicequeue"].(*execution.LiquidHandlingService)

	samples := make([]*wtype.LHComponent, 0)

	buffersample := mixer.SampleForTotalVolume(inputs.Buffer, params.Reactionvolume)
	samples = append(samples, buffersample)

	atpsample := mixer.Sample(inputs.ATP, params.Atpvol)
	samples = append(samples, atpsample)

	vectorsample := mixer.SampleForConcentration(inputs.Vector, params.Vectorconc)
	samples = append(samples, vectorsample)

	for _, part := range inputs.Parts {
		partsample := mixer.SampleForConcentration(part, params.Partconc)
		samples = append(samples, partsample)
	}

	resample := mixer.Sample(inputs.RestrictionEnzyme, params.Revol)
	samples = append(samples, resample)
	ligsample := mixer.Sample(inputs.Ligase, params.Ligvol)
	samples = append(samples, ligsample)
	reaction := mixer.MixInto(inputs.Outplate, samples...)
	// set the block ID
	reaction.BlockID = string(params.BlockID)

	rq2 := liquidhandler.MakeMixRequest(reaction)
	if rq2 == nil {
		log.Fatal("Error running liquid handling request")
	}

	rq2.Tip_Type = inputs.TipType
	liquidhandler.Run()

	// incubate the reaction mixtures

	incubate(reaction, params.Reactiontemp, params.Reactiontime, false)

	// inactivate

	incubate(reaction, params.Inactivationtemp, params.Inactivationtime, false)

	// all done
	outputs.Reaction = reaction
	return outputs
}
Esempio n. 2
0
func (w *Wrapper) MixInto(outplate *wtype.LHPlate, components ...*wtype.LHComponent) *wtype.LHSolution {
	if !w.usedMix {
		ctx := GetContext()
		em := ctx.EquipmentManager
		/*
			cfg := ctx.ConfigService.GetConfig(w.threadID)
			devname := ""
			_, ok := cfg["LIQUIDHANDLER"]
			if ok {
				devname = cfg["LIQUIDHANDLER"].(string)
			}
			rqOut := em.MakeDeviceRequest("liquidhandler", devname)
		*/
		rqOut := em.MakeDeviceRequest("liquidhandler", "Manual")
		response := <-rqOut
		if response["status"] == "FAIL" {
			log.Fatal("Error requesting liquid handler service")
		}
		w.liquidHandler = response["devicequeue"].(*LiquidHandlingService)
		w.usedMix = true
	}

	reaction := mixer.MixInto(outplate, components...)
	reaction.BlockID = string(w.threadID)

	req := w.liquidHandler.MakeMixRequest(reaction)
	if req == nil {
		log.Fatal("Error running liquid handling request")
	}
	req.Tip_Type = w.tipType
	w.liquidHandler.Run()

	return reaction
}