config

package
v0.0.0-...-78f8e40 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config is for app wide settings

Index

Constants

This section is empty.

Variables

View Source
var (

	// RootSettingsFile is the default settings file path for the config package
	RootSettingsFile = filepath.Join(reppDir, "config.yaml")

	// Primer3Config is the path to the embedded primer3 config directory
	Primer3Config = filepath.Join(reppDir, "primer3_config") + string(os.PathSeparator)

	// IGEMDB is the path to the iGEM db
	IGEMDB = filepath.Join(reppDir, "igem")

	// AddgeneDB is the path to the Addgene db
	AddgeneDB = filepath.Join(reppDir, "addgene")

	// DNASUDB is the path to the DNASU db
	DNASUDB = filepath.Join(reppDir, "dnasu")

	// FeatureDB is the path to the features db
	FeatureDB = filepath.Join(reppDir, "features.tsv")

	// EnzymeDB is the path to the enzymes db file
	EnzymeDB = filepath.Join(reppDir, "enzymes.tsv")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Vebose is whether to log debug messages to the stdout
	Verbose bool

	// the cost of a single Addgene plasmid
	CostAddgene float64 `mapstructure:"addgene-cost"`

	// the cost of a single part from the iGEM registry
	CostIGEM float64 `mapstructure:"igem-cost"`

	// the per plasmid cost of DNASU plasmids
	CostDNASU float64 `mapstructure:"dnasu-cost"`

	// the cost per bp of primer DNA
	CostBP float64 `mapstructure:"pcr-bp-cost"`

	// the cost of each PCR reaction
	CostPCR float64 `mapstructure:"pcr-rxn-cost"`

	// the cost of time for each PCR reaction
	CostTimePCR float64 `mapstructure:"pcr-time-cost"`

	// the cost of each Gibson Assembly
	CostGibson float64 `mapstructure:"gibson-assembly-cost"`

	// the cost of time for each Gibson Assembly
	CostTimeGibson float64 `mapstructure:"gibson-assembly-time-cost"`

	// the cost per bp of synthesized DNA as a fragment (as a step function)
	CostSyntheticFragment map[int]SynthCost `mapstructure:"synthetic-fragment-cost"`

	// the cost per bp of synthesized clonal DNA  (delivered in a plasmid)
	CostSynthPlasmid map[int]SynthCost `mapstructure:"synthetic-plasmid-cost"`

	// the maximum number of fragments in the final assembly
	FragmentsMaxCount int `mapstructure:"fragments-max-count"`

	// the minimum homology between this fragment and the net one
	FragmentsMinHomology int `mapstructure:"fragments-min-junction-length"`

	// maximum length of homology between two adjacent fragments in bp
	FragmentsMaxHomology int `mapstructure:"fragments-max-junction-length"`

	// maximum allowable hairpin melting temperature (celcius)
	FragmentsMaxHairpinMelt float64 `mapstructure:"fragments-max-junction-hairpin"`

	// PCRMinLength is the minimum size of a fragment (used to filter BLAST results)
	PCRMinLength int `mapstructure:"pcr-min-length"`

	// the maximum primer3 score allowable
	PCRMaxPenalty float64 `mapstructure:"pcr-primer-max-pair-penalty"`

	// the maximum length of a sequence to embed up or downstream of an amplified sequence
	PCRMaxEmbedLength int `mapstructure:"pcr-primer-max-embed-length"`

	// PCRMaxOfftargetTm is the maximum tm of an offtarget, above which PCR is abandoned
	PCRMaxOfftargetTm float64 `mapstructure:"pcr-primer-max-ectopic-tm"`

	// PCRBufferLength is the length of buffer from the ends of a match in which
	// to allow Primer3 to look for a primer
	PCRBufferLength int `mapstructure:"pcr-buffer-length"`

	// maximum length of a synthesized piece of DNA
	SyntheticMaxLength int `mapstructure:"synthetic-max-length"`

	// minimum length of a synthesized piece of DNA
	SyntheticMinLength int `mapstructure:"synthetic-min-length"`
}

Config is the Root-level settings struct and is a mix of settings available in config.yaml and those available from the command line

func New

func New() *Config

New returns a new Config struct populated by settings from config.yaml, in the repo, or some other settings file the user points to with the "--config" command

TODO: check for and error out on nonsense config values TODO: add back the config file path setting

func (Config) SynthFragmentCost

func (c Config) SynthFragmentCost(fragLength int) float64

SynthFragmentCost returns the cost of synthesizing a linear stretch of DNA

func (Config) SynthPlasmidCost

func (c Config) SynthPlasmidCost(insertLength int) float64

SynthPlasmidCost returns the cost of synthesizing the insert and having it delivered in a plasmid

type SynthCost

type SynthCost struct {
	// whether it's a fixed or variable cost
	Fixed bool `mapstructure:"fixed"`

	// the cost (either per bp or for the whole stretch)
	Cost float64 `mapstructure:"cost"`
}

SynthCost contains data of the cost of synthesizing DNA up to a certain size. Can be fixed (ie everything beneath that limit is the same amount) or not (pay by the bp)

Jump to

Keyboard shortcuts

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