doe

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, BSD-3-Clause, + 1 more Imports: 17 Imported by: 2

Documentation

Overview

Package doe facilitates DOE methodology in antha

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWelllocations

func AddWelllocations(DXORJMP string, xlsxfile string, oldsheet int, runnumbertowellcombos []string, nameappendage string, pathtosave string, extracolumnheaders []string, extracolumnvalues []interface{}) error

func AllComboCount

func AllComboCount(pairs []DOEPair) (numberofuniquecombos int)

func AssemblyParametersFromRuns

func AssemblyParametersFromRuns(runs []Run, enzymename string) (assemblyparameters []enzymes.Assemblyparameters)

func DNASequencetoInterface

func DNASequencetoInterface(genes []wtype.DNASequence) (geneseqs []interface{})

func DXXLSXFilefromRuns

func DXXLSXFilefromRuns(runs []Run, outputfilename string) (xlsxfile *xlsx.File)

func FixedAndNonFixed

func FixedAndNonFixed(factors []DOEPair) (fixedfactors []DOEPair, nonfixed []DOEPair)

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

func HandleRPMFactor(header string, value interface{}) (anthaRate wunit.Rate, err error)

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

func HandleStringFactor(header string, value interface{}) (string, error)

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

func HandleTimeFactor(header string, value interface{}) (anthaTime wunit.Time, err error)

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

func HandleVolumeFactor(header string, value interface{}) (anthaVolume wunit.Volume, err error)

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 IsFixedFactor(factor DOEPair) (yesorno bool)

func JMPXLSXFilefromRuns

func JMPXLSXFilefromRuns(runs []Run, outputfilename string) (xlsxfile *xlsx.File)

func LowestLevelValue

func LowestLevelValue(runs []Run, factor string) (value interface{}, err error)

LowestLevelValue returns the lowest level value for a specified factor name from an array of runs

func MergeFactorNames

func MergeFactorNames(factorNames []string) (combinedFactor string)

func XLSXFileFromRuns

func XLSXFileFromRuns(runs []Run, outputfilename string, dxorjmp string) (xlsxfile *xlsx.File)

Types

type DOEPair

type DOEPair struct {
	Factor string
	Levels []interface{}
}

func MakePair

func MakePair(runs []Run, factor string) (allfactorPairs DOEPair, err error)

MakePair pairs a factor with all levels found in runs

func Pair

func Pair(factordescription string, levels []interface{}) (doepair DOEPair)

func RemoveDuplicateLevels

func RemoveDuplicateLevels(pair DOEPair) (reducedpair DOEPair, err error)

RemoveDuplicateLevels creates a copy of the pair with reduced factors if an error occurs the orginal pair is returned

func (DOEPair) LevelCount

func (pair DOEPair) LevelCount() (numberoflevels int)

func (DOEPair) MaxLevel

func (pair DOEPair) MaxLevel() (maxlevel interface{}, err error)

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

func (pair DOEPair) MinLevel() (minlevel interface{}, err error)

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

func (pair DOEPair) RoundLevels() (newpair DOEPair, err error)

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 AddAdditionalHeaderandValue

func AddAdditionalHeaderandValue(run Run, additionalheader string, additionalsubheader string, additionalvalue interface{}) (newrun Run)

func AddAdditionalHeaders

func AddAdditionalHeaders(run Run, additionalheader string, additionalsubheader string) (newrun Run)

func AddAdditionalValue

func AddAdditionalValue(run Run, additionalsubheader string, additionalvalue interface{}) (newrun Run)

func AddFixedFactors

func AddFixedFactors(runs []Run, fixedfactors []DOEPair) (runswithfixedfactors []Run)

func AddNewFactorFieldandValue

func AddNewFactorFieldandValue(run Run, factordescriptor string, factorvalue interface{}) (newrun Run)

func AddNewResponseField

func AddNewResponseField(run Run, responsedescriptor string) (newrun Run)

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 AddNewResponseFieldandValue

func AddNewResponseFieldandValue(run Run, responsedescriptor string, responsevalue interface{}) (newrun Run)

func AllCombinations

func AllCombinations(factors []DOEPair) (runs []Run)

AllCombinations combines all factor pairs to make all possible combinations of runs

func Copy

func Copy(run Run) (newrun Run)

func DeleteAllResponses

func DeleteAllResponses(run Run) (newrun Run)

func DeleteFactorField

func DeleteFactorField(run Run, factorDescriptor string) (newrun Run)

func DeleteResponseField

func DeleteResponseField(run Run, responsedescriptor string) (newrun Run)

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 ReplaceAdditionalValue(run Run, additionalsubheader string, additionalvalue interface{}) (newrun Run)

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 ReplaceResponseValue(run Run, responsedescriptor string, responsevalue interface{}) (newrun Run)

func RunsFromDXDesign

func RunsFromDXDesign(filename string, intfactors []string) (runs []Run, err error)

func RunsFromDXDesignContents

func RunsFromDXDesignContents(bytes []byte, intfactors []string) (runs []Run, err error)

func RunsFromDesign

func RunsFromDesign(contents []byte, intfactors []string, dxorjmp string) (runs []Run, err error)

func RunsFromDesignPreResponses

func RunsFromDesignPreResponses(designfile string, intfactors []string, dxorjmp string) (runs []Run, err error)

func RunsFromDesignPreResponsesContents

func RunsFromDesignPreResponsesContents(designfileContents []byte, intfactors []string, dxorjmp string) (runs []Run, err error)

func RunsFromFixedFactors

func RunsFromFixedFactors(fixedfactors []DOEPair) (runswithfixedfactors []Run)

func RunsFromJMPDesign

func RunsFromJMPDesign(xlsx string, factorcolumns []int, responsecolumns []int, intfactors []string) (runs []Run, err error)

func RunsFromJMPDesignContents

func RunsFromJMPDesignContents(bytes []byte, factorcolumns []int, responsecolumns []int, intfactors []string) (runs []Run, err error)

func UnMergeRuns

func UnMergeRuns(mergedRuns []Run) (originalRuns []Run)

UnMergeRuns turns mergedlevels into original factors and levels

func (Run) AddResponseValue

func (run Run) AddResponseValue(responsedescriptor string, responsevalue interface{})

func (Run) AllFactors

func (run Run) AllFactors() (headers []string, values []interface{})

func (Run) AllResponses

func (run Run) AllResponses() (headers []string, values []interface{})

func (Run) CheckAdditionalInfo

func (run Run) CheckAdditionalInfo(subheader string, value interface{}) bool

func (Run) EqualTo

func (run Run) EqualTo(run2 Run) (bool, error)

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 Run) GetAdditionalInfo(subheader string) (value interface{}, err error)

func (Run) GetFactorValue

func (run Run) GetFactorValue(factordescriptor string) (factorvalue interface{}, err error)

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)

func (Run) GetResponseValue

func (run Run) GetResponseValue(responsedescriptor string) (responsevalue interface{}, err error)

Jump to

Keyboard shortcuts

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