liquidhandling

package
v0.0.0-...-040724e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause, GPL-2.0 Imports: 34 Imported by: 2

Documentation

Overview

defines types for dealing with liquid handling requests

Index

Constants

View Source
const (
	COLWISE = iota
	ROWWISE
	RANDOM
)
View Source
const (
	LayoutSummaryVersion  = "1.0"
	ActionsSummaryVersion = "1.0"
)

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDigest

func AssetDigest(name string) ([sha256.Size]byte, error)

AssetDigest returns the digest of the file with the given name. It returns an error if the asset could not be found or the digest could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"}, AssetDir("data/img") would return []string{"a.png", "b.png"}, AssetDir("foo.txt") and AssetDir("notexist") would return an error, and AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func AssetString

func AssetString(name string) (string, error)

AssetString returns the asset contents as a string (instead of a []byte).

func BasicSetupAgent

func BasicSetupAgent(ctx context.Context, request *LHRequest, params *liquidhandling.LHProperties) error

default setup agent

func Digests

func Digests() (map[string][sha256.Size]byte, error)

Digests returns a map of all known files and their checksums.

func FixVolumes

func FixVolumes(request *LHRequest, carryVolume wunit.Volume) error

FixVolumes adjusts volumes of components in instructions in order to ensure sufficient quantities for all known uses. It aims to account for both residual well volumes and carry volumes, although the latter is intrinsically inaccurate since at this stage we do not know how transfers will be done and therefore how much carry volume will be lost In order to do this it needs to account for the various conventions in component naming to distinguish virtual from non-virtual components and additionally needs to ensure it treats stationary components differently since these do not need adjusting for carry volume or residual

func ImprovedLayoutAgent

func ImprovedLayoutAgent(ctx context.Context, request *LHRequest, params *liquidhandling.LHProperties) error

ImprovedLayoutAgent assigns destinations to mix instructions don't ask about how bad the original one (upon which the 'improvements' here were made) was...

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func MustAssetString

func MustAssetString(name string) string

MustAssetString is like AssetString but panics when Asset would return an error. It simplifies safe initialization of global variables.

func OrdinalFromHash

func OrdinalFromHash(m map[string]int) ([]string, error)

func OutputSetup

func OutputSetup(robot *liquidhandling.LHProperties)

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory.

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively.

func SummarizeActions

func SummarizeActions(initialState *driver.LHProperties, itree *driver.ITree) ([]byte, error)

SummarizeActions return a description of all the steps which take place during the liquidhandling operation The returned JSON is validated against the schema found in ./schemas/actions.schema.json, which is the cannonical description of the format for communication liquidhandling actions to the frontend initialState: the initial state of the robot, used to track state updates itree: the instruction tree generated during the Plan(...) stage errors are returned if the json cannot be constructed or the result fails to validate

func SummarizeLayout

func SummarizeLayout(initialState, finalState *driver.LHProperties, initialToFinalIDs map[string]string) ([]byte, error)

SummarizeLayout produce a description of the positions and states of objects on deck before and after the entire liquidhandling operation The returned JSON is validated against the schema found in ./schemas/layout.schema.json, which is the cannonical description of the format for communicating layout to the front end. initialState and finalState are the robot states before and after the operation, initialToFinalIDs maps object ids in the inisial state to the final state errors are returned if the json cannot be constructed or the result fails to validate

Types

type ByOrdinal

type ByOrdinal [][]int

func (ByOrdinal) Len

func (bo ByOrdinal) Len() int

func (ByOrdinal) Less

func (bo ByOrdinal) Less(i, j int) bool

func (ByOrdinal) Swap

func (bo ByOrdinal) Swap(i, j int)

type InputSolutions

type InputSolutions struct {
	Solutions       map[string][]*wtype.Liquid //the solutions explicitly supplied to the protocol
	Order           []string                   //the order in which liquids are required in the ordered LH instructions
	VolumesSupplied map[string]wunit.Volume    //the volumes of the solutions explicitly supplied to the protocol
	VolumesRequired map[string]wunit.Volume    //the estimated volumes of solutions required to carry out the protocol
	VolumesWanting  map[string]wunit.Volume    //the estimated shortfall between the supplied and required volumes which must be auto-allocated
}

