primers

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBarcodes

func CreateBarcodes(length int, maxSubSequence int) []string

CreateBarcodes is a simplified version of CreateBarcodesWithBannedSequences with sane defaults.

Example
barcodes := CreateBarcodes(20, 4)

fmt.Println(barcodes[0])
Output:

AAAATAAAGAAACAATTAAT

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
barcodes := CreateBarcodesWithBannedSequences(20, 4, []string{"CTCTCGGTCGCTCC"}, []func(string) bool{})

fmt.Println(barcodes[0])
Output:

AAAATAAAGAAACAATTAAT

func MarmurDoty

func MarmurDoty(sequence string) float64

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
sequenceString := "ACGTCCGGACTT"
meltingTemp := MarmurDoty(sequenceString)

fmt.Println(meltingTemp)
Output:

31

func MeltingTemp

func MeltingTemp(sequence string) float64

MeltingTemp calls SantaLucia with default inputs for primer and salt concentration.

Example
sequenceString := "GTAAAACGACGGCCAGT" // M13 fwd
expectedTM := 52.8
meltingTemp := MeltingTemp(sequenceString)
withinMargin := math.Abs(expectedTM-meltingTemp)/expectedTM >= 0.02

fmt.Println(withinMargin)
Output:

false

func NucleobaseDeBruijnSequence

func NucleobaseDeBruijnSequence(substringLength int) string

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
a := 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
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, _, _ := 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.

Jump to

Keyboard shortcuts

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