Skip to content

Commit

Permalink
Merge pull request #3 from manulera/manu_todo_2
Browse files Browse the repository at this point in the history
manu todo 2
  • Loading branch information
JeffXiePL authored Sep 1, 2024
2 parents 41e68b8 + b7275ac commit 6e38423
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 37 deletions.
8 changes: 4 additions & 4 deletions docs/notebooks/Gibson.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"\n",
"The `Assembly` class simulates Gibson assembly by searching for homologous sequence pairings. The `Assembly` class needs a list of DNA fragments, given in the datatype of `Dseqrecord` objects, and a minimum length of DNA (`limit` parameter)for which a sequence homology is considered.\n",
"\n",
"The example below shows how to create an `Assembly` object using multiple DNA fragments. Although the example below creates `Dseqrecord` objects for the sake of example, you can also perform assembly using real DNA records parsed as `Dseqrecords`. The bottom of the page offers another example from literature that applies real sequences."
"The example below shows how to create an `Assembly` object using multiple DNA fragments. `Assembly` takes `Dseqrecord` objects as input that you can directly instantiate (first example), or parse from files (second example)."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -63,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -87,7 +87,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/Importing_Seqs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
82 changes: 58 additions & 24 deletions docs/notebooks/PCR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -51,7 +51,7 @@
"//"
]
},
"execution_count": null,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -80,16 +80,22 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The results of PCR are stored as a `Dseqrecord` object, with all the features inside of the amplicon included. Note how the example gene has been retained as a feature in `amplicon`. In addition, two new feature has been added to the record to indicate the forward and reverse primer binding region. \n",
"todo_manu:\n",
"\n",
"`pydna` also allows modelling for PCR with extra bases on the 5' end of primers. This functionality is useful for modelling molecular cloning with multiple steps, where you might want to add different restriction sites to amplicons and ensure that that the right amplicons have been generated. \n",
" \n",
"For instance, to make sure that I can add a HindIII restriction site (AAGCTT)at the end of my `example_gene` without accidental hybridisation with other parts of the circular sequence, I can perform PCR using `pydna`. "
"* pcr does not return a `Dseqrecord` object, but an `Amplicon` object (subclass of `Dseqrecord`).\n",
"* Amplicon is not necessarily the word people commonly use to refer to PCR products, so I would use \"PCR product\" throughout the guide. For instance, start below with something like \"the function `pcr` returns the PCR product as an `Amplicon` object, which is a subclass of `Dseqrecord`, with some extra methods (see below -> figure, etc.)\"\n",
"\n",
"\n",
"The results of PCR are stored as a `Dseqrecord` object, with all the features inside of the amplicon included. Note how the example gene has been retained as a feature in `amplicon`. In addition, two new features have been added to the record to indicate the forward and reverse primer binding regions.\n",
"\n",
"`pydna` also allows modelling for PCR with extra bases on the 5' end of primers. This functionality is useful for modelling molecular cloning with multiple steps, where you might want to add different restriction sites to amplicons and ensure that that the right amplicons have been generated.\n",
"\n",
"For instance, to make sure that I can add a HindIII restriction site (AAGCTT)at the end of my `example_gene` without accidental hybridisation with other parts of the circular sequence, I can perform PCR using `pydna`."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -121,7 +127,7 @@
"//"
]
},
"execution_count": null,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -152,7 +158,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -171,12 +177,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"todo_manu: here you mention map but you use figure.\n",
"\n",
"We can also visualize the amplicon as a visual map, using the `.map` method."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -202,25 +210,49 @@
"source": [
"# Designing Primers and Calculating Tm in pydna\n",
"\n",
"todo_manu:\n",
"\n",
"* for instance, here instead of saying \"that match the desired amplicon\", use \"that produce the desired PCR product\".\n",
"* Here you want to start with an example where the user sets the minimal length and desired Tm for the primers, instead of using the defaults. You can also mention what the defaults are. I see you mention this below, but typically people will have their own Tm in mind, so it is good to start with that.\n",
"\n",
"`pydna` also provides methods to design primers based on the target sequence, and to calculate the melting temperature (Tm) of a sequence. The primer design method generates primers that match the desired amplicon and has has an appropriate Tm. The formula for Tm calculation in `pydna` is sourced from Rychlik et al (1990), found [here](http://www.ncbi.nlm.nih.gov/pubmed/2243783). \n",
"\n",
"The `primer_design` method is found in the `pydna.design` module. All we need is the desired sequence for PCR, and the method returns a pair of minimum 13bp primer designed to achieve a Tm of 55 degrees celcius. In the following example below, I also use zero-based indexing on the `Dseqrecord` to find the sequence of my example gene, for which I would like to clone via PCR. Please refer to the `Dseq` page for more information on indexing a sequence. "
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'record' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 4\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpydna\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdesign\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m primer_design\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m#Designing the primers\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m primers \u001b[38;5;241m=\u001b[39m primer_design(\u001b[43mrecord\u001b[49m[\u001b[38;5;241m6\u001b[39m:\u001b[38;5;241m51\u001b[39m])\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m#Visualising the output\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28mprint\u001b[39m(primers\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgb\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n",
"\u001b[0;31mNameError\u001b[0m: name 'record' is not defined"
"name": "stdout",
"output_type": "stream",
"text": [
"LOCUS example_gene 45 bp DNA linear UNK 01-JAN-1980\n",
"DEFINITION pcr_product_f45 example_gene_r45 example_gene.\n",
"ACCESSION example_gene\n",
"VERSION example_gene\n",
"KEYWORDS .\n",
"SOURCE .\n",
" ORGANISM .\n",
" .\n",
"FEATURES Location/Qualifiers\n",
" gene 1..45\n",
" /label=\"example_gene\"\n",
" primer_bind 1..19\n",
" /label=\"f45\"\n",
" /PCR_conditions=\"primer sequence:ATTCCTGCAGAGTACATCA\"\n",
" /ApEinfo_fwdcolor=\"#baffa3\"\n",
" /ApEinfo_revcolor=\"#ffbaba\"\n",
" primer_bind complement(26..45)\n",
" /label=\"r45\"\n",
" /PCR_conditions=\"primer sequence:ACCATCCGAAGATATCTTCA\"\n",
" /ApEinfo_fwdcolor=\"#baffa3\"\n",
" /ApEinfo_revcolor=\"#ffbaba\"\n",
"ORIGIN\n",
" 1 attcctgcag agtacatcaa ttctatgaag atatcttcgg atggt\n",
"//\n"
]
}
],
Expand All @@ -238,16 +270,16 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The forward and reverse primer sequences are found in the features list of the `Amplicon` object. Note how my example gene is retained, as appropriate. \n",
"The forward and reverse primer sequences are found in the features list of the `Amplicon` object. Note how the feature representing the example gene is retained, as appropriate. \n",
"\n",
"If you already have a forward / reverse primer, or would like to specify a different Tm, `primer_design` also allows these information to be taken as inputs as method parameters. `fp` specifies the forward primer, `rp` specifies the reverse primers, `target_tm` specifies the desired tm. `fp` and `rp` can be should be given as `Primer` objects. \n",
"If you already have a forward / reverse primer, or would like to specify a different Tm, `primer_design` also allows this information to be taken as arguments. `fp` specifies the forward primer, `rp` specifies the reverse primers, `target_tm` specifies the desired tm. `fp` and `rp` can be should be given as `Primer` objects. \n",
"\n",
"For instance, if I already have a forward primer containing an EcoRI restriction site, and I aim to to generate a reverse primer of a similar Tm, I can apply the following code: "
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -295,12 +327,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"todo_manu: here I would say that pydna comes with some functions to calculate tms, that we recommend tm_default that uses a formula from paper X and uses some default values that can be changed, and indicate that they can have a look in more detail to the pydna.tm module. In other words, name this section as \"Calculating Tm in pydna\" or something similar, otherwise it might be hard to find for the user, since it's mentioned as an afterthought to the primer designer tool.\n",
"\n",
"For each individual primer, you can also calculate its Tm using the `tm_default`, ensuring that the Tm of both primers match. The temperature is given in degrees celcius."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -342,7 +376,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
21 changes: 13 additions & 8 deletions docs/notebooks/Restrict_Ligate_Cloning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -65,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -125,7 +125,7 @@
"source": [
"There are two EcoRV recognition sites in `sample_seq`, and coupled with the one EcoRI recognition site, three DNA fragments are returned. Note how `Dseqrecord` returns the blunt end after EcoRV cuts. \n",
"\n",
"You can model any, and and number of, enzymes with the `cut` method and `Bio.Restriction` module. This makes `pydna` a quick and powerful method to plan your molecular cloning experiments, for instance to check the restriction digests of a 10kb plasmid with multiple enzymes. For users that imputted sequences as a string using the `Dseq` class, `cut` can also be normally. \n",
"You can model any, and and number of, enzymes with the `cut` method and `Bio.Restriction` module. This makes `pydna` a quick and powerful method to plan your molecular cloning experiments, for instance to check the restriction digests of a 10kb plasmid with multiple enzymes. `cut` is also a method of the `Dseq` class, so `Dseq`s can be used as well. \n",
"\n",
"## Ligating fragments\n",
"\n",
Expand All @@ -134,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -164,7 +164,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also join blunt ends in a similar way. Note that the sticky-ends must be a perfect match to join. If `+` ligation (or any other method, really) doesn't work, make sure that 1. you are indeed performing the operation on `Dseqrecord` objects, as opposed to other data types (e.g lists, strings, etc) and 2. `Dseqrecord` and the correct enzyme name (with correct roman numeral spelling) has been imported. "
"We can also join blunt ends in a similar way. Note that the sticky-ends must be a perfect match to join. If `+` ligation (or any other method, really) doesn't work, make sure that:\n",
"\n",
"1. you are indeed performing the operation on `Dseqrecord` objects, as opposed to other data types (e.g lists, strings, etc)\n",
"2. `Dseqrecord` and the correct enzyme name (with correct roman numeral spelling) has been imported. "
]
},
{
Expand All @@ -173,12 +176,14 @@
"source": [
"## Circularizing fragments\n",
"\n",
"manu_todo: here insist on the fact that looped returns a sequence and does not act in place.\n",
"\n",
"To circularize a cut DNA sequence into a plasmid is easy. `pydna` provides the `looped` method to circularise a `Dseqrecord`"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -216,7 +221,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -269,7 +274,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 6e38423

Please sign in to comment.