Documentation ¶
Overview ¶
Package primers provides utilities for creating primers and DNA barcodes.
Primers are short sequences of DNA that can be used to amplify DNA sequences and they are the workhorse of modern molecular biology.
Essentially primers are short pieces of single stranded DNA that can bind to a target sequence of single stranded DNA. These primers serve as a marker for polymerases to bind and start adding free floating nucleotides (ACTGs) to a single strand piece of DNA to form a double stranded piece of DNA.
This is a crucial step in the process of PCR (polymerase chain reaction). https://en.wikipedia.org/wiki/Polymerase_chain_reaction
You can read more about that at the link above but just know that an absolute huge number of protocols from diagnostics to plasmid cloning use these primers so they're super important.
Index ¶
- func CreateBarcodes(length int, maxSubSequence int) []string
- func CreateBarcodesGcRange(length int, maxSubSequence int, minGcContent float64, maxGcContent float64) []string
- func CreateBarcodesWithBannedSequences(length int, maxSubSequence int, bannedSequences []string, ...) []string
- func MarmurDoty(sequence string) float64
- func MeltingTemp(sequence string) float64
- func NucleobaseDeBruijnSequence(substringLength int) string
- func SantaLucia(sequence string, ...) (meltingTemp, dH, dS float64)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBarcodes ¶
CreateBarcodes is a simplified version of CreateBarcodesWithBannedSequences with sane defaults.
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/primers" ) func main() { barcodes := primers.CreateBarcodes(20, 4) fmt.Println(barcodes[0]) }
Output: AAAATAAAGAAACAATTAAT
func CreateBarcodesGcRange ¶
func CreateBarcodesGcRange(length int, maxSubSequence int, minGcContent float64, maxGcContent float64) []string
CreateBarcodesGcRange creates a list of barcodes within a given GC range.
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/primers" ) func main() { barcodes := primers.CreateBarcodesGcRange(20, 4, .25, .75) fmt.Println(barcodes[0]) }
Output: GAAACAATTAATGAATCAAG
func CreateBarcodesWithBannedSequences ¶
func CreateBarcodesWithBannedSequences(length int, maxSubSequence int, bannedSequences []string, bannedFunctions []func(string) bool) []string
CreateBarcodesWithBannedSequences creates a list of barcodes given a desired barcode length, the maxSubSequence shared in each barcode, Sequences may be marked as banned by passing a static list, `bannedSequences`, or, if more flexibility is needed, through a list of `bannedFunctions` that dynamically generates bannedSequences. If a sequence is banned, it will not appear within a barcode. The a `bannedFunctions` function can determine if a barcode should be banned or not on the fly. If it is banned, we will continuing iterating until a barcode is found that satisfies the bannedFunction requirement.
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/primers" ) func main() { barcodes := primers.CreateBarcodesWithBannedSequences(20, 4, []string{"CTCTCGGTCGCTCC"}, []func(string) bool{}) fmt.Println(barcodes[0]) }
Output: AAAATAAAGAAACAATTAAT
func MarmurDoty ¶
MarmurDoty calculates the melting point of an extremely short DNA sequence (<15 bp) using a modified Marmur Doty formula [Marmur J & Doty P (1962). Determination of the base composition of deoxyribonucleic acid from its thermal denaturation temperature. J Mol Biol, 5, 109-118.]
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/primers" ) func main() { sequenceString := "ACGTCCGGACTT" meltingTemp := primers.MarmurDoty(sequenceString) fmt.Println(meltingTemp) }
Output: 31
func MeltingTemp ¶
MeltingTemp calls SantaLucia with default inputs for primer and salt concentration.
Example ¶
package main import ( "fmt" "math" "github.com/koeng101/dnadesign/lib/primers" ) func main() { sequenceString := "GTAAAACGACGGCCAGT" // M13 fwd expectedTM := 52.8 meltingTemp := primers.MeltingTemp(sequenceString) withinMargin := math.Abs(expectedTM-meltingTemp)/expectedTM >= 0.02 fmt.Println(withinMargin) }
Output: false
func NucleobaseDeBruijnSequence ¶
NucleobaseDeBruijnSequence generates a DNA DeBruijn sequence with alphabet ATGC. DeBruijn sequences are basically a string with all unique substrings of an alphabet represented exactly once. Code is adapted from https://rosettacode.org/wiki/De_Bruijn_sequences#Go
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/primers" ) func main() { a := primers.NucleobaseDeBruijnSequence(4) fmt.Println(a) }
Output: AAAATAAAGAAACAATTAATGAATCAAGTAAGGAAGCAACTAACGAACCATATAGATACATTTATTGATTCATGTATGGATGCATCTATCGATCCAGAGACAGTTAGTGAGTCAGGTAGGGAGGCAGCTAGCGAGCCACACTTACTGACTCACGTACGGACGCACCTACCGACCCTTTTGTTTCTTGGTTGCTTCGTTCCTGTGTCTGGGTGGCTGCGTGCCTCTCGGTCGCTCCGTCCCGGGGCGGCCGCGCCCCAAA
func SantaLucia ¶
func SantaLucia(sequence string, primerConcentration, saltConcentration, magnesiumConcentration float64) (meltingTemp, dH, dS float64)
SantaLucia calculates the melting point of a short DNA sequence (15-200 bp), using the Nearest Neighbors method [SantaLucia, J. (1998) PNAS, doi:10.1073/pnas.95.4.1460]
Example ¶
package main import ( "fmt" "math" "github.com/koeng101/dnadesign/lib/primers" ) func main() { sequenceString := "ACGATGGCAGTAGCATGC" //"GTAAAACGACGGCCAGT" // M13 fwd testCPrimer := 0.1e-6 // primer concentration testCNa := 350e-3 // salt concentration testCMg := 0.0 // magnesium concentration expectedTM := 62.7 // roughly what we're expecting with a margin of error meltingTemp, _, _ := primers.SantaLucia(sequenceString, testCPrimer, testCNa, testCMg) withinMargin := math.Abs(expectedTM-meltingTemp)/expectedTM >= 0.02 // checking margin of error fmt.Println(withinMargin) }
Output: false
Types ¶
This section is empty.