enzymes

package
v0.0.0-...-a011eca Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: BSD-3-Clause, GPL-2.0, BSD-3-Clause, + 1 more Imports: 10 Imported by: 0

Documentation

Overview

Package enzymes for working with enzymes; in particular restriction enzymes

Index

Constants

This section is empty.

Variables

View Source
var (
	// SapI is a TypeIIs enzyme.
	SapI = wtype.TypeIIs{RestrictionEnzyme: sapI}
	// BsaI is a TypeIIs enzyme
	BsaI = wtype.TypeIIs{RestrictionEnzyme: bsaI}
	// BpiI is a TypeIIs enzyme
	BpiI = wtype.TypeIIs{RestrictionEnzyme: bpiI}
)

Example TypeIIs enzymes.

View Source
var (

	// DNApolymerasetemps contains example cycling properties for two common DNA polymerase enzymes
	DNApolymerasetemps = map[string]map[string]wunit.Temperature{
		"Q5Polymerase": {
			"extensiontemp": wunit.NewTemperature(72, "C"),
			"meltingtemp":   wunit.NewTemperature(98, "C"),
		},
		"Taq": {
			"extensiontemp": wunit.NewTemperature(68, "C"),
			"meltingtemp":   wunit.NewTemperature(95, "C"),
		},
	}
)
View Source
var TypeIIsEnzymeproperties = map[string]wtype.TypeIIs{
	"SAPI": SapI,
	"BSAI": BsaI,
	"BPII": BpiI,
}

TypeIIsEnzymeproperties carries a map of example TypeIIs enzymes.

Functions

func AddCustomEnds

func AddCustomEnds(part wtype.DNASequence, enzyme wtype.TypeIIs, desiredstickyend5prime string, desiredstickyend3prime string) (Partwithends wtype.DNASequence)

AddCustomEnds adds specified ends to the part sequence based upon enzyme chosen and the desired overhangs after digestion

func AddL1DAdaptor

func AddL1DAdaptor(part wtype.DNASequence, assemblyStandard AssemblyStandard, level string, class string, reverseOrientation bool) (newpart wtype.DNASequence, err error)

