Documentation
¶
Overview ¶
Package doe facilitates DOE methodology in antha
Index ¶
- func AddWelllocations(DXORJMP string, xlsxfile string, oldsheet int, runnumbertowellcombos []string, ...) error
- func AllComboCount(pairs []DOEPair) (numberofuniquecombos int)
- func AssemblyParametersFromRuns(runs []Run, enzymename string) (assemblyparameters []enzymes.Assemblyparameters)
- func DNASequencetoInterface(genes []wtype.DNASequence) (geneseqs []interface{})
- func DXXLSXFilefromRuns(runs []Run, outputfilename string) (xlsxfile *xlsx.File)
- func FixedAndNonFixed(factors []DOEPair) (fixedfactors []DOEPair, nonfixed []DOEPair)
- func HandleComponentWithConcentration(ctx context.Context, header string, value interface{}) (component *wtype.Liquid, concentration wunit.Concentration, err error)
- func HandleConcFactor(header string, value interface{}) (anthaConc wunit.Concentration, err error)
- func HandleLHComponentFactor(ctx context.Context, header string, value interface{}) (*wtype.Liquid, error)
- func HandleLHPlateFactor(ctx context.Context, header string, value interface{}) (*wtype.Plate, error)
- func HandleRPMFactor(header string, value interface{}) (anthaRate wunit.Rate, err error)
- func HandleStringFactor(header string, value interface{}) (string, error)
- func HandleTemperatureFactor(header string, value interface{}) (anthaTemp wunit.Temperature, err error)
- func HandleTimeFactor(header string, value interface{}) (anthaTime wunit.Time, err error)
- func HandleVolumeFactor(header string, value interface{}) (anthaVolume wunit.Volume, err error)
- func IsFixedFactor(factor DOEPair) (yesorno bool)
- func JMPXLSXFilefromRuns(runs []Run, outputfilename string) (xlsxfile *xlsx.File)
- func LowestLevelValue(runs []Run, factor string) (value interface{}, err error)
- func MergeFactorNames(factorNames []string) (combinedFactor string)
- func XLSXFileFromRuns(runs []Run, outputfilename string, dxorjmp string) (xlsxfile *xlsx.File)
- type DOEPair
- type MergeOption
- type MergedLevel
- type Run
- func AddAdditionalHeaderandValue(run Run, additionalheader string, additionalsubheader string, ...) (newrun Run)
- func AddAdditionalHeaders(run Run, additionalheader string, additionalsubheader string) (newrun Run)
- func AddAdditionalValue(run Run, additionalsubheader string, additionalvalue interface{}) (newrun Run)
- func AddFixedFactors(runs []Run, fixedfactors []DOEPair) (runswithfixedfactors []Run)
- func AddNewFactorFieldandValue(run Run, factordescriptor string, factorvalue interface{}) (newrun Run)
- func AddNewResponseField(run Run, responsedescriptor string) (newrun Run)
- func AddNewResponseFieldandValue(run Run, responsedescriptor string, responsevalue interface{}) (newrun Run)
- func AllCombinations(factors []DOEPair) (runs []Run)
- func Copy(run Run) (newrun Run)
- func DeleteAllResponses(run Run) (newrun Run)
- func DeleteFactorField(run Run, factorDescriptor string) (newrun Run)
- func DeleteResponseField(run Run, responsedescriptor string) (newrun Run)
- func MergeRunsFromAllCombos(originalRuns []Run, allcombos []Run, factors []string, options ...MergeOption) (mergedRuns []Run, err error)
- func ReplaceAdditionalValue(run Run, additionalsubheader string, additionalvalue interface{}) (newrun Run)
- func ReplaceFactorField(run Run, factorToReplace, factorToReplaceWith string, ...) (newrun Run)
- func ReplaceResponseValue(run Run, responsedescriptor string, responsevalue interface{}) (newrun Run)
- func RunsFromDXDesign(filename string, intfactors []string) (runs []Run, err error)
- func RunsFromDXDesignContents(bytes []byte, intfactors []string) (runs []Run, err error)
- func RunsFromDesign(contents []byte, intfactors []string, dxorjmp string) (runs []Run, err error)
- func RunsFromDesignPreResponses(designfile string, intfactors []string, dxorjmp string) (runs []Run, err error)
- func RunsFromDesignPreResponsesContents(designfileContents []byte, intfactors []string, dxorjmp string) (runs []Run, err error)
- func RunsFromFixedFactors(fixedfactors []DOEPair) (runswithfixedfactors []Run)
- func RunsFromJMPDesign(xlsx string, factorcolumns []int, responsecolumns []int, intfactors []string) (runs []Run, err error)
- func RunsFromJMPDesignContents(bytes []byte, factorcolumns []int, responsecolumns []int, intfactors []string) (runs []Run, err error)
- func UnMergeRuns(mergedRuns []Run) (originalRuns []Run)
- func (run Run) AddResponseValue(responsedescriptor string, responsevalue interface{})
- func (run Run) AllFactors() (headers []string, values []interface{})
- func (run Run) AllResponses() (headers []string, values []interface{})
- func (run Run) CheckAdditionalInfo(subheader string, value interface{}) bool
- func (run Run) EqualTo(run2 Run) (bool, error)
- func (run Run) GetAdditionalInfo(subheader string) (value interface{}, err error)
- func (run Run) GetFactorValue(factordescriptor string) (factorvalue interface{}, err error)
- func (run Run) GetResponseValue(responsedescriptor string) (responsevalue interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddWelllocations ¶
func AllComboCount ¶
func AssemblyParametersFromRuns ¶
func AssemblyParametersFromRuns(runs []Run, enzymename string) (assemblyparameters []enzymes.Assemblyparameters)
func DNASequencetoInterface ¶
func DNASequencetoInterface(genes []wtype.DNASequence) (geneseqs []interface{})
func DXXLSXFilefromRuns ¶
func FixedAndNonFixed ¶
func HandleComponentWithConcentration ¶
func HandleComponentWithConcentration(ctx context.Context, header string, value interface{}) (component *wtype.Liquid, concentration wunit.Concentration, err error)
HandleComponentWithConcentration returns both LHComponent and Concentration from a component name with concentration in a DOE design. If no valid concentration is found or an invalid component name is specifed an error is returned.
func HandleConcFactor ¶
func HandleConcFactor(header string, value interface{}) (anthaConc wunit.Concentration, err error)
HandleConcFactor parses a factor name and value and returns an antha concentration. If the value cannot be converted to a valid concentration an error is returned. If the header contains a valid concentration unit a number can be specified as the value.
func HandleLHComponentFactor ¶
func HandleLHComponentFactor(ctx context.Context, header string, value interface{}) (*wtype.Liquid, error)
HandleLHComponentFactor parses a factor name and value and returns an LHComponent.
If the value cannot be converted to a valid component an error is returned.
func HandleLHPlateFactor ¶
func HandleLHPlateFactor(ctx context.Context, header string, value interface{}) (*wtype.Plate, error)
HandleLHPlateFactor parses a factor name and value and returns an LHComponent.
If the value cannot be converted to a valid component an error is returned.
func HandleRPMFactor ¶
HandleRPMFactor parses a factor name and value and returns an antha Rate. If the value cannot be converted to a valid Rate an error is returned. A float or int value with no unit is assumed to be in /min.
func HandleStringFactor ¶
HandleStringFactor converts the value of a factor with an interface value to a string.
func HandleTemperatureFactor ¶
func HandleTemperatureFactor(header string, value interface{}) (anthaTemp wunit.Temperature, err error)
HandleTemperatureFactor parses a factor name and value and returns an antha Temperature. If the value cannot be converted to a valid Temperature an error is returned. A float or int value with no unit is assumed to be in C.
func HandleTimeFactor ¶
HandleTimeFactor parses a factor name and value and returns an antha Time. If the value cannot be converted to a valid Time an error is returned. A float or int value with no unit is assumed to be in s.
func HandleVolumeFactor ¶
HandleVolumeFactor parses a factor name and value and returns an antha Volume. If the value cannot be converted to a valid Volume an error is returned.
func IsFixedFactor ¶
func JMPXLSXFilefromRuns ¶
func LowestLevelValue ¶
LowestLevelValue returns the lowest level value for a specified factor name from an array of runs
func MergeFactorNames ¶
Types ¶
type DOEPair ¶
type DOEPair struct { Factor string Levels []interface{} }
func RemoveDuplicateLevels ¶
RemoveDuplicateLevels creates a copy of the pair with reduced factors if an error occurs the orginal pair is returned
func (DOEPair) LevelCount ¶
func (DOEPair) MaxLevel ¶
MaxLevel returns the maximum level of a DOEPair if the factor is numeric, if the factor is not numeric an error is returned
func (DOEPair) MinLevel ¶
MinLevel returns the minimum level of a DOEPair if the factor is numeric, if the factor is not numeric an error is returned unless the factor is a MergedLevel comprising of concentration values
func (DOEPair) RoundLevels ¶
RoundLevels round floats and concs
type MergeOption ¶
type MergeOption string
MergeOption is an option to control the position in the factors of a run at which the merged factor will be added. Valid options are MoveToFront, MoveToBack and UsePositionOfLastFactorInFactorList. The default if no option is set is UsePositionOfLastFactorInFactorList.
var ( // MoveToFront specifies that the merged factor should be moved to the front of the factor list MoveToFront MergeOption = "MoveToFront" // MoveToBack specifies that the merged factor should be moved to the back of the factor list MoveToBack MergeOption = "MoveToBack" // UsePositionOfLastFactorInFactorList specifies that the merged factor should be moved to the position of the last factor in the merged list. UsePositionOfLastFactorInFactorList MergeOption = "UsePositionOfLastFactorInFactorList" // Default will use UsePositionOfLastFactorInFactorList. DefaultMergeOption MergeOption = UsePositionOfLastFactorInFactorList )
type MergedLevel ¶
type MergedLevel struct {
OriginalFactorPairs map[string]interface{} `json:"OriginalFactorPairs"` // map of original factor names to levels e.g. "Glucose":"10uM", "Glycerol mM": 0
}
A MergedLevel is the product of merging two factor levels and retaining the original merged factor level pairs in a map
func MakeMergedLevel ¶
func MakeMergedLevel(factorsInOrder []string, levelsInOrder []interface{}) (m MergedLevel, err error)
MakeMergedLevel merges an array of factors into a single merged level type using arrays of factor names and levels in order
func ToMergedLevel ¶
func ToMergedLevel(level interface{}) (m MergedLevel, err error)
ToMergedLevel casts a valid interface into a MergedLevel. Independent of serialisation history. If the value cannot be cast into a merged level an error is returned.
func (MergedLevel) EqualTo ¶
func (m MergedLevel) EqualTo(e MergedLevel) (bool, error)
EqualTo evaluates whether two merged levels are equal
func (MergedLevel) EqualToMergeConcs ¶
func (m MergedLevel) EqualToMergeConcs(e MergedLevel) (bool, error)
EqualToMergeConcs evaluates whether two merged levels are equal
func (MergedLevel) Sort ¶
func (m MergedLevel) Sort() (orderedKeys []string)
Sort returns keys in alphabetical order; values are returned in the order corresponding to the key order
func (MergedLevel) UnMerge ¶
func (m MergedLevel) UnMerge() (factors []string, setpoints []interface{})
UnMerge returns keys in alphabetical order; values are returned in the order corresponding to the key order
type Run ¶
type Run struct { RunNumber int StdNumber int Factordescriptors []string Setpoints []interface{} Responsedescriptors []string ResponseValues []interface{} AdditionalHeaders []string // could represent a class e.g. Environment variable, processed, raw, location AdditionalSubheaders []string // e.g. well ID, Ambient Temp, order, AdditionalValues []interface{} }
func AddAdditionalHeaders ¶
func AddAdditionalValue ¶
func AddFixedFactors ¶
func AddNewResponseField ¶
AddNewResponseField adds a new response field. The response field will be added with a blank response value. The field will only be added if the response is not already present.
func AllCombinations ¶
AllCombinations combines all factor pairs to make all possible combinations of runs
func DeleteAllResponses ¶
func DeleteFactorField ¶
func DeleteResponseField ¶
func MergeRunsFromAllCombos ¶
func MergeRunsFromAllCombos(originalRuns []Run, allcombos []Run, factors []string, options ...MergeOption) (mergedRuns []Run, err error)
MergeRunsFromAllCombos will make a set of runs based on the original runs which merges all factors specified in factors and finds a valid merged run from all combos to inject in as the set point. MergeOptions can be specified to control the position in the factors of a run at which the merged factor will be added. Valid options are MoveToFront, MoveToBack and UsePositionOfLastFactorInFactorList. The default if no option is set is UsePositionOfLastFactorInFactorList.
func ReplaceAdditionalValue ¶
func ReplaceFactorField ¶
func ReplaceFactorField(run Run, factorToReplace, factorToReplaceWith string, setPointToReplaceWith interface{}) (newrun Run)
ReplaceFactorField will replace the factorToReplace with factorToReplaceWith with Set point setPointToReplaceWith. The index of the factor to replace will be the same as the replaced factor.
func ReplaceResponseValue ¶
func RunsFromDXDesign ¶
func RunsFromDesign ¶
func RunsFromFixedFactors ¶
func RunsFromJMPDesign ¶
func UnMergeRuns ¶
UnMergeRuns turns mergedlevels into original factors and levels
func (Run) AddResponseValue ¶
func (Run) AllFactors ¶
func (Run) AllResponses ¶
func (Run) CheckAdditionalInfo ¶
func (Run) EqualTo ¶
EqualTo compares Runs but ignores run order, std order and additional information but checks all other properties for identical matches
func (Run) GetAdditionalInfo ¶
func (Run) GetFactorValue ¶
GetFactorValue searches for a factor descriptor in the list of factors in a Run. Exact matches will be searched first, followed by matches once any unit is removed (e.g. TotalVolume (ul) to TotalVolume)