Documentation ¶
Overview ¶
solutions is a utility package for working with solutions of LHComponents
utility package for working with solutions
solutions is a utility package for working with solutions of LHComponents
Index ¶
- Variables
- func ContainsComponent(components []*wtype.Liquid, component *wtype.Liquid, lookForSubComponents bool) (found bool, position int, err error)
- func DilutableComponentLists(sourceComponentList, targetComponentList wtype.ComponentList) (equal bool, dilutionFactor float64, err error)
- func Equal(component1, component2 *wtype.LHComponent) error
- func Equivalent(sourceComponent *wtype.LHComponent, targetComponent *wtype.LHComponent, ...) error
- func FindComponentByName(components []*wtype.Liquid, componentName string) (component *wtype.Liquid, err error)
Constants ¶
This section is empty.
Variables ¶
var EqualLists = wtype.EqualLists
EqualLists compares two ComponentLists and returns an error if the lists are not identical.
var NormaliseComponentName = wtype.NormaliseComponentName
NormaliseComponentName will change the name of the component to the normalised form returned by ReturnNormalisedComponentName. If sub components exist the name will be changed to the list of sub components with concentrations. e.g. a solution called LB with a concentration of 10X and components 10g/L Yeast Extract and 5g/L Tryptone will be normalised to 10g/L Yeast Extract + 5g/L Tryptone. An LB solution with concentration 1 X and no components is returned as 1X LB. An LB solution with no concentration and no components is returned as LB.
var NormaliseName = wtype.NormaliseName
NormaliseName evaluates whether a string contains a concentration and attempts to normalise the name in a standardised format. e.g. 10ng/ul glucose will be normalised to 10 mg/l glucose or 10mM glucose to 10 mM/l glucose or 10mM/l glucose to 10 mM/l glucose or glucose 10mM/l to 10 mM/l glucose A concatanenated name such as 10g/L glucose + 10g/L yeast extract will be returned with no modifications
var ReturnNormalisedComponentName = wtype.ReturnNormalisedComponentName
ReturnNormalisedComponentName will return the component name in a normalised form. If sub components exist the name will be changed to the list of sub components with concentrations. e.g. a solution called LB with a concentration of 10X and components 10g/L Yeast Extract and 5g/L Tryptone will be normalised to 10g/L Yeast Extract + 5g/L Tryptone. An LB solution with concentration 1 X and no components is returned as 1X LB. An LB solution with no concentration and no components is returned as LB.
Functions ¶
func ContainsComponent ¶
func ContainsComponent(components []*wtype.Liquid, component *wtype.Liquid, lookForSubComponents bool) (found bool, position int, err error)
Looks for components matching name, concentration and all sub components (including their concentrations). A position of -1 is returned if no match found. If the component does not contain a concentration, the name will be matched only if multiple matches are found the first will be returned
func DilutableComponentLists ¶
func DilutableComponentLists(sourceComponentList, targetComponentList wtype.ComponentList) (equal bool, dilutionFactor float64, err error)
DilutableComponentLists evaluates whether sourceComponentList is dilutable to become equal to targetComponentList.
func Equal ¶
func Equal(component1, component2 *wtype.LHComponent) error
Equal evaluates whether two components are equal. First the component names are normalised and evaluated for equality. If equal, component lists are retrieved for both components; if no sub components are found, concentrations are evaluated foe equality. If component lists are found the component lists are evaluated for equality. A discrepency of 1% difference in concentration is permitted.
func Equivalent ¶
func Equivalent(sourceComponent *wtype.LHComponent, targetComponent *wtype.LHComponent, lookForSubComponents bool) error
Equivalent is a utility function to evaluate if components are equivalent based upon name and evaluating if both components contain a means of acquiring the concentration, either from parsing the component name or from the component properties. The concentration is not evaluated. Using ATP as an example component name, the function should work for components which are specified in the protocol in the following forms: 1uM ATP, ATP 1uM, 1g/L ATP, 1mMol/l ATP
func FindComponentByName ¶
func FindComponentByName(components []*wtype.Liquid, componentName string) (component *wtype.Liquid, err error)
FindComponentByName is a utility function which looks for a component matching on name only. If more than one component present the first component will be returned with no error This will ignore concentrations if only a unit is specified.
Types ¶
This section is empty.