InputSolutions properties to do with the input Liquids required for the mix

func (*InputSolutions) String

func (self *InputSolutions) String() string

String return a string representation, useful for debugging

type InputSorter

type InputSorter struct {
	Ordered []string
	Values  map[string]wunit.Volume
}

func (InputSorter) Len

func (is InputSorter) Len() int

@implement sort.Interface

func (InputSorter) Less

func (is InputSorter) Less(i, j int) bool

func (InputSorter) Swap

func (is InputSorter) Swap(i, j int)

type LHOptions

type LHOptions struct {
	ModelEvaporation         bool
	OutputSort               bool
	ExecutionPlannerVersion  string
	PrintInstructions        bool
	LegacyVolume             bool
	FixVolumes               bool
	IgnorePhysicalSimulation bool
}

func NewLHOptions

func NewLHOptions() LHOptions

type LHPolicyManager

type LHPolicyManager struct {
	SystemPolicies *wtype.LHPolicyRuleSet
	UserPolicies   *wtype.LHPolicyRuleSet
}

func (*LHPolicyManager) MergePolicies

func (mgr *LHPolicyManager) MergePolicies(protocolpolicies *wtype.LHPolicyRuleSet) *wtype.LHPolicyRuleSet

func (*LHPolicyManager) Policies

func (mgr *LHPolicyManager) Policies() *wtype.LHPolicyRuleSet

func (*LHPolicyManager) SetOption

func (mgr *LHPolicyManager) SetOption(optname string, value interface{}) error

SetOption adds an option and value to both System and User policies in the PolicyManager.

type LHRequest

type LHRequest struct {
	ID                    string
	BlockID               wtype.BlockID
	BlockName             string
	LHInstructions        wtype.LHInstructions
	Plates                map[string]*wtype.Plate
	TipBoxes              []*wtype.LHTipbox
	InstructionTree       *liquidhandling.ITree
	Instructions          []liquidhandling.TerminalRobotInstruction
	InstructionText       string
	InputAssignments      map[string][]string
	OutputAssignments     map[string][]string
	InputPlates           map[string]*wtype.Plate
	OutputPlates          map[string]*wtype.Plate
	InputPlatetypes       []*wtype.Plate
	InputPlateOrder       []string
	InputSetupWeights     map[string]float64
	OutputPlatetypes      []*wtype.Plate
	OutputPlateOrder      []string
	PlateLookup           map[string]string
	Stockconcs            map[string]wunit.Concentration
	PolicyManager         *LHPolicyManager
	OutputOrder           []string
	OutputIteratorFactory func(wtype.Addressable) wtype.AddressIterator `json:"-"`
	InstructionChain      *wtype.IChain
	TimeEstimate          float64 // in seconds
	InstructionSets       [][]*wtype.LHInstruction
	Options               LHOptions
	NUserPlates           int
	OutputSort            bool
	TipsUsed              []wtype.TipEstimate
	InputSolutions        *InputSolutions //store properties related to the Liquids for the request
}

structure for defining a request to the liquid handler

func NewLHRequest

func NewLHRequest() *LHRequest

func (*LHRequest) AddUserPlate

func (lhr *LHRequest) AddUserPlate(p *wtype.Plate)

func (*LHRequest) AddUserPolicies

func (lhr *LHRequest) AddUserPolicies(userPolicies *wtype.LHPolicyRuleSet)

AddUserPolicies allows policies specified in elements to be added to the PolicyManager.

func (*LHRequest) Add_instruction

func (lhr *LHRequest) Add_instruction(ins *wtype.LHInstruction)

func (*LHRequest) AllPlates

func (request *LHRequest) AllPlates() []*wtype.Plate

AllPlates returns a list of all known plates, in the order input plates, output plates ordering will be as within the stated orders of each

func (*LHRequest) GetOrderedLHInstructions

func (self *LHRequest) GetOrderedLHInstructions() ([]*wtype.LHInstruction, error)

GetOrderedLHInstructions get the LHInstructions in the order which should have previously been detrmined

func (*LHRequest) GetPlate