AddL1DAdaptor adds a downstream (3') adaptor for making a level 0 part compatible for Level 1 hierarchical assembly, specifying the desired level 1 class the level0 part should be made into. TypeIIs recognition site + spacer + correct overhang in correct orientation will be added according to the correct enzyme at a specified level according to a specified assembly standard. If reverseOrientation is set to true the adaptor will be added such that the level 1 part will bind in the reverse orientation.

func AddL1UAdaptor

func AddL1UAdaptor(part wtype.DNASequence, assemblyStandard AssemblyStandard, level string, class string, reverseOrientation bool) (newpart wtype.DNASequence, err error)

AddL1UAdaptor adds an upstream (5') adaptor for making a level 0 part compatible for Level 1 hierarchical assembly, specifying the desired level 1 class the level0 part should be made into. TypeIIs recognition site + spacer + correct overhang in correct orientation will be added according to the correct enzyme at a specified level according to a specified assembly standard. If reverseOrientation is set to true the adaptor will be added such that the level 1 part will bind in the reverse orientation.

func AddOverhang

func AddOverhang(seq string, bittoadd string, end string) (seqwithoverhang string)

AddOverhang is the lowest level function to add an overhang to a sequence as a string

func AddStandardStickyEndsfromClass

func AddStandardStickyEndsfromClass(part wtype.DNASequence, assemblyStandard AssemblyStandard, level string, class string) (partWithEnds wtype.DNASequence, err error)

AddStandardStickyEndsfromClass adds sticky ends to a DNA part according to the class identifier (e.g. PRO, 5U, CDS). An error will be returned if any invalid class or level is requested.

func AssemblySummary

func AssemblySummary(params []Assemblyparameters) string

AssemblySummary returns a summary of multiple Assemblyparameters separated by a line break for each

func CalculateExtensionTime

func CalculateExtensionTime(polymeraseName string, targetSequence wtype.DNASequence) (wunit.Time, error)

CalculateExtensionTime returns the calculated extension time to amplify a targetSequence with a specified polymerase. An error will be returned if the required properties cannot be found for the polymerase. Currently the standard valid polymerase options are Taq and Q5Polymerase.

func CheckForExistingTypeIISEnds

func CheckForExistingTypeIISEnds(part wtype.DNASequence, enzyme wtype.TypeIIs) (numberofsitesfound int, stickyends5 []string, stickyends3 []string)

CheckForExistingTypeIISEnds checks for whether a part already has typeIIs ends added.

func ChooseSpacer

func ChooseSpacer(spacerlength int, seq string, seqstoavoid []string) (spacer string)

ChooseSpacer picks the first valid spacer which avoids all sequences to avoid.

func Digest

func Digest(originalSequence wtype.DNASequence, enzymes ...wtype.RestrictionEnzyme) (fragments []wtype.DNASequence, err error)

Digest will simulate digestion of a DNA sequence with one or more restriction enzymes; returns the products of the digestion in the form of a set of DNASequence.

func EndReport

func EndReport(restrictionenzyme wtype.TypeIIs, vector wtype.DNASequence, parts []wtype.DNASequence) (endreport string)

EndReport returns a report of all ends expected from digesting a vector sequence and a set of parts as a string. Intended to aid the user in trouble shooting unsuccessful assemblies.

func MakeAllSpacerOptions

func MakeAllSpacerOptions(spacerlength int) (finalarray []string)

MakeAllSpacerOptions returns an array of all sequence possibilities for a spacer based upon length.

func MakeOverhang

func MakeOverhang(enzyme wtype.TypeIIs, end string, stickyendseq string, spacer string) (seqwithoverhang string)

MakeOverhang adds an overhang based upon the enzyme chosen, the choice of end ("5Prime" or "3Prime"), the desired sticky end and the desired spacer.

func MakeScarfreeCustomTypeIIsassemblyParts

func MakeScarfreeCustomTypeIIsassemblyParts(parts []wtype.DNASequence, vector wtype.DNASequence, enzyme wtype.TypeIIs) (partswithends []wtype.DNASequence)

MakeScarfreeCustomTypeIIsassemblyParts adds typeIIs assembly ends to a set of parts. The ends will be added in order to enable correct assembly of the parts in the order specified leaving no scar sequence between parts. The ends will be added based on a specified typeIIs enzyme and vector which contains sites for that typeIIs enzyme. If the parts already contain typeIIs sites for the specified enzyme the ends will be checked for compatibility.

func MakeStandardTypeIIsassemblyParts

func MakeStandardTypeIIsassemblyParts(parts []wtype.DNASequence, assemblystandard AssemblyStandard, level string, partClasses []string) (partswithends []wtype.DNASequence, err error)

MakeStandardTypeIIsassemblyParts adds compatible ends to a set of parts based on the rules of a typeIIS assembly standard.

func MultipleAssemblies

func MultipleAssemblies(parameters []Assemblyparameters) (s string, successfulassemblies int, errors map[string]string, seqs []wtype.DNASequence)

MultipleAssemblies will perform simulated assemblies on multiple constructs and return a description of whether each was successful and how many are expected to work

func RestrictionMapper

func RestrictionMapper(seq wtype.DNASequence, enzymes ...wtype.RestrictionEnzyme) (fraglengths []int)

RestrictionMapper returns a set of fragment sizes expected by digesting a DNA sequence with a series of restriction enzymes.

func SitepositionString

func SitepositionString(sitesperpart RestrictionSites) (sitepositions string)

SitepositionString returns a report of restriction sites found as a string todo: deprecate

func TypeIIsdigest

func TypeIIsdigest(sequence wtype.DNASequence, typeIIsenzyme wtype.TypeIIs) (finalFragments []string, fivePrimeOverhangs []string, threePrimeUnderhangs []string)

TypeIIsdigest returns slices of fragments, 5 prime overhangs and 3 prime underhangs generated from cutting with a typeIIs enzyme which leaves a 5 prime overhang.

func VectorEnds

func VectorEnds(vector wtype.DNASequence, enzyme wtype.TypeIIs) (desiredstickyend5prime string, vector3primestickyend string)

VectorEnds returns the 5' and 3' sticky ends found from cutting a vector DNASequence with TypeIIs enzyme. If the vector is cut more than once the first two sticky ends will be returned. If the vector is not cut "" and "" will be returned.

Types

type AssemblyLevel

type AssemblyLevel struct {
	//Enzyme used for assembly
	Enzyme wtype.TypeIIs
	// map of part labels to standard overhangs.
	PartOverhangs map[string]StandardOverhangs
	// Expected overhangs in the entry vector.
	EntryVectorEnds StandardOverhangs // Vector 5prime can also be found in Endstable position 0
}

AssemblyLevel is a specified TypeIIs standard for assembly of a series of labelled parts.

func (AssemblyLevel) AnnotationOptions

func (l AssemblyLevel) AnnotationOptions() []string

AnnotationOptions returns all valid part labels for a specified AssemblyLevel.

func (AssemblyLevel) GetEnzyme

func (l AssemblyLevel) GetEnzyme() wtype.TypeIIs

GetEnzyme returns the typeIIs enzyme for the AssemblyLevel.

func (AssemblyLevel) GetPartOverhangs

func (l AssemblyLevel) GetPartOverhangs(class string) (overhangs StandardOverhangs, err error)

GetPartOverhangs returns the expected part overhangs for the specified part class.

func (AssemblyLevel) GetVectorEnds

func (l AssemblyLevel) GetVectorEnds() StandardOverhangs

GetVectorEnds returns the expected vector overhangs for the AssemblyLevel.

type AssemblyStandard

type AssemblyStandard struct {
	// Name of the Assembly Standard.
	Name string
	// The AssemblyStandard may consist of a number of assembly levels which may use a different enzyme, set of standard overhangs or both.
	// The name of the level is used as the key to calling an AssemblyLevel object.
	Levels map[string]AssemblyLevel
}

AssemblyStandard is an assembly standard for modular assembly of DNA parts using TypeIIs enzyme assembly. The AssemblyStandard may consist of a number of assembly levels which may use a different enzyme, set of standard overhangs or both.

func LookupAssemblyStandard

func LookupAssemblyStandard(name string) (standard AssemblyStandard, err error)

LookupAssemblyStandard looks up a TypeIIS Assembly Standard by name. An error will be returned if no Assembly standard is found for the requested name.

func (AssemblyStandard) Enzyme

func (l AssemblyStandard) Enzyme(level string) (enz wtype.TypeIIs, err error)

Enzyme returns the typeIIs enzyme for a specified named AssemblyLevel. An error is returned if an invalid level is requested for the AssemblyStandard.

func (AssemblyStandard) GetLevel

func (l AssemblyStandard) GetLevel(level string) (assemblyLevel AssemblyLevel, err error)

GetLevel returns an AssemblyLevel for a specified named AssemblyLevel. An error is returned if an invalid level is requested for the AssemblyStandard.

func (AssemblyStandard) LevelNames

func (l AssemblyStandard) LevelNames() []string

LevelNames returns the names of all valid Assembly Levels for an AssemblyStandard.

type Assemblyparameters

type Assemblyparameters struct {
	Constructname string              `json:"construct_name"`
	Enzymename    string              `json:"enzyme_name"`
	Vector        wtype.DNASequence   `json:"vector"`
	Partsinorder  []wtype.DNASequence `json:"parts_in_order"`
}

Assemblyparameters are parameters used by the AssemblySimulator function.

func (Assemblyparameters) Insert

func (assemblyParameters Assemblyparameters) Insert(result wtype.DNASequence) (insert wtype.DNASequence, err error)

Insert will find the inserted DNA region as a linear DNA sequence from a set of assembly parameters and the assembled sequence.

func (Assemblyparameters) ToString

func (assemblyParameters Assemblyparameters) ToString() string

ToString returns a summary of the names of all components specified in the Assemblyparameters variable

type DigestedFragment

type DigestedFragment struct {

	// Sequence of top strand
	TopStrand string

	// Sequence of bottom strand
	BottomStrand string

	// FivePrimeTopStrandStickyend is any over hang at the 5' end of the coding strand
	// This will be greater than "" if the fragment was generated by cutting with an enzyme which leaves a 5' overhang.
	// The complementary sticky end will be on the FivePrimeBottomStrandStickyend.
	// If this is not "" this will be the first part of the TopStrand sequence.
	FivePrimeTopStrandStickyend string

	// FivePrimeBottomStrandStickyend is any over hang at the 5' end of the complementary strand
	// This may be referred to as an underhang.
	// This will be greater than "" if the fragment was generated by cutting with an enzyme which leaves a 5' overhang.
	// The complementary sticky end will be on the FivePrimeTopStrandStickyend.
	// This sequence or it's reverse complement will not be present on the end of the Top strand.
	FivePrimeBottomStrandStickyend string

	// TopStickyend_3prime is any over hang at the 3' end of the coding strand.
	// This may be referred to as an underhang.
	// This will be greater than "" if the fragment was generated by cutting with an enzyme which leaves a 3' overhang.
	// The complementary sticky end will be on the BottomStickyend_3prime.
	// This sequence will be present on the end of the Top strand.
	ThreePrimeTopStrandStickyend string

	// BottomStickyend_3prime is any over hang at the 3' end of the complementary strand.
	// This may be referred to as an underhang.
	// This will be greater than "" if the fragment was generated by cutting with an enzyme which leaves a 3' overhang.
	// The complementary sticky end will be on the TopStickyend_3prime.
	// This sequence or it's reverse complement will not be present at the front of the Top strand.
	ThreePrimeBottomStrandStickyEnd string
}

DigestedFragment object carrying info on a fragment following digestion

func DigestToFragments

func DigestToFragments(sequence wtype.DNASequence, typeIIenzymes ...wtype.RestrictionEnzyme) (finalFragments []DigestedFragment, err error)

DigestToFragments will simulate digestion of a DNA sequence with one or more restriction enzymes; returns the products of the digestion in the form of a set of DigestedFragment.

func FindAllAssemblyProducts

func FindAllAssemblyProducts(vector wtype.DNASequence, partsInAnyOrder []wtype.DNASequence, enzymes ...wtype.TypeIIs) (assembledfragments []DigestedFragment, plasmidproducts []wtype.DNASequence, err error)

FindAllAssemblyProducts will return all assembly products from a set of assembly part sequences. Unlike, JoinXnumberofparts the order of the parts is not important.

func JoinXNumberOfParts

func JoinXNumberOfParts(vector wtype.DNASequence, partsinorder []wtype.DNASequence, enzymes ...wtype.TypeIIs) (assembledfragments []DigestedFragment, plasmidproducts []wtype.DNASequence, inserts []wtype.DNASequence, err error)

JoinXNumberOfParts simulates assembly of a Vector and a list of parts in order using a specified TypeIIs restriction enzyme. Returns an array of partially assembled fragments and fully assembled plasmid products and any error in attempting to assemble the parts.

func (DigestedFragment) Ends

func (fragment DigestedFragment) Ends() string

Ends returns a string description of the 5' and 3' ends of the DigestedFragment

func (DigestedFragment) ToDNASequence

func (fragment DigestedFragment) ToDNASequence(name string) (seq wtype.DNASequence, err error)

ToDNASequence assumes phosphorylation since result of digestion. todo: Check and fix the construction of the digested fragment... This may be produced incorrectly so the error capture steps have been commented out to ensure the Insert function returns the expected result!

type RestrictionSites

type RestrictionSites struct {
	Enzyme    wtype.RestrictionEnzyme
	Positions []sequences.PositionPair
}

RestrictionSites holds information on restriction sites found in a DNA sequence for a specified RestrictionEnzyme.

func Assemblysimulator

func Assemblysimulator(assemblyparameters Assemblyparameters) (s string, successfulassemblies int, sites []RestrictionSites, newDNASequences []wtype.DNASequence, err error)

Assemblysimulator simulates assembly of Assemblyparameters: returns status, number of correct assemblies, any restriction sites found, new DNA Sequences and an error.

Currently the more comprehensive assembly validation function (FindAllAssemblyProducts) tests all part order combinations; this is thorough and more powerful at detecting potential mis assemblies but is very computationally expensive hence there exists a threshold number of parts above which the simpler assembly validation (JoinXNumberOfParts) will occur which will only test the validity of the assembly in the part order specified.

The threshold is currently set to 5 part assemblies (4 parts + vector) which is 5! (120) part order combinations.

func RestrictionSiteFinder

func RestrictionSiteFinder(sequence wtype.DNASequence, enzymelist ...wtype.RestrictionEnzyme) (sites []RestrictionSites)

RestrictionSiteFinder finds restriction sites of specified restriction enzymes in a sequence and return the information as a set of ResrictionSites.

func (*RestrictionSites) AllPositions

func (sites *RestrictionSites) AllPositions() []int

AllPositions returns all forward and reverse restriction site positions.

func (RestrictionSites) ForwardPositions

func (sites RestrictionSites) ForwardPositions() []int

ForwardPositions returns the recognition site positions

func (RestrictionSites) NumberOfSites

func (sites RestrictionSites) NumberOfSites() int

NumberOfSites returns the number of restriction sites found.

func (RestrictionSites) RecognitionSequence

func (sites RestrictionSites) RecognitionSequence() string

RecognitionSequence returns the recognition sequence of the enzyme as a string.

func (RestrictionSites) ReversePositions

func (sites RestrictionSites) ReversePositions() []int

ReversePositions returns the recognition site positions

func (RestrictionSites) SiteFound

func (sites RestrictionSites) SiteFound() bool

SiteFound evaluates whether at least one site has been found.

type StandardOverhangs

type StandardOverhangs struct {
	// Overhang expected to be left at the upstream end of a part after typeIIs digestion.
	Upstream string
	// Overhang expected to be left at the downstream end of a part after typeIIs digestion.
	Downstream string
}

StandardOverhangs represents the upstream and downstream overhangs expected for a part or vector in a level of an Assembly Standard.

Directories

Path Synopsis
Package lookup enables looking up restriction enzyme properties from name.
Package lookup enables looking up restriction enzyme properties from name.

Jump to

Keyboard shortcuts

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