pcr

package
v0.0.0-...-85e8820 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pcr designs and simulates simple PCR reactions.

PCR, or polymerase chain reaction, is a method developed in 1983 to copy DNA templates using small fragments of synthesized single-stranded DNA, amplifying those DNA templates to ~x1,000,000,000 their starting concentration. These small fragments, referred to as "primers" or "oligos", can be designed on a computer and then synthesized for amplifying a variety of different templates.

This package allows users to simulate a PCR reaction or design new primers to amplify a given template. This package assumes perfect annealing to template at a target temperature, so should only be used for PCR reactions where this is a reasonable assumption.

If you are trying to simulate amplification out of a large pool, such as an oligo pool, use the `Simulate` rather than `SimulateSimple` function to detect if there is concatemerization happening in your multiplex reaction. In most other cases, use `SimulateSimple`.

IMPORTANT! The targetTm in all functions is specifically for Taq polymerase.

Example (Basic)

This example shows how to design a sequence.

package main

import (
	"fmt"

	"github.com/koeng101/dnadesign/lib/primers/pcr"
)

func main() {
	gene := "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa"

	// Our cloning scheme requires that we add some overhangs, so lets add them
	// now.
	forwardOverhang := "TTATAGGTCTCATACT"
	reverseOverhang := "ATGAAGAGACCATATA"

	// Let's design primers with our overhangs for a targetTm of 55.
	fwd, rev := pcr.DesignPrimersWithOverhangs(gene, forwardOverhang, reverseOverhang, 55.0)

	// Now we want to be sure that our primer set will only amplify our
	// target sequence, so we'll simulate a PCR reaction. We'll also want
	// to include other sequences that will be in our PCR. For example,
	// perhaps we know that `badFragment` will be within our reaction. This
	// could be another plasmid, another chromosome, or anything else.
	badFragment := "ATGACCATGATTACGCCAAGCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGTCGTGACTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAGCTGGCGTAATAGCGAAGAGGCCCGCACCGATCGCCCTTCCCAACAGTTGCGCAGCCTGAATGGCGAATGGCGCCTGATGCGGTATTTTCTCCTTACGCATCTGTGCGGTATTTCACACCGCATATGGTGCACTCTCAGTACAATCTGCTCTGATGCCGCATAG"
	fragments, _ := pcr.Simulate([]string{gene, badFragment}, 55.0, false, []string{fwd, rev})

	// Now let's make sure it only amplified our target.
	if len(fragments) != 1 {
		fmt.Println("Failed to amplify a single fragment!")
	}

	// Else, print out our primers
	fmt.Printf("%s, %s\n", fwd, rev)
}
Output:

TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG, TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DesignPrimers

func DesignPrimers(sequence string, targetTm float64) (string, string)

DesignPrimers designs two primers to amplify a target sequence and only that target sequence (no overhangs).

Example
package main

import (
	"fmt"

	"github.com/koeng101/dnadesign/lib/primers/pcr"
)

func main() {
	gene := "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa"
	fwd, rev := pcr.DesignPrimers(gene, 55.0)

	fmt.Printf("%s, %s", fwd, rev)
}
Output:

AATAATTACACCGAGATAACACATCATGG, TTAAGAAAGCGCATTTTCCAGC

func DesignPrimersWithOverhangs

func DesignPrimersWithOverhangs(sequence, forwardOverhang, reverseOverhang string, targetTm float64) (string, string)

DesignPrimersWithOverhangs designs two primers to amplify a target sequence, adding on an overhang to the forward and reverse strand. This overhang can contain additional DNA needed for assembly, like Gibson assembly overhangs or GoldenGate restriction enzyme sites.

Example
package main

import (
	"fmt"

	"github.com/koeng101/dnadesign/lib/primers/pcr"
)

func main() {
	gene := "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa"
	forwardOverhang := "TTATAGGTCTCATACT"
	reverseOverhang := "ATGAAGAGACCATATA"
	fwd, rev := pcr.DesignPrimersWithOverhangs(gene, forwardOverhang, reverseOverhang, 55.0)

	fmt.Printf("%s, %s", fwd, rev)
}
Output:

TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG, TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC

func Simulate

func Simulate(sequences []string, targetTm float64, circular bool, primerList []string) ([]string, error)

Simulate simulates a PCR reaction, including concatemerization analysis. It takes in a list of sequences and list of primers, produces all possible PCR fragments in a given reaction, and then attempts to see if the output fragments can amplify themselves. If they can, concatemerization is occurring in your reaction, which can lead to confusing results. The variable `circular` is for if the target template is circular, like a plasmid.

Example
package main

import (
	"fmt"

	"github.com/koeng101/dnadesign/lib/primers/pcr"
)

func main() {
	gene := "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa"
	primers := []string{"TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG", "TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC"}
	fragments, _ := pcr.Simulate([]string{gene}, 55.0, false, primers)

	fmt.Println(fragments)
}
Output:

[TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA]

func SimulateSimple

func SimulateSimple(sequences []string, targetTm float64, circular bool, primerList []string) []string

SimulateSimple simulates a PCR reaction. It takes in a list of sequences and a list of primers, with support for complex multiplex reactions, produces a list of all possible PCR fragments from such a reaction. It does not detect concatemerization, which could be useful or very detrimental to your reactions. The variable `circular` is for if the target template is circular, like a plasmid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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