func (req *LHRequest) GetPlate(id string) (*wtype.Plate, bool)

func (*LHRequest) GetPolicyManager

func (lhr *LHRequest) GetPolicyManager() *LHPolicyManager

func (*LHRequest) GetSolutionsFromInputPlates

func (req *LHRequest) GetSolutionsFromInputPlates() (map[string][]*wtype.Liquid, error)

GetSolutionsFromInputPlates get all the solutions available to the mix task in the input plates

func (*LHRequest) HasPlateNamed

func (request *LHRequest) HasPlateNamed(name string) bool

HasPlateNamed checks if the request already contains a plate with the specified name

func (*LHRequest) MergedInputOutputPlates

func (req *LHRequest) MergedInputOutputPlates() map[string]*wtype.Plate

func (*LHRequest) NewComponentsAdded

func (lhr *LHRequest) NewComponentsAdded() bool

NewComponentsAdded run this after Plan to determine if anything new was added to the inputs

func (*LHRequest) OrderedInputPlates

func (request *LHRequest) OrderedInputPlates() []*wtype.Plate

OrderedInputPlates returns the list of input plates in order

func (*LHRequest) OrderedOutputPlates

func (request *LHRequest) OrderedOutputPlates() []*wtype.Plate

OrderedOutputPlates returns the list of input plates in order

func (*LHRequest) Policies

func (lhr *LHRequest) Policies() *wtype.LHPolicyRuleSet

func (*LHRequest) SetPolicies

func (lhr *LHRequest) SetPolicies(systemPolicies *wtype.LHPolicyRuleSet)

func (*LHRequest) UseLegacyVolume

func (lhr *LHRequest) UseLegacyVolume() bool

func (*LHRequest) Validate

func (request *LHRequest) Validate() error

Validate catch errors early

type Liquidhandler

type Liquidhandler struct {
	Properties      *liquidhandling.LHProperties
	FinalProperties *liquidhandling.LHProperties
	SetupAgent      func(context.Context, *LHRequest, *liquidhandling.LHProperties) error
	LayoutAgent     func(context.Context, *LHRequest, *liquidhandling.LHProperties) error
	// contains filtered or unexported fields
}

func Init

func Init(properties *liquidhandling.LHProperties) *Liquidhandler

initialize the liquid handling structure

func (*Liquidhandler) AddSetupInstructions

func (this *Liquidhandler) AddSetupInstructions(request *LHRequest) error

AddSetupInstructions add instructions to the instruction stream to setup the plate layout of the machine

func (*Liquidhandler) Execute

func (this *Liquidhandler) Execute(request *LHRequest) error

run the request via the driver

func (*Liquidhandler) GetPlates

func (this *Liquidhandler) GetPlates(ctx context.Context, plates map[string]*wtype.Plate, major_layouts map[int][]string, ptype *wtype.Plate) (map[string]*wtype.Plate, error)

define which labware to use

func (*Liquidhandler) Layout

func (this *Liquidhandler) Layout(ctx context.Context, request *LHRequest) error

generate the output layout

func (*Liquidhandler) MakeSolutions

func (this *Liquidhandler) MakeSolutions(ctx context.Context, request *LHRequest) error

high-level function which requests planning and execution for an incoming set of solutions

func (*Liquidhandler) Plan

func (this *Liquidhandler) Plan(ctx context.Context, request *LHRequest) error

func (*Liquidhandler) PlateIDMap

func (this *Liquidhandler) PlateIDMap() map[string]string

func (*Liquidhandler) Setup

func (this *Liquidhandler) Setup(ctx context.Context, request *LHRequest) error

generate setup for the robot

func (*Liquidhandler) Simulate

func (this *Liquidhandler) Simulate(request *LHRequest) error

run the request via the physical simulator

type PlateChoice

type PlateChoice struct {
	Platetype string
	Assigned  []string
	ID        string
	Wells     []string
	Name      string
	Output    []bool
}

func LayoutStage

func LayoutStage(ctx context.Context, request *LHRequest, params *liquidhandling.LHProperties, chain *wtype.IChain, plate_choices []PlateChoice, mapchoices map[string]string) ([]PlateChoice, map[string]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL