From 6bf063f49067a85d7b2348b297a15f0f50e6fb45 Mon Sep 17 00:00:00 2001 From: Lucas Levassor Date: Thu, 3 Oct 2024 11:41:22 +0200 Subject: [PATCH 1/6] fourth trt --- docs/notebooks/CRISPR.ipynb | 31 ++- docs/notebooks/Dseq.ipynb | 9 + docs/notebooks/Dseq_Features.ipynb | 9 + docs/notebooks/Example_Gibson.ipynb | 215 ++----------------- docs/notebooks/Example_Restriction.ipynb | 9 + docs/notebooks/Gibson.ipynb | 9 + docs/notebooks/Importing_Seqs.ipynb | 9 + docs/notebooks/PCR.ipynb | 9 + docs/notebooks/Restrict_Ligate_Cloning.ipynb | 9 + 9 files changed, 89 insertions(+), 220 deletions(-) mode change 100644 => 100755 docs/notebooks/Example_Restriction.ipynb mode change 100644 => 100755 docs/notebooks/Importing_Seqs.ipynb mode change 100644 => 100755 docs/notebooks/PCR.ipynb diff --git a/docs/notebooks/CRISPR.ipynb b/docs/notebooks/CRISPR.ipynb index 4ecdfe0d..9ca6fcff 100644 --- a/docs/notebooks/CRISPR.ipynb +++ b/docs/notebooks/CRISPR.ipynb @@ -13,6 +13,15 @@ "The `pydna.crispr` module contains the `cas9` class to simulate the biological activites of the Cas9 protein and the guideRNA, which should be imported. In addtion, the `Dseqrecord` class has also been imported to generate an example target_sequence." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, @@ -34,15 +43,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[]\n" - ] - } - ], + "outputs": [], "source": [ "# Defining the target sequence\n", "sequence = Dseqrecord(\"GTTACTTTACCCGACGTCCCCGG\")\n", @@ -56,15 +57,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0\n" - ] - } - ], + "outputs": [], "source": [ "# Initializing the Cas9 protein\n", "enzyme = cas9(protospacer=gRNA_sequence[0])\n", @@ -95,7 +88,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/docs/notebooks/Dseq.ipynb b/docs/notebooks/Dseq.ipynb index bb96da49..51cc99ea 100644 --- a/docs/notebooks/Dseq.ipynb +++ b/docs/notebooks/Dseq.ipynb @@ -8,6 +8,15 @@ "> Visit the full library documentation [here](https://bjornfjohansson.github.io/pydna/)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/docs/notebooks/Dseq_Features.ipynb b/docs/notebooks/Dseq_Features.ipynb index e25158d0..e23af24d 100644 --- a/docs/notebooks/Dseq_Features.ipynb +++ b/docs/notebooks/Dseq_Features.ipynb @@ -15,6 +15,15 @@ "pydna offers many ways to easily view, add, extract, and write features into a Genbank file via the `Dseqrecord` class. After reading a file into a `Dseqrecord` object, we can check out the list of features in the record using the following code. This example uses the sample record [U49845](https://www.ncbi.nlm.nih.gov/genbank/samplerecord/)." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Example_Gibson.ipynb b/docs/notebooks/Example_Gibson.ipynb index 8c514bf6..36806a43 100644 --- a/docs/notebooks/Example_Gibson.ipynb +++ b/docs/notebooks/Example_Gibson.ipynb @@ -12,6 +12,15 @@ "Source files can be found alongside this notebook, if you would like to follow along. Annotations are made alongside the code to describe key steps.\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, @@ -31,169 +40,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "LOCUS EU140750 8128 bp DNA circular SYN 15-SEP-2007\n", - "DEFINITION Cloning vector pCC1BAC, complete sequence.\n", - "ACCESSION EU140750\n", - "VERSION EU140750.1\n", - "KEYWORDS .\n", - "SOURCE Cloning vector pCC1BAC\n", - " ORGANISM Cloning vector pCC1BAC\n", - " other sequences; artificial sequences; vectors.\n", - "REFERENCE 1 (bases 1 to 8128)\n", - " AUTHORS EPICENTRE Biotechnologies.\n", - " TITLE Direct Submission\n", - " JOURNAL Submitted (23-AUG-2007) 726 Post Road, Madison, WI 53713, USA\n", - "FEATURES Location/Qualifiers\n", - " source 1..8128\n", - " /organism=\"Cloning vector pCC1BAC\"\n", - " /mol_type=\"other DNA\"\n", - " /db_xref=\"taxon:468515\"\n", - "ORIGIN\n", - " 1 gcggccgcaa ggggttcgcg tcagcgggtg ttggcgggtg tcggggctgg cttaactatg\n", - " 61 cggcatcaga gcagattgta ctgagagtgc accatatgcg gtgtgaaata ccacacagat\n", - " 121 gcgtaaggag aaaataccgc atcaggcgcc attcgccatt cagctgcgca actgttggga\n", - " 181 agggcgatcg gtgcgggcct cttcgctatt acgccagctg gcgaaagggg gatgtgctgc\n", - " 241 aaggcgatta agttgggtaa cgccagggtt ttcccagtca cgacgttgta aaacgacggc\n", - " 301 cagtgaattg taatacgact cactataggg cgaattcgag ctcggtaccc ggggatcctc\n", - " 361 tagagtcgac ctgcaggcat gcaagcttga gtattctata gtctcaccta aatagcttgg\n", - " 421 cgtaatcatg gtcatagctg tttcctgtgt gaaattgtta tccgctcaca attccacaca\n", - " 481 acatacgagc cggaagcata aagtgtaaag cctggggtgc ctaatgagtg agctaactca\n", - " 541 cattaattgc gttgcgctca ctgcccgctt tccagtcggg aaacctgtcg tgccagctgc\n", - " 601 attaatgaat cggccaacgc gaaccccttg cggccgcccg ggccgtcgac caattctcat\n", - " 661 gtttgacagc ttatcatcga atttctgcca ttcatccgct tattatcact tattcaggcg\n", - " 721 tagcaaccag gcgtttaagg gcaccaataa ctgccttaaa aaaattacgc cccgccctgc\n", - " 781 cactcatcgc agtactgttg taattcatta agcattctgc cgacatggaa gccatcacaa\n", - " 841 acggcatgat gaacctgaat cgccagcggc atcagcacct tgtcgccttg cgtataatat\n", - " 901 ttgcccatgg tgaaaacggg ggcgaagaag ttgtccatat tggccacgtt taaatcaaaa\n", - " 961 ctggtgaaac tcacccaggg attggctgag acgaaaaaca tattctcaat aaacccttta\n", - " 1021 gggaaatagg ccaggttttc accgtaacac gccacatctt gcgaatatat gtgtagaaac\n", - " 1081 tgccggaaat cgtcgtggta ttcactccag agcgatgaaa acgtttcagt ttgctcatgg\n", - " 1141 aaaacggtgt aacaagggtg aacactatcc catatcacca gctcaccgtc tttcattgcc\n", - " 1201 atacgaaatt ccggatgagc attcatcagg cgggcaagaa tgtgaataaa ggccggataa\n", - " 1261 aacttgtgct tatttttctt tacggtcttt aaaaaggccg taatatccag ctgaacggtc\n", - " 1321 tggttatagg tacattgagc aactgactga aatgcctcaa aatgttcttt acgatgccat\n", - " 1381 tgggatatat caacggtggt atatccagtg atttttttct ccattttagc ttccttagct\n", - " 1441 cctgaaaatc tcgataactc aaaaaatacg cccggtagtg atcttatttc attatggtga\n", - " 1501 aagttggaac ctcttacgtg ccgatcaacg tctcattttc gccaaaagtt ggcccagggc\n", - " 1561 ttcccggtat caacagggac accaggattt atttattctg cgaagtgatc ttccgtcaca\n", - " 1621 ggtatttatt cgcgataagc tcatggagcg gcgtaaccgt cgcacaggaa ggacagagaa\n", - " 1681 agcgcggatc tgggaagtga cggacagaac ggtcaggacc tggattgggg aggcggttgc\n", - " 1741 cgccgctgct gctgacggtg tgacgttctc tgttccggtc acaccacata cgttccgcca\n", - " 1801 ttcctatgcg atgcacatgc tgtatgccgg tataccgctg aaagttctgc aaagcctgat\n", - " 1861 gggacataag tccatcagtt caacggaagt ctacacgaag gtttttgcgc tggatgtggc\n", - " 1921 tgcccggcac cgggtgcagt ttgcgatgcc ggagtctgat gcggttgcga tgctgaaaca\n", - " 1981 attatcctga gaataaatgc cttggccttt atatggaaat gtggaactga gtggatatgc\n", - " 2041 tgtttttgtc tgttaaacag agaagctggc tgttatccac tgagaagcga acgaaacagt\n", - " 2101 cgggaaaatc tcccattatc gtagagatcc gcattattaa tctcaggagc ctgtgtagcg\n", - " 2161 tttataggaa gtagtgttct gtcatgatgc ctgcaagcgg taacgaaaac gatttgaata\n", - " 2221 tgccttcagg aacaatagaa atcttcgtgc ggtgttacgt tgaagtggag cggattatgt\n", - " 2281 cagcaatgga cagaacaacc taatgaacac agaaccatga tgtggtctgt ccttttacag\n", - " 2341 ccagtagtgc tcgccgcagt cgagcgacag ggcgaagccc tcgagctggt tgccctcgcc\n", - " 2401 gctgggctgg cggccgtcta tggccctgca aacgcgccag aaacgccgtc gaagccgtgt\n", - " 2461 gcgagacacc gcggccggcc gccggcgttg tggatacctc gcggaaaact tggccctcac\n", - " 2521 tgacagatga ggggcggacg ttgacacttg aggggccgac tcacccggcg cggcgttgac\n", - " 2581 agatgagggg caggctcgat ttcggccggc gacgtggagc tggccagcct cgcaaatcgg\n", - " 2641 cgaaaacgcc tgattttacg cgagtttccc acagatgatg tggacaagcc tggggataag\n", - " 2701 tgccctgcgg tattgacact tgaggggcgc gactactgac agatgagggg cgcgatcctt\n", - " 2761 gacacttgag gggcagagtg ctgacagatg aggggcgcac ctattgacat ttgaggggct\n", - " 2821 gtccacaggc agaaaatcca gcatttgcaa gggtttccgc ccgtttttcg gccaccgcta\n", - " 2881 acctgtcttt taacctgctt ttaaaccaat atttataaac cttgttttta accagggctg\n", - " 2941 cgccctgtgc gcgtgaccgc gcacgccgaa ggggggtgcc cccccttctc gaaccctccc\n", - " 3001 ggtcgagtga gcgaggaagc accagggaac agcacttata tattctgctt acacacgatg\n", - " 3061 cctgaaaaaa cttcccttgg ggttatccac ttatccacgg ggatattttt ataattattt\n", - " 3121 tttttatagt ttttagatct tcttttttag agcgccttgt aggcctttat ccatgctggt\n", - " 3181 tctagagaag gtgttgtgac aaattgccct ttcagtgtga caaatcaccc tcaaatgaca\n", - " 3241 gtcctgtctg tgacaaattg cccttaaccc tgtgacaaat tgccctcaga agaagctgtt\n", - " 3301 ttttcacaaa gttatccctg cttattgact cttttttatt tagtgtgaca atctaaaaac\n", - " 3361 ttgtcacact tcacatggat ctgtcatggc ggaaacagcg gttatcaatc acaagaaacg\n", - " 3421 taaaaatagc ccgcgaatcg tccagtcaaa cgacctcact gaggcggcat atagtctctc\n", - " 3481 ccgggatcaa aaacgtatgc tgtatctgtt cgttgaccag atcagaaaat ctgatggcac\n", - " 3541 cctacaggaa catgacggta tctgcgagat ccatgttgct aaatatgctg aaatattcgg\n", - " 3601 attgacctct gcggaagcca gtaaggatat acggcaggca ttgaagagtt tcgcggggaa\n", - " 3661 ggaagtggtt ttttatcgcc ctgaagagga tgccggcgat gaaaaaggct atgaatcttt\n", - " 3721 tccttggttt atcaaacgtg cgcacagtcc atccagaggg ctttacagtg tacatatcaa\n", - " 3781 cccatatctc attcccttct ttatcgggtt acagaaccgg tttacgcagt ttcggcttag\n", - " 3841 tgaaacaaaa gaaatcacca atccgtatgc catgcgttta tacgaatccc tgtgtcagta\n", - " 3901 tcgtaagccg gatggctcag gcatcgtctc tctgaaaatc gactggatca tagagcgtta\n", - " 3961 ccagctgcct caaagttacc agcgtatgcc tgacttccgc cgccgcttcc tgcaggtctg\n", - " 4021 tgttaatgag atcaacagca gaactccaat gcgcctctca tacattgaga aaaagaaagg\n", - " 4081 ccgccagacg actcatatcg tattttcctt ccgcgatatc acttccatga cgacaggata\n", - " 4141 gtctgagggt tatctgtcac agatttgagg gtggttcgtc acatttgttc tgacctactg\n", - " 4201 agggtaattt gtcacagttt tgctgtttcc ttcagcctgc atggattttc tcatactttt\n", - " 4261 tgaactgtaa tttttaagga agccaaattt gagggcagtt tgtcacagtt gatttccttc\n", - " 4321 tctttccctt cgtcatgtga cctgatatcg ggggttagtt cgtcatcatt gatgagggtt\n", - " 4381 gattatcaca gtttattact ctgaattggc tatccgcgtg tgtacctcta cctggagttt\n", - " 4441 ttcccacggt ggatatttct tcttgcgctg agcgtaagag ctatctgaca gaacagttct\n", - " 4501 tctttgcttc ctcgccagtt cgctcgctat gctcggttac acggctgcgg cgagcgctag\n", - " 4561 tgataataag tgactgaggt atgtgctctt cttatctcct tttgtagtgt tgctcttatt\n", - " 4621 ttaaacaact ttgcggtttt ttgatgactt tgcgattttg ttgttgcttt gcagtaaatt\n", - " 4681 gcaagattta ataaaaaaac gcaaagcaat gattaaagga tgttcagaat gaaactcatg\n", - " 4741 gaaacactta accagtgcat aaacgctggt catgaaatga cgaaggctat cgccattgca\n", - " 4801 cagtttaatg atgacagccc ggaagcgagg aaaataaccc ggcgctggag aataggtgaa\n", - " 4861 gcagcggatt tagttggggt ttcttctcag gctatcagag atgccgagaa agcagggcga\n", - " 4921 ctaccgcacc cggatatgga aattcgagga cgggttgagc aacgtgttgg ttatacaatt\n", - " 4981 gaacaaatta atcatatgcg tgatgtgttt ggtacgcgat tgcgacgtgc tgaagacgta\n", - " 5041 tttccaccgg tgatcggggt tgctgcccat aaaggtggcg tttacaaaac ctcagtttct\n", - " 5101 gttcatcttg ctcaggatct ggctctgaag gggctacgtg ttttgctcgt ggaaggtaac\n", - " 5161 gacccccagg gaacagcctc aatgtatcac ggatgggtac cagatcttca tattcatgca\n", - " 5221 gaagacactc tcctgccttt ctatcttggg gaaaaggacg atgtcactta tgcaataaag\n", - " 5281 cccacttgct ggccggggct tgacattatt ccttcctgtc tggctctgca ccgtattgaa\n", - " 5341 actgagttaa tgggcaaatt tgatgaaggt aaactgccca ccgatccaca cctgatgctc\n", - " 5401 cgactggcca ttgaaactgt tgctcatgac tatgatgtca tagttattga cagcgcgcct\n", - " 5461 aacctgggta tcggcacgat taatgtcgta tgtgctgctg atgtgctgat tgttcccacg\n", - " 5521 cctgctgagt tgtttgacta cacctccgca ctgcagtttt tcgatatgct tcgtgatctg\n", - " 5581 ctcaagaacg ttgatcttaa agggttcgag cctgatgtac gtattttgct taccaaatac\n", - " 5641 agcaatagca atggctctca gtccccgtgg atggaggagc aaattcggga tgcctgggga\n", - " 5701 agcatggttc taaaaaatgt tgtacgtgaa acggatgaag ttggtaaagg tcagatccgg\n", - " 5761 atgagaactg tttttgaaca ggccattgat caacgctctt caactggtgc ctggagaaat\n", - " 5821 gctctttcta tttgggaacc tgtctgcaat gaaattttcg atcgtctgat taaaccacgc\n", - " 5881 tgggagatta gataatgaag cgtgcgcctg ttattccaaa acatacgctc aatactcaac\n", - " 5941 cggttgaaga tacttcgtta tcgacaccag ctgccccgat ggtggattcg ttaattgcgc\n", - " 6001 gcgtaggagt aatggctcgc ggtaatgcca ttactttgcc tgtatgtggt cgggatgtga\n", - " 6061 agtttactct tgaagtgctc cggggtgata gtgttgagaa gacctctcgg gtatggtcag\n", - " 6121 gtaatgaacg tgaccaggag ctgcttactg aggacgcact ggatgatctc atcccttctt\n", - " 6181 ttctactgac tggtcaacag acaccggcgt tcggtcgaag agtatctggt gtcatagaaa\n", - " 6241 ttgccgatgg gagtcgccgt cgtaaagctg ctgcacttac cgaaagtgat tatcgtgttc\n", - " 6301 tggttggcga gctggatgat gagcagatgg ctgcattatc cagattgggt aacgattatc\n", - " 6361 gcccaacaag tgcttatgaa cgtggtcagc gttatgcaag ccgattgcag aatgaatttg\n", - " 6421 ctggaaatat ttctgcgctg gctgatgcgg aaaatatttc acgtaagatt attacccgct\n", - " 6481 gtatcaacac cgccaaattg cctaaatcag ttgttgctct tttttctcac cccggtgaac\n", - " 6541 tatctgcccg gtcaggtgat gcacttcaaa aagcctttac agataaagag gaattactta\n", - " 6601 agcagcaggc atctaacctt catgagcaga aaaaagctgg ggtgatattt gaagctgaag\n", - " 6661 aagttatcac tcttttaact tctgtgctta aaacgtcatc tgcatcaaga actagtttaa\n", - " 6721 gctcacgaca tcagtttgct cctggagcga cagtattgta taagggcgat aaaatggtgc\n", - " 6781 ttaacctgga caggtctcgt gttccaactg agtgtataga gaaaattgag gccattctta\n", - " 6841 aggaacttga aaagccagca ccctgatgcg accacgtttt agtctacgtt tatctgtctt\n", - " 6901 tacttaatgt cctttgttac aggccagaaa gcataactgg cctgaatatt ctctctgggc\n", - " 6961 ccactgttcc acttgtatcg tcggtctgat aatcagactg ggaccacggt cccactcgta\n", - " 7021 tcgtcggtct gattattagt ctgggaccac ggtcccactc gtatcgtcgg tctgattatt\n", - " 7081 agtctgggac cacggtccca ctcgtatcgt cggtctgata atcagactgg gaccacggtc\n", - " 7141 ccactcgtat cgtcggtctg attattagtc tgggaccatg gtcccactcg tatcgtcggt\n", - " 7201 ctgattatta gtctgggacc acggtcccac tcgtatcgtc ggtctgatta ttagtctgga\n", - " 7261 accacggtcc cactcgtatc gtcggtctga ttattagtct gggaccacgg tcccactcgt\n", - " 7321 atcgtcggtc tgattattag tctgggacca cgatcccact cgtgttgtcg gtctgattat\n", - " 7381 cggtctggga ccacggtccc acttgtattg tcgatcagac tatcagcgtg agactacgat\n", - " 7441 tccatcaatg cctgtcaagg gcaagtattg acatgtcgtc gtaacctgta gaacggagta\n", - " 7501 acctcggtgt gcggttgtat gcctgctgtg gattgctgct gtgtcctgct tatccacaac\n", - " 7561 attttgcgca cggttatgtg gacaaaatac ctggttaccc aggccgtgcc ggcacgttaa\n", - " 7621 ccgggctgca tccgatgcaa gtgtgtcgct gtcgacgagc tcgcgagctc ggacatgagg\n", - " 7681 ttgccccgta ttcagtgtcg ctgatttgta ttgtctgaag ttgtttttac gttaagttga\n", - " 7741 tgcagatcaa ttaatacgat acctgcgtca taattgatta tttgacgtgg tttgatggcc\n", - " 7801 tccacgcacg ttgtgatatg tagatgataa tcattatcac tttacgggtc ctttccggtg\n", - " 7861 atccgacagg ttacggggcg gcgacctcgc gggttttcgc tatttatgaa aattttccgg\n", - " 7921 tttaaggcgt ttccgttctt cttcgtcata acttaatgtt tttatttaaa ataccctctg\n", - " 7981 aaaagaaagg aaacgacagg tgctgaaagc gagctttttg gcctctgtcg tttcctttct\n", - " 8041 ctgtttttgt ccgtggaatg aacaatggaa gtccgagctc atcgctaata acttcgtata\n", - " 8101 gcatacatta tacgaagtta tattcgat\n", - "//\n" - ] - } - ], + "outputs": [], "source": [ "# Parsing the files\n", "\n", @@ -230,16 +77,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "76.10205760701717\n", - "72.57935286927591\n" - ] - } - ], + "outputs": [], "source": [ "# (Optional) Checking that the primer Tm are matching\n", "\n", @@ -251,20 +89,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "ValueError", - "evalue": "No PCR product! Template EU140750 8128 bp circular limit=69:\nNo forward primers anneal...\nNo reverse primers anneal...", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[5], line 6\u001b[0m\n\u001b[1;32m 4\u001b[0m pcr_product_F2 \u001b[38;5;241m=\u001b[39m pcr(F2_For, F2_Rev, gene_docs[\u001b[38;5;241m0\u001b[39m], limit\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m40\u001b[39m)\n\u001b[1;32m 5\u001b[0m pcr_product_F3 \u001b[38;5;241m=\u001b[39m pcr(F3_For, F3_Rev, gene_docs[\u001b[38;5;241m0\u001b[39m], limit\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m40\u001b[39m)\n\u001b[0;32m----> 6\u001b[0m pcr_product_BAC \u001b[38;5;241m=\u001b[39m \u001b[43mpcr\u001b[49m\u001b[43m(\u001b[49m\u001b[43mBACF1_For\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mBACF3_Rev\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpCC1BAC_docs\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlimit\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m69\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;66;03m# Printing out the PCR results\u001b[39;00m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28mprint\u001b[39m(pcr_product_F1\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", - "File \u001b[0;32m~/Documents/OpenSource/summer_internship_2024/pydna/src/pydna/amplify.py:523\u001b[0m, in \u001b[0;36mpcr\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 521\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m anneal_primers\u001b[38;5;241m.\u001b[39mproducts[\u001b[38;5;241m0\u001b[39m]\n\u001b[1;32m 522\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(anneal_primers\u001b[38;5;241m.\u001b[39mproducts) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[0;32m--> 523\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo PCR product! \u001b[39m\u001b[38;5;132;01m{\u001b[39;00manneal_primers\u001b[38;5;241m.\u001b[39mreport()\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 524\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPCR not specific! \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mformat\u001b[39m(anneal_primers\u001b[38;5;241m.\u001b[39mreport())\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n", - "\u001b[0;31mValueError\u001b[0m: No PCR product! Template EU140750 8128 bp circular limit=69:\nNo forward primers anneal...\nNo reverse primers anneal..." - ] - } - ], + "outputs": [], "source": [ "# Checking primer specificity using the pcr function. An error message is returned if otherwise.\n", "\n", @@ -285,19 +110,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "IndexError", - "evalue": "list index out of range", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[7], line 7\u001b[0m\n\u001b[1;32m 4\u001b[0m assembled_circ \u001b[38;5;241m=\u001b[39m assembled\u001b[38;5;241m.\u001b[39massemble_circular()\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# Printing out the Gibson Assembly product\u001b[39;00m\n\u001b[0;32m----> 7\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[43massembled_circ\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m)\n", - "\u001b[0;31mIndexError\u001b[0m: list index out of range" - ] - } - ], + "outputs": [], "source": [ "# Performing the Gibson Assembly. Note that the assembly class parameters should be given as a list.\n", "\n", @@ -325,7 +138,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.5" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/docs/notebooks/Example_Restriction.ipynb b/docs/notebooks/Example_Restriction.ipynb old mode 100644 new mode 100755 index 800f64fb..eb6d0db8 --- a/docs/notebooks/Example_Restriction.ipynb +++ b/docs/notebooks/Example_Restriction.ipynb @@ -16,6 +16,15 @@ "Source files can be found alongside this notebook, if you would like to follow along. Annotations are made alongside the code to describe key steps." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Gibson.ipynb b/docs/notebooks/Gibson.ipynb index d0bc9a8a..8d7c6e4a 100644 --- a/docs/notebooks/Gibson.ipynb +++ b/docs/notebooks/Gibson.ipynb @@ -17,6 +17,15 @@ " * `algorithm`: the function used to find homology regions between DNA fragments. For Gibson Assembly, we use the `terminal_overlap` function, which finds homology regions only at the terminal regions. By default, the `Assembly` class uses the `common_sub_strings` function to find homology regions, which finds homology anywhere, as it could happen in a homologous recombination event.\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Importing_Seqs.ipynb b/docs/notebooks/Importing_Seqs.ipynb old mode 100644 new mode 100755 index 153f3738..c2a7e7b1 --- a/docs/notebooks/Importing_Seqs.ipynb +++ b/docs/notebooks/Importing_Seqs.ipynb @@ -19,6 +19,15 @@ "The following code shows an example of how to use the `parse` function to import a FASTA file." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/PCR.ipynb b/docs/notebooks/PCR.ipynb old mode 100644 new mode 100755 index e26ac651..1081dd8d --- a/docs/notebooks/PCR.ipynb +++ b/docs/notebooks/PCR.ipynb @@ -17,6 +17,15 @@ "The following example uses a 300+ bp custom sample circular DNA, containing an example gene that we would like to clone. 18 bp forward and reverse primers have been provided. " ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Restrict_Ligate_Cloning.ipynb b/docs/notebooks/Restrict_Ligate_Cloning.ipynb index be8d8f90..4addd6ff 100644 --- a/docs/notebooks/Restrict_Ligate_Cloning.ipynb +++ b/docs/notebooks/Restrict_Ligate_Cloning.ipynb @@ -14,6 +14,15 @@ "Restriction enzymes recognise specific DNA sequences and cut them, leaving sticky ends or blunt ends. To cut a sequence using `pydna`, we can use the `cut` method on a `Dseqrecord` object. Here is an example showing how to use the `cut` method to genenrate EcoRI restriction digests. The record includes a 338bp circular sequence, with an example gene feature." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "code", "execution_count": null, From 4b8a8dfcefb996334294b61b9ea2cf05149749ad Mon Sep 17 00:00:00 2001 From: Lucas Levassor Date: Thu, 3 Oct 2024 11:41:58 +0200 Subject: [PATCH 2/6] final file added --- docs/notebooks/Example_Gibson.ipynb | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 docs/notebooks/Example_Gibson.ipynb diff --git a/docs/notebooks/Example_Gibson.ipynb b/docs/notebooks/Example_Gibson.ipynb old mode 100644 new mode 100755 From 0fa7719e34b0d92a8a1d89c5e6a05fa69c3fff7b Mon Sep 17 00:00:00 2001 From: Lucas Levassor Date: Thu, 3 Oct 2024 12:03:16 +0200 Subject: [PATCH 3/6] update: added installation of pydna --- docs/notebooks/CRISPR.ipynb | 11 +++++++++++ docs/notebooks/Dseq.ipynb | 11 +++++++++++ docs/notebooks/Dseq_Features.ipynb | 13 ++++++++++++- docs/notebooks/Example_Gibson.ipynb | 11 +++++++++++ docs/notebooks/Example_Restriction.ipynb | 11 +++++++++++ docs/notebooks/Gibson.ipynb | 11 +++++++++++ docs/notebooks/Importing_Seqs.ipynb | 11 +++++++++++ docs/notebooks/PCR.ipynb | 11 +++++++++++ docs/notebooks/Restrict_Ligate_Cloning.ipynb | 11 +++++++++++ 9 files changed, 100 insertions(+), 1 deletion(-) diff --git a/docs/notebooks/CRISPR.ipynb b/docs/notebooks/CRISPR.ipynb index 9ca6fcff..9d9249e7 100644 --- a/docs/notebooks/CRISPR.ipynb +++ b/docs/notebooks/CRISPR.ipynb @@ -22,6 +22,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Dseq.ipynb b/docs/notebooks/Dseq.ipynb index 51cc99ea..565bb813 100644 --- a/docs/notebooks/Dseq.ipynb +++ b/docs/notebooks/Dseq.ipynb @@ -17,6 +17,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/docs/notebooks/Dseq_Features.ipynb b/docs/notebooks/Dseq_Features.ipynb index e23af24d..cf8a722e 100644 --- a/docs/notebooks/Dseq_Features.ipynb +++ b/docs/notebooks/Dseq_Features.ipynb @@ -24,6 +24,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, @@ -797,7 +808,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.5" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/docs/notebooks/Example_Gibson.ipynb b/docs/notebooks/Example_Gibson.ipynb index 36806a43..ac71e715 100755 --- a/docs/notebooks/Example_Gibson.ipynb +++ b/docs/notebooks/Example_Gibson.ipynb @@ -21,6 +21,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Example_Restriction.ipynb b/docs/notebooks/Example_Restriction.ipynb index eb6d0db8..3dd72dd9 100755 --- a/docs/notebooks/Example_Restriction.ipynb +++ b/docs/notebooks/Example_Restriction.ipynb @@ -25,6 +25,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Gibson.ipynb b/docs/notebooks/Gibson.ipynb index 8d7c6e4a..b9cadc28 100644 --- a/docs/notebooks/Gibson.ipynb +++ b/docs/notebooks/Gibson.ipynb @@ -26,6 +26,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Importing_Seqs.ipynb b/docs/notebooks/Importing_Seqs.ipynb index c2a7e7b1..3acfd1ef 100755 --- a/docs/notebooks/Importing_Seqs.ipynb +++ b/docs/notebooks/Importing_Seqs.ipynb @@ -28,6 +28,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/PCR.ipynb b/docs/notebooks/PCR.ipynb index 1081dd8d..a5f9be41 100755 --- a/docs/notebooks/PCR.ipynb +++ b/docs/notebooks/PCR.ipynb @@ -26,6 +26,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/docs/notebooks/Restrict_Ligate_Cloning.ipynb b/docs/notebooks/Restrict_Ligate_Cloning.ipynb index 4addd6ff..636aa648 100644 --- a/docs/notebooks/Restrict_Ligate_Cloning.ipynb +++ b/docs/notebooks/Restrict_Ligate_Cloning.ipynb @@ -23,6 +23,17 @@ "" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install pydna \n", + "%%capture\n", + "!pip install pydna" + ] + }, { "cell_type": "code", "execution_count": null, From 8ff1c76bc7164919261043b3b7f6d7f7f6624a46 Mon Sep 17 00:00:00 2001 From: Lucas Levassor Date: Thu, 3 Oct 2024 15:18:23 +0200 Subject: [PATCH 4/6] update: added CRIPSR examples in notebooks issue #259 --- docs/notebooks/CRISPR.ipynb | 66 +++++--- docs/notebooks/Example_CRISPR.ipynb | 249 ++++++++++++++++++++++++++++ 2 files changed, 293 insertions(+), 22 deletions(-) create mode 100644 docs/notebooks/Example_CRISPR.ipynb diff --git a/docs/notebooks/CRISPR.ipynb b/docs/notebooks/CRISPR.ipynb index 9d9249e7..1d730302 100644 --- a/docs/notebooks/CRISPR.ipynb +++ b/docs/notebooks/CRISPR.ipynb @@ -54,32 +54,54 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "cutting with enzyme 1: (Dseqrecord(-17), Dseqrecord(-6))\n", + "protospacer: GTTACTTTACCCGACGTCCC\n", + "cutting with enzyme 2: (Dseqrecord(-17), Dseqrecord(-6))\n", + "cutting with no PAM in target: ()\n" + ] + } + ], "source": [ - "# Defining the target sequence\n", - "sequence = Dseqrecord(\"GTTACTTTACCCGACGTCCCCGG\")\n", + "from pydna.dseqrecord import Dseqrecord\n", + "from pydna.crispr import cas9, protospacer\n", + "\n", + "# <----protospacer---><-------scaffold----------------->\n", + "guide = \"GTTACTTTACCCGACGTCCCgttttagagctagaaatagcaagttaaaataagg\"\n", + "target = \"GTTACTTTACCCGACGTCCCaGG\"\n", + "# <->\n", + "# PAM\n", + "\n", + "# Create an enzyme object with the protospacer\n", + "enzyme = cas9(\"GTTACTTTACCCGACGTCCC\")\n", + "\n", + "target_dseq = Dseqrecord(target)\n", + "\n", + "# Cut using the enzyme\n", + "print('cutting with enzyme 1:', target_dseq.cut(enzyme))\n", + "\n", + "\n", + "# Get the protospacer from the full gRNA sequence\n", + "gRNA_protospacers = protospacer(Dseqrecord(guide), cas=cas9)\n", + "# Print the protospacer (it's a list because often plasmids contain multiple gRNAs)\n", + "print('protospacer:', gRNA_protospacers[0])\n", + "gRNA_protospacer = gRNA_protospacers[0]\n", + "\n", + "# Create an enzyme from the protospacer\n", + "enzyme2 = cas9(gRNA_protospacer)\n", + "\n", + "# Simulate the cut\n", + "print('cutting with enzyme 2:', target_dseq.cut(enzyme2))\n", "\n", - "# Defining the guide RNA sequence\n", - "gRNA_sequence = protospacer(guide_construct = sequence, cas=cas9)\n", - "print(gRNA_sequence)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Initializing the Cas9 protein\n", - "enzyme = cas9(protospacer=gRNA_sequence[0])\n", "\n", - "# Simulating the CRISPR-Cas9 cut by searching for the cut sites\n", - "cas9_sites = enzyme.search(sequence)\n", - "print(len(cas9_sites))\n", + "# Note that without the PAM, the cut will not be made.\n", "\n", - "# The cas9_sites will contain the fragments resulting from the cut\n", - "for fragment in cas9_sites:\n", - " print(fragment.format(\"fasta\"))" + "target_noPAM_dseq = Dseqrecord(\"GTTACTTTACCCGACGTCCCaaa\")\n", + "print(\"cutting with no PAM in target:\", target_noPAM_dseq.cut(enzyme2))" ] } ], diff --git a/docs/notebooks/Example_CRISPR.ipynb b/docs/notebooks/Example_CRISPR.ipynb new file mode 100644 index 00000000..ba37cb02 --- /dev/null +++ b/docs/notebooks/Example_CRISPR.ipynb @@ -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": [ + "" + ], + "text/plain": [ + "" + ] + }, + "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": [ + "\n", + " \"Open\n", + "" + ] + }, + { + "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(\"myself@email.com\") # 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": [ + "
name|45\n",
+       "     \\/\n",
+       "     /\\\n",
+       "     45|My repair oligo for this experiment|45\n",
+       "                                            \\/\n",
+       "                                            /\\\n",
+       "                                            45|name
" + ], + "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 +} From 0b7c4a525d7e40f2c9f6102fcde09171707d2a90 Mon Sep 17 00:00:00 2001 From: Lucas Levassor Date: Thu, 3 Oct 2024 15:24:11 +0200 Subject: [PATCH 5/6] update: added google badge issue #266 --- docs/cookbook/cookbook.ipynb | 136 ++++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 58 deletions(-) diff --git a/docs/cookbook/cookbook.ipynb b/docs/cookbook/cookbook.ipynb index 34c15e53..ab8748be 100644 --- a/docs/cookbook/cookbook.ipynb +++ b/docs/cookbook/cookbook.ipynb @@ -17,6 +17,15 @@ "" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -63,7 +72,18 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Install pydna for colab.\n", + "%%capture\n", + "!pip install pydna" + ] + }, + { + "cell_type": "code", + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -72,7 +92,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -81,7 +101,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -97,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -109,7 +129,7 @@ "Gbnk(o9637 KC562906.1)" ] }, - "execution_count": 4, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -120,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -131,7 +151,7 @@ "CTTA..AGTT" ] }, - "execution_count": 5, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -142,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -151,7 +171,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -166,7 +186,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -175,7 +195,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -187,7 +207,7 @@ "Gbnk(-3140 Z72979.1)" ] }, - "execution_count": 9, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -198,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -209,7 +229,7 @@ "TACT..TTTT" ] }, - "execution_count": 10, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -220,7 +240,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -229,7 +249,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -245,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -259,7 +279,7 @@ " 3ACAAGTCATTAAGTC...GACCTTTTCTGAGAGTAGATT5" ] }, - "execution_count": 13, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -270,7 +290,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -279,7 +299,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -288,7 +308,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -297,7 +317,7 @@ "(Dseqrecord(-7), Dseqrecord(-1819), Dseqrecord(-11))" ] }, - "execution_count": 16, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -308,7 +328,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -319,7 +339,7 @@ " GAGA..ATTCCTAG" ] }, - "execution_count": 17, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -330,7 +350,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -339,7 +359,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -350,7 +370,7 @@ " AGGG..TTTTCTAG" ] }, - "execution_count": 19, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -361,7 +381,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -370,7 +390,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -379,7 +399,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -388,7 +408,7 @@ "'t9fs_9UvEuD-Ankyy8XEr1hD5DQ'" ] }, - "execution_count": 22, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -399,7 +419,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -461,7 +481,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -477,7 +497,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -486,7 +506,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -495,7 +515,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -509,7 +529,7 @@ " 3agtcgtaaaatccatttaaggc...ctgtcctacgactagtcgctgta5" ] }, - "execution_count": 27, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -520,7 +540,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -529,7 +549,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -538,7 +558,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -550,7 +570,7 @@ "File(pGREG505)(o9465)" ] }, - "execution_count": 30, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -561,7 +581,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -570,7 +590,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -579,7 +599,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -588,7 +608,7 @@ "(Dseqrecord(-8301), Dseqrecord(-1172))" ] }, - "execution_count": 41, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -599,7 +619,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -615,7 +635,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -624,7 +644,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -637,7 +657,7 @@ "algorithm..: common_sub_strings" ] }, - "execution_count": 44, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -648,7 +668,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -664,7 +684,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -673,7 +693,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -682,7 +702,7 @@ "True" ] }, - "execution_count": 55, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -693,7 +713,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -702,7 +722,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -711,7 +731,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -720,7 +740,7 @@ "'0R8hr15t-psjHVuuTj_JufGxOPg'" ] }, - "execution_count": 58, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -731,7 +751,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": null, "metadata": {}, "outputs": [ { From deccbc52c90e761cfb505e1a199255187a1c9e20 Mon Sep 17 00:00:00 2001 From: Lucas Levassor Date: Fri, 4 Oct 2024 09:52:23 +0200 Subject: [PATCH 6/6] Polished Example CRISPR notebook --- docs/notebooks/Example_CRISPR.ipynb | 35 ++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/docs/notebooks/Example_CRISPR.ipynb b/docs/notebooks/Example_CRISPR.ipynb index ba37cb02..9e0d64e8 100644 --- a/docs/notebooks/Example_CRISPR.ipynb +++ b/docs/notebooks/Example_CRISPR.ipynb @@ -4,11 +4,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# CRISPR-Cas9 Implementation with Oligonucleotide-based CRISPR-Cas9 toolbox for efficient engineering of Komagataella phaffii \n", + "# Implementation of 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", + "\n", + "For this purpose we have chosen to use the oligonucleotide-based CRISPR-Cas9 toolbox that i described \n", + "here by Strucko et al 2024, in the industrially relevant K. phaffi production organism: \n", + "\n", "https://academic.oup.com/femsyr/article/doi/10.1093/femsyr/foae026/7740463?login=false " ] }, @@ -33,7 +36,14 @@ ], "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" + "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\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Figure 1. oligo assisted repair in K. phaffi. " ] }, { @@ -41,11 +51,13 @@ "metadata": {}, "source": [ "\n", - "Basically we can make two cuts in the genome, and repair it with an oligo.\n", + "- Basically we can make two cuts in the genome, and repair it with an oligo (Figure 1A, 1B).\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. " + "- We can start by loading in our target. Here we have integrated LAC12 in our K. phaffi strain but want to knock it out. \n", + "\n", + "\n", + "- Let's see how this can be implemented in pydna\n" ] }, { @@ -65,7 +77,14 @@ "source": [ "#Install pydna for colab.\n", "%%capture\n", - "!pip install pydna" + "!pip install git+https://github.com/BjornFJohansson/pydna.git@dev_bjorn" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Import the gene we are going to work with" ] }, { @@ -188,7 +207,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The final gene would look like this\n" + "The final edit gene would look like this in a case of homologous recombination. \n" ] }, {