forked from pydna-group/pydna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: added CRIPSR examples in notebooks issue pydna-group#259
- Loading branch information
Showing
2 changed files
with
293 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# CRISPR-Cas9 Implementation with Oligonucleotide-based CRISPR-Cas9 toolbox for efficient engineering of Komagataella phaffii \n", | ||
"\n", | ||
"\n", | ||
"In this example we wanted to give a real life intuition on how to use the module in practice. \n", | ||
"For this purpose we have chosen to use the oligonucleotide-based CRISPR-Cas9 toolbox that i described here: \n", | ||
"https://academic.oup.com/femsyr/article/doi/10.1093/femsyr/foae026/7740463?login=false " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<img src=\"https://oup.silverchair-cdn.com/oup/backfile/Content_public/Journal/femsyr/24/10.1093_femsyr_foae026/1/m_foae026fig3.jpeg?Expires=1730974846&Signature=iBKvkhkUn1823IljQ~1uFEnKO0VqWrwiXADvCwQLz6Yv8yDEAFkgt~tsLrXKFTmGYIq3ZINcj5a5yNgs4cP4NeCvRcQh7Ad~1ZejIwNrjqw51CJhGcZWPzz~NDr93QVLZZd2Re41cJNFKFmEu756KxrHQxwKTQe2QPMPfiKBvhvo8J28PERj3vNjZ3LQRsFp9qUPpdsZEyWIiNY92jsuy448YyuaGCgaC2ExGDLeuArTEJmq8gtb0QnTPV0dEdtoxIfZpgavdvO~QyqikjCLj6hebUYU1lH7StuS8oqCQE82CXO0IUcjYF6m2Lb0evXhqdLDQe90M-NrKjzNRmBA0A__&Key-Pair-Id=APKAIE5G5CRDK6RD3PGA\"/>" | ||
], | ||
"text/plain": [ | ||
"<IPython.core.display.Image object>" | ||
] | ||
}, | ||
"execution_count": null, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from IPython.display import Image\n", | ||
"Image(url=\"https://oup.silverchair-cdn.com/oup/backfile/Content_public/Journal/femsyr/24/10.1093_femsyr_foae026/1/m_foae026fig3.jpeg?Expires=1730974846&Signature=iBKvkhkUn1823IljQ~1uFEnKO0VqWrwiXADvCwQLz6Yv8yDEAFkgt~tsLrXKFTmGYIq3ZINcj5a5yNgs4cP4NeCvRcQh7Ad~1ZejIwNrjqw51CJhGcZWPzz~NDr93QVLZZd2Re41cJNFKFmEu756KxrHQxwKTQe2QPMPfiKBvhvo8J28PERj3vNjZ3LQRsFp9qUPpdsZEyWIiNY92jsuy448YyuaGCgaC2ExGDLeuArTEJmq8gtb0QnTPV0dEdtoxIfZpgavdvO~QyqikjCLj6hebUYU1lH7StuS8oqCQE82CXO0IUcjYF6m2Lb0evXhqdLDQe90M-NrKjzNRmBA0A__&Key-Pair-Id=APKAIE5G5CRDK6RD3PGA\")\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"Basically we can make two cuts in the genome, and repair it with an oligo.\n", | ||
"\n", | ||
"Let's see how this can be implemented in pydna\n", | ||
"\n", | ||
"We can start by loading in our target. Here we have integrated LAC12 in our K. phaffi strain but want to knock it out. " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/BjornFJohansson/pydna/blob/dev_bjorn/docs/notebooks/Example_CRISPR.ipynb\">\n", | ||
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n", | ||
"</a>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#Install pydna for colab.\n", | ||
"%%capture\n", | ||
"!pip install pydna" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Dseqrecord\n", | ||
"circular: False\n", | ||
"size: 7127\n", | ||
"ID: X06997.1\n", | ||
"Name: X06997\n", | ||
"Description: Kluyveromyces lactis LAC12 gene for lactose permease\n", | ||
"Number of features: 8\n", | ||
"/molecule_type=DNA\n", | ||
"/topology=linear\n", | ||
"/data_file_division=PLN\n", | ||
"/date=25-JUL-2016\n", | ||
"/accessions=['X06997']\n", | ||
"/sequence_version=1\n", | ||
"/keywords=['lactose permease', 'unidentified reading frame']\n", | ||
"/source=Kluyveromyces lactis\n", | ||
"/organism=Kluyveromyces lactis\n", | ||
"/taxonomy=['Eukaryota', 'Fungi', 'Dikarya', 'Ascomycota', 'Saccharomycotina', 'Saccharomycetes', 'Saccharomycetales', 'Saccharomycetaceae', 'Kluyveromyces']\n", | ||
"/references=[Reference(title='Primary structure of the lactose permease gene from the yeast Kluyveromyces lactis. Presence of an unusual transcript structure', ...), Reference(title='Direct Submission', ...)]\n", | ||
"/comment=the sequence submitted starts from the 5'end of LAC4 gene but goes\n", | ||
"to the opposite direction; therefore, base number 1 is -1199 of\n", | ||
"LAC4 gene; for LAC4 gene seq. see\n", | ||
"Mol. Cell. Biol. (1987)7,4369-4376.\n", | ||
"Dseq(-7127)\n", | ||
"GCGA..TTCG\n", | ||
"CGCT..AAGC\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"from pydna.dseqrecord import Dseqrecord\n", | ||
"from pydna.crispr import cas9, protospacer\n", | ||
"from pydna.genbank import Genbank\n", | ||
"\n", | ||
"# initalize your favourite gene\n", | ||
"gb = Genbank(\"[email protected]\") # Tell Genbank who you are!\n", | ||
"gene = gb.nucleotide(\"X06997\") # Kluyveromyces lactis LAC12 gene for lactose permease that have been integrated into K. phaffi\n", | ||
"target_dseq = Dseqrecord(gene)\n", | ||
"print(target_dseq)\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Next we have chosen some guides and can add them to our cas9 enzymes and simulate the cuts." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"cutting with guide 1: (Dseqrecord(-135), Dseqrecord(-6992))\n", | ||
"cutting with guide 2: (Dseqrecord(-6793), Dseqrecord(-334))\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"\n", | ||
"# Choose guides\n", | ||
"guides = [\"CCCTAAGTCCTTTGAAGATT\", \"TATTATTTTGAGGTGCTTTA\"]\n", | ||
"\n", | ||
"# Create an enzyme object with the protospacer\n", | ||
"enzyme = cas9(guides[0])\n", | ||
"\n", | ||
"# Simulate the cut with enzyme1\n", | ||
"print('cutting with guide 1:', target_dseq.cut(enzyme))\n", | ||
"\n", | ||
"# Create an enzyme from the protospacer\n", | ||
"enzyme2 = cas9(guides[1])\n", | ||
"\n", | ||
"# Simulate the cut with enzyme2\n", | ||
"print('cutting with guide 2:', target_dseq.cut(enzyme2))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"With these guides I would be able to generate a stable KO with a repair 60/90mer oligo." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"My repair oligo for this experiment : AGGTGAACACACTCTGATGTAGTGCAGTCCCTAAGTCCTTTGAAGTTACGGACTCCTCGACCGATGCCCTTGAGAGCCTTCAACCCAGTC \n", | ||
"My repair oligo for this experiment length : 90 \n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"repair_oligo = target_dseq.cut(enzyme)[0][-45:]+target_dseq.cut(enzyme2)[-1][:45]\n", | ||
"repair_oligo.name = 'My repair oligo for this experiment'\n", | ||
"print(f'{repair_oligo.name} : {repair_oligo.seq} ')\n", | ||
"print(f'{repair_oligo.name} length : {len(repair_oligo.seq)} ')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The final gene would look like this\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre>name|45\n", | ||
" \\/\n", | ||
" /\\\n", | ||
" 45|My repair oligo for this experiment|45\n", | ||
" \\/\n", | ||
" /\\\n", | ||
" 45|name</pre>" | ||
], | ||
"text/plain": [ | ||
"Contig(-469)" | ||
] | ||
}, | ||
"execution_count": null, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from pydna.assembly import Assembly\n", | ||
"\n", | ||
"my_KO = Assembly((target_dseq.cut(enzyme)[0],repair_oligo, target_dseq.cut(enzyme2)[-1]), limit = 20 )\n", | ||
"my_assembly_KO, *rest = my_KO.assemble_linear()\n", | ||
"my_assembly_KO" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".venv", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |