Skip to content

Commit 9b7d07c

Browse files
Tutorial refactor (#443)
* fixed typo. * updated comment * reorderd tutorial chapters. * created short tutorial on primer design * deleted dna parts tutorial wireframe. * explained PCR cycles and caveats. * renamed primer design tutorial. * disabled whitespace linting. * now using output of append.
1 parent 8c1d5c0 commit 9b7d07c

File tree

7 files changed

+130
-12
lines changed

7 files changed

+130
-12
lines changed

‎.golangci.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ linters:
2020
- stylecheck
2121
- unconvert
2222
- unparam
23-
- whitespace
2423
linters-settings:
2524
stylecheck:
2625
# https://staticcheck.io/docs/options#checks

‎tutorials/001_input_output_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Tim
4747
******************************************************************************/
4848

4949
// if you're using VS-CODE you should see a DEBUG TEST button right below this
50-
// comment. Please set break points and use it early and often.
50+
// comment. Please set break points and use them early and often.
5151
func TestFileIOTutorial(t *testing.T) {
5252
// First we're going to read in a Genbank file for the well known plasmid
5353
// backbone puc19. Plasmids are super small rings of "Circular DNA" that are
@@ -110,7 +110,7 @@ func TestFileIOTutorial(t *testing.T) {
110110
}
111111

112112
// We'll go into more detail about features and DNA parts
113-
// in the next tutorial but for now know that we can also
113+
// later in this tutorial series but for now know that we can also
114114
// get the sequence of each feature using the GetSequence method.
115115

116116
feature := puc19.Features[1]

‎tutorials/002_dna_parts_test.go‎

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package tutorials_test
2+
3+
import (
4+
"fmt"
5+
"log"
6+
"testing"
7+
8+
"github.com/bebop/poly/io/genbank"
9+
"github.com/bebop/poly/primers/pcr"
10+
)
11+
12+
/******************************************************************************
13+
Sep, 12, 2022
14+
15+
== Designing Primers for Just About Anything ==
16+
17+
Now that you've learned what plasmids are you should probably know what primers
18+
are as well.
19+
20+
"Primers are short sequences of DNA that can be used to amplify DNA sequences
21+
and they are the workhorse of modern molecular biology.
22+
23+
Essentially primers are short pieces of single stranded DNA that can
24+
bind to a target sequence of single stranded DNA. These primers serve as a
25+
marker for polymerases (the enzyme Poly is named after!) to bind and start adding
26+
free floating nucleotides (ACTGs) to a single strand piece of DNA to form a
27+
double stranded piece of DNA.
28+
29+
This is a crucial step in the process of PCR (polymerase chain reaction).
30+
https://en.wikipedia.org/wiki/Polymerase_chain_reaction
31+
32+
Here's also a video animation from Cold Spring Harbor's DNA Learning center explaining the process.
33+
https://youtu.be/2KoLnIwoZKU?si=wqKs1NU5ZhU5O7Ui
34+
35+
You can read more about that at the link above but just know that an absolute huge
36+
number of protocols from diagnostics to plasmid cloning use these primers so they're
37+
super important."
38+
39+
- From the Poly's primer design package level documentation
40+
41+
42+
Primers are the workhorse of modern molecular biology. They're involved in almost
43+
every molecular biology experiment and are a crucial component in modern lab
44+
diagnostics.
45+
46+
In This tutorial we're going to design a large set of primers to help us extract and
47+
isolate every protein coding region in the bacillus subtilis genome so we can express
48+
and characterize each protein's structure individually in vivo (in the lab).
49+
50+
We could also use these primers for RNA interference experiments to suppress
51+
protein expression in vivo to better understand how these proteins interact.
52+
53+
Point is that primers are incredibly versatile tools by automating their design
54+
we can do some pretty interesting (and even potentially lucrative) experiments.
55+
56+
TTFN,
57+
Tim
58+
******************************************************************************/
59+
60+
// if you're using VS-CODE you should see a DEBUG TEST button right below this
61+
// comment. Please set break points and use them early and often.
62+
func TestPrimersTutorial(t *testing.T) {
63+
64+
// This is a struct that we'll use to store the results of our primer designs for cloning out each gene
65+
type CloneOut struct {
66+
CDS genbank.Feature
67+
Sequence string
68+
ForwardPrimer string
69+
ReversePrimer string
70+
}
71+
72+
var reactions []CloneOut // <- declaring our list of primers so we can append to it
73+
74+
// First let's get our annotated bacillus subtillus genome
75+
bsub, err := genbank.Read("../data/bsub.gbk")
76+
77+
if err != nil {
78+
log.Fatal(err)
79+
}
80+
81+
// For each feature in the genome we're going to design a primer pair if the feature is a coding sequence
82+
for _, feature := range bsub.Features {
83+
if feature.Type == "CDS" { // CDS stands for coding sequence (which means that it codes for a protein in this case)
84+
85+
var reaction CloneOut // initialize our reaction that will be appended
86+
87+
// store the feature and its sequence in our reaction in case we need it later
88+
reaction.CDS = feature
89+
reaction.Sequence, _ = feature.GetSequence()
90+
91+
// generate forward and reverse primers and store it in our struct
92+
forward, reverse := pcr.DesignPrimers(reaction.Sequence, 56.0) // <- 56.0 is our melting temp. The temperature at which we want our primers to bind to double stranded DNA. Again. don't hardcode values like this in real life. Put it in a constant or something.
93+
reaction.ForwardPrimer = forward
94+
reaction.ReversePrimer = reverse
95+
96+
// append our reaction to a our reactions slice (slice is essentially Go's version of a list, or vector)
97+
reactions = append(reactions, reaction)
98+
}
99+
}
100+
101+
fmt.Println("Total reactions:", len(reactions))
102+
// We've now just generated ~5000 primers.
103+
// Notice how the only numerical parameter we give was "melting temp" this is the temp at which they'll anneal to denatured DNA.
104+
// As mentioned in this Cold Spring Harbor video. PCR reactions are conducted in ~30 cycles of heating and cooling over 3 temperature stages.
105+
106+
// Stage 1: We raise the temperature of our reaction to 95C to denature (split) our DNA such that our primers can bind to it.
107+
// Stage 2: We lower the temperature of our reaction to 55C so that our primers can bind to complementary regions of newly accessible single stranded DNA.
108+
// Stage 3: We raise the temperature of our reaction to ~72C (or whatever temperature is best for the polymerase we're using) to activate our polymerase
109+
// Stage 3 (cont): to bind to our primers and begin constructing a brand new second strand to our denatured DNA. Then we go back to Stage 1.
110+
111+
// For each cycle of the above stage we end up doubling the number of copies of the gene we want so after we have n^30 copies of our desired region.
112+
113+
// What we've done is design a gigantic set of primers that share the same melting temp. This makes it possible to run all of these reactions
114+
// concurrently within a single PCR run but we've ignored a lot of other design considerations.
115+
116+
// This primers aren't particularly well designed. All pcr.DesignPrimers has done is figure out how long each primer should be so that they all bind
117+
// at a specific temperature while assuming that they should bind at the very beginning and end of each given sequence. This is an extremely common
118+
// use case but there are several caveats.
119+
120+
// 1. The designed primers could be dimers (The primers could bind to each other and not to their target sequence)
121+
// 2. One primer in a pair could be a "hairpin" that binds to itself (which is something the fold package can help detect)
122+
// 3. Your primers may actually need a specific configuration to bind to the intended target (something the fold package may be able to help with)
123+
124+
// Depending on your situation you may need to get creative. Lots of scientists design their primers to bind up or downstream of their gene of
125+
// interest to avoid primer dimers or hairpins. Some scientists don't care if they copy the whole gene but just want to copy enough of the
126+
// gene to verify that it's there. There's probably a million different way to design primers but I'd guess that poly itself covers about 95%
127+
// of what most scientists would need on a daily basis.
128+
}

‎tutorials/003_transforming_sequences_test.go‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎tutorials/005_primer_design_test.go‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)