Documentation
¶
Overview ¶
Package cloningprimer is a software tool that facilitates the design of primer pairs for gene cloning. The project lives at https://github.com/DanielSchuette/cloningPrimer and has a web interface and CLI in addition to its Go API.
Code Example:
package main import ( "fmt" "log" cloningprimer "github.com/DanielSchuette/cloningPrimer" ) func main() { // define an input string (must be a valid nucleotide sequence) input := "ATGCAAAAACGGGCGATTTATCCGGGTACTTTCGATCCCATTACCAATGGTCATATCGATATCGTGACGCGCGCCACGCAGATGTTCGATCACGTTATTCTGGCGATTGCCGCCAGCCCCAGTAAAAAACCGATGTTTACCCTGGAAGAGCGTGTGGCACTGGCACAGCAGGCAACCGCGCATCTGGGGAACGTGGAAGTGGTCGGGTTTAGTGATTTAATGGCGAACTTCGCCCGTAATCAACACGCTACGGTGCTGATTCGTGGCCTGCGTGCGGTGGCAGATTTTGAATATGAAATGCAGCTGGCGCATATGAATCGCCACTTAATGCCGGAACTGGAAAGTGTGTTTCTGATGCCGTCGAAAGAGTGGTCGTTTATCTCTTCATCGTTGGTGAAAGAGGTGGCGCGCCATCAGGGCGATGTCACCCATTTCCTGCCGGAGAATGTCCATCAGGCGCTGATGGCGAAGTTAGCGTAG" // find forward primer with EcoRI restriction site and 5 random nucleotides as an overhang forward, err := cloningprimer.FindForward(input, "GAATTC", 1, 18, 4, false) if err != nil { log.Fatalf("error finding forward primer: %s\n", err) } if forward == "" { log.Fatalf("no forward primer found\n") } // find reverse primer with BamHI restriction site and 3 random nucleotides as an overhang reverse, err := cloningprimer.FindReverse(input, "GGATCC", 1, 20, 3, true) if err != nil { log.Fatalf("error finding reverse primer: %s\n", err) } if reverse == "" { log.Fatalf("no reverse primer found\n") } // print results fmt.Printf("input: %s\nforward primer: %s\nreverse primer: %s\n", input, forward, reverse) }
Index ¶
- Constants
- func AddOverhang(seq string, len int, front bool) string
- func CalculateGC(primer string) (float64, error)
- func CalculateTm(primer string, complementary int) (float64, error)
- func Complement(nucleotide byte) (byte, error)
- func FilterEnzymeMap(enzymeMap map[string]RestrictEnzyme, query string) (map[string]RestrictEnzyme, error)
- func FindForward(seq, restrict string, seqStart, length, random int, startCodon bool) (string, error)
- func FindReverse(seq, restrict string, seqStart, length, random int, stopCodon bool) (string, error)
- func HasStartCodon(seq string, exact bool) bool
- func HasStopCodon1(seq string, exact bool) bool
- func HasStopCodon2(seq string, exact bool) bool
- func HasStopCodon3(seq string, exact bool) bool
- func IsNucleotide(letter byte) bool
- func ParseEnzymesFromFile(file string) (map[string]RestrictEnzyme, error)
- func ParseSequenceFromFile(file string) (string, error)
- func Reverse(seq string) string
- func ValidateSequence(seq []byte) (string, error)
- type RestrictEnzyme
Constants ¶
const ( // Codon is a sequence of 3 nucleotides Codon = 3 // MinimumPrimerLength gives the minimum length that a primer must be MinimumPrimerLength = 10 // MaximumPrimerLength gives the maximum length that a primer can be MaximumPrimerLength = 30 )
Variables ¶
This section is empty.
Functions ¶
func AddOverhang ¶
AddOverhang appends pseudo-random nucleotides as an overhang to the front (`front' = True) or back (`front' = False) of the input nucleotide sequence `seq' (overhang is of length `len')
func CalculateGC ¶ added in v0.0.3
CalculateGC takes a `primer' as an input and returns the GC nucleotide content as a floating point number between 0.0 and 1.0
func CalculateTm ¶ added in v0.0.3
CalculateTm takes a `primer' (5' -> 3') as an input and returns the melting temperature (or Tm) as a floating point number; it uses the formula: Tm = 2°C * (A + T) + 4°C * (C + G) `complementary' indicates how many nucleotides (from the 3' end of the `primer') should be considered if `complementary' is `0', this argument is ignored and the entire `primer' is used for calculations
func Complement ¶
Complement finds the complement of a nucleotide sequence (i.e. Watson-Crick base pairs)
func FilterEnzymeMap ¶
func FilterEnzymeMap(enzymeMap map[string]RestrictEnzyme, query string) (map[string]RestrictEnzyme, error)
FilterEnzymeMap takes a map with keys of type `string' and values of type `RestrictEnzyme' and returns a slice of strings containing enzyme names that match a certain query string `query'
func FindForward ¶
func FindForward(seq, restrict string, seqStart, length, random int, startCodon bool) (string, error)
FindForward finds a forward primer with a `length' number of complementary nucleotides, binding to the specified starting position (`seqStart'), counting from the 5' end) and up to (`seqStart' + `length' - 1); e.g. if `length' = 10 and `start' = 1, a primer will be returned that binds to nucleotides 1 - 10; the boolean `startCodon' indicates if an 'ATG' should be added and is only evaluated if no 'ATG' is found in the input `seq' (if that is the case, 'ATG' adds three nucleotides to the total length of the primer); `random' indicates how many random nucleotides should be added as an overhang; `restrict' is a string giving the recognition sequence of a restriction enzyme
func FindReverse ¶
func FindReverse(seq, restrict string, seqStart, length, random int, stopCodon bool) (string, error)
FindReverse finds a reverse primer with a `length' number of complementary nucleotides, binding to the specified start position measured from the 3' end of `seq' up to nucleotide (`seqStart' + `length' -1); `random' indicates the number of random nucleotides to be added to the primer; `restrict' indicates the restriction enzyme recognition site; the boolean `stopCodon' indicates if a stop codon should be added to the primer (only evaluated if the last 3 nucleotides of the sequence underlying the primer do not make up a valid stop codon - in that case, the stop codon adds three nucleotides to the total length of the primer)
func HasStartCodon ¶
HasStartCodon returns true if the first 3 characters of a given input sequence `seq' are 'ATG' if `exact' is false, the entire sequence is checked for the triplet 'ATG'
func HasStopCodon1 ¶
HasStopCodon1 (see also ...2, ...3) returns true if the first 3 characters of a given input sequence `seq' are reversed complements of the stop codon TAA if `exact' is false, the entire sequence is checked for the reverse complement of TAA
func HasStopCodon2 ¶
HasStopCodon2 tests reverse complement of TAG (see HasStopCodon1)
func HasStopCodon3 ¶
HasStopCodon3 tests reverse complement of TGA (see HasStopCodon1)
func IsNucleotide ¶
IsNucleotide returns a boolean if input rune is a valid nucleotide letter (i.e. one of A/a/T/t/G/g/C/c)
func ParseEnzymesFromFile ¶
func ParseEnzymesFromFile(file string) (map[string]RestrictEnzyme, error)
ParseEnzymesFromFile parses enzyme data (identifiers, recognition sequences, etc.) from a *.re file (see the example in ./assets/enzymes.re) and returns a map with enzyme names as keys and `restricEnzyme' structs as values
func ParseSequenceFromFile ¶
ParseSequenceFromFile parses a plasmid or DNA sequence from a *.seq file (see the example in ./assets/tp53.seq) and returns the sequence as a string
func Reverse ¶
Reverse finds the reverse of a nucleotide sequence; it requires prior checking of possible sources of errors (for example, it does not check if the input sequence contains invalid nucleotide letters); thus, `Reverse' should be called in the context of a valid `seq' input argument
func ValidateSequence ¶ added in v0.0.3
ValidateSequence takes a slice of bytes as an input and checks if it contains anything else but valid nucleotide letters ('A', 'G', 'T', 'C'); lower case letters are accepted and capitalized '/n' and white spaces are silently ignored and a valid sequence is returned to the caller
Types ¶
type RestrictEnzyme ¶
type RestrictEnzyme struct { Name string /* e.g. EcoRI */ RecognitionSite string /* e.g. AACGTT */ NoPalinCleav string /* either "no" or "(...)(...)", see *.re specification in ./assets/enzymes.re */ ID string /* the PDB ID of the enzyme */ Isoschizomeres []string /* common isoschizomeres */ }
RestrictEnzyme is an internally used struct that holds data of a certain restriction enzyme