From cc986ac0bc372b6b759a201496d7f127cc8b14c5 Mon Sep 17 00:00:00 2001 From: Manuel Lera-Ramirez Date: Mon, 7 Oct 2024 10:44:41 +0100 Subject: [PATCH] small fixes --- docs/notebooks/Example_Restriction.ipynb | 107 ++++++++++++----------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/docs/notebooks/Example_Restriction.ipynb b/docs/notebooks/Example_Restriction.ipynb index ce4b7edd..174da5f7 100755 --- a/docs/notebooks/Example_Restriction.ipynb +++ b/docs/notebooks/Example_Restriction.ipynb @@ -561,50 +561,31 @@ "name": "stdout", "output_type": "stream", "text": [ - "ACCATGTCGACATGCAAACAGTAATGATGGATG\n", - "ATGGCGCGCCTAAAAGCCTTCTTCTCCC\n" + "ACCATGTCGACATGCAAACAGTAATGATGGA , Tm: 57.24061148156318\n", + "GGCGCGCCATTAAAAGCCTTCTTCTCCC , Tm: 56.64459495003314\n" ] } ], "source": [ + "from pydna.design import primer_design\n", "#Finding the feature containing the CDS with ase1 as a type qualifier\n", - "gene = [f for f in pombe_chromosome_I.features if f.type == \"CDS\" and \n", - " \"gene\" in f.qualifiers and \n", - " \"ase1\" in f.qualifiers[\"gene\"]][0]\n", + "gene = next(f for f in pombe_chromosome_I.features if f.type == \"CDS\" and\n", + " \"gene\" in f.qualifiers and\n", + " \"ase1\" in f.qualifiers[\"gene\"])\n", "\n", - "#Reading off the CDS to design primers\n", - "fwd_pompe_seq = pombe_chromosome_I[min(gene):min(gene)+22]\n", - "back_pompe_seq = pombe_chromosome_I[max(gene)-18:max(gene)]\n", + "# Using the primer_design function to design primers to amplify the CDS\n", + "# `min` and `max` can be used on a SeqFeature to get the start (leftmost) and end (rightmost) positions\n", + "# this works both on feature with SimpleLocation and CompoundLocation\n", + "amplicon = primer_design(pombe_chromosome_I[min(gene):max(gene)], target_tm=55)\n", "\n", - "fwd_primer_ase1 = Dseqrecord(\"ACCATGTCGAC\") + fwd_pompe_seq # Adding a SalI cut site\n", - "rvs_primer_ase1_3_start = back_pompe_seq + Dseqrecord(\"GGCGCGCCAT\") # Adding a AscI cut site\n", - "rvs_primer_ase1 = rvs_primer_ase1_3_start.reverse_complement()\n", + "fwd_align, rvs_align = amplicon.primers()\n", + "fwd_primer_ase1 = Dseqrecord(\"ACCATGTCGAC\") + fwd_align # Adding a SalI cut site\n", + "rvs_primer_ase1 = Dseqrecord(\"GGCGCGCCAT\") + rvs_align # Adding a AscI cut site\n", "\n", "# Printing out the primers\n", "\n", - "print(fwd_primer_ase1.seq)\n", - "print(rvs_primer_ase1.seq)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "57.08651869811922\n", - "65.11883125971309\n" - ] - } - ], - "source": [ - "# Checking that the primer Tm are matching for the genomic portion of the primer\n", - "\n", - "print(tm_default(fwd_primer_ase1.seq[-22:])) # Modify the primer sequence above retroactively here, if Tm not matching.\n", - "print(tm_default(rvs_primer_ase1.seq[:18]))" + "print(fwd_primer_ase1.seq, ', Tm: ', tm_default(fwd_align))\n", + "print(rvs_primer_ase1.seq, ', Tm: ', tm_default(rvs_align))" ] }, { @@ -617,7 +598,7 @@ "output_type": "stream", "text": [ "LOCUS 2263bp_PCR_prod 2263 bp DNA linear UNK 01-JAN-1980\n", - "DEFINITION pcr_product_description_description_rc.\n", + "DEFINITION pcr_product_description_description.\n", "ACCESSION 2263bp\n", "VERSION 2263bp\n", "DBLINK BioProject: PRJNA13836\n", @@ -627,16 +608,36 @@ " ORGANISM .\n", " .\n", "FEATURES Location/Qualifiers\n", - " primer_bind 1..22\n", + " CDS join(1..424,472..2243)\n", + " /gene=\"ase1\"\n", + " /locus_tag=\"SPOM_SPAPB1A10.09\"\n", + " /codon_start=1\n", + " /product=\"antiparallel microtubule cross-linking factor\n", + " Ase1\"\n", + " /protein_id=\"CAC21482.1\"\n", + " /translation=\"MQTVMMDDIQSTDSIAEKDNHSNNESNFTWKAFREQVEKHFSKIE\n", + " RLHQVLGTDGDNSSLFELFTTAMNAQLHEMEQCQKKLEDDCQQRIDSIRFLVSSLKLTD\n", + " DTSSLKIESPLIQCLNRLSMVEGQYMAQYDQKLSTIKEMYHKLESYCNRLGSPFVLPDF\n", + " ENSFLSDVSDAFTESLRGRINEAEKEIDARLEVINSFEEEILGLWSELGVEPADVPQYE\n", + " QLLESHTNRPNDVYVTQELIDQLCKQKEVFSAEKEKRSDHLKSIQSEVSNLWNKLQVSP\n", + " NEQSQFGDSSNINQENISLWETELEKLHQLKKEHLPIFLEDCRQQILQLWDSLFYSEEQ\n", + " RKSFTPMYEDIITEQVLTAHENYIKQLEAEVSANKSFLSLINRYASLIEGKKELEASSN\n", + " DASRLTQRGRRDPGLLLREEKIRKRLSRELPKVQSLLIPEITAWEERNGRTFLFYDEPL\n", + " LKICQEATQPKSLYRSASAAANRPKTATTTDSVNRTPSQRGRVAVPSTPSVRSASRAMT\n", + " SPRTPLPRVKNTQNPSRSISAEPPSATSTANRRHPTANRIDINARLNSASRSRSANMIR\n", + " QGANGSDSNMSSSPVSGNSNTPFNKFPNSVSRNTHFESKSPHPNYSRTPHETYSKASSK\n", + " NVPLSPPKQRVVNEHALNIMSEKLQRTNLKEQTPEMDIENSSQNLPFSPMKISPIRASP\n", + " VKTIPSSPSPTTNIFSAPLNNITNCTPMEDEWGEEGF\"\n", + " primer_bind 1..20\n", " /label=\"name\"\n", " /PCR_conditions=\"primer\n", - " sequence:ACCATGTCGACATGCAAACAGTAATGATGGATG\"\n", + " sequence:ACCATGTCGACATGCAAACAGTAATGATGGA\"\n", " /ApEinfo_fwdcolor=\"#baffa3\"\n", " /ApEinfo_revcolor=\"#ffbaba\"\n", - " primer_bind complement(2225..2242)\n", - " /label=\"name_rc\"\n", + " primer_bind complement(2225..2243)\n", + " /label=\"name\"\n", " /PCR_conditions=\"primer\n", - " sequence:ATGGCGCGCCTAAAAGCCTTCTTCTCCC\"\n", + " sequence:GGCGCGCCATTAAAAGCCTTCTTCTCCC\"\n", " /ApEinfo_fwdcolor=\"#baffa3\"\n", " /ApEinfo_revcolor=\"#ffbaba\"\n", "ORIGIN\n", @@ -677,7 +678,7 @@ " 2041 aactaatctg aaagaacaaa cacccgagat ggacattgaa aacagctcgc agaaccttcc\n", " 2101 tttttctcct atgaagatat cccccataag agcatcaccc gtaaagacaa ttccatcatc\n", " 2161 accgtccccc actaccaaca ttttttctgc tccactcaac aatattacaa attgtacacc\n", - " 2221 gatggaggat gaatggggag aagaaggctt ttaggcgcgc cat\n", + " 2221 gatggaggat gaatggggag aagaaggctt ttaatggcgc gcc\n", "//\n" ] } @@ -702,21 +703,21 @@ "output_type": "stream", "text": [ "(Dseqrecord(-30), Dseqrecord(-3916))\n", - "(Dseqrecord(-10), Dseqrecord(-2253), Dseqrecord(-8))\n" + "(Dseqrecord(-10), Dseqrecord(-2255), Dseqrecord(-6))\n" ] } ], "source": [ "# Cleaving the cloning vector with restriction enzymes\n", "\n", - "plamsid_digests = vector.cut(SalI, AscI)\n", + "plasmid_digests = vector.cut(SalI, AscI)\n", "\n", "# Cleaving the gene fragment with restriction enzymes\n", "\n", "gene_digests = Dseqrecord(pcr_product).cut(SalI, AscI)\n", "\n", "# Printing out the digests\n", - "print(plamsid_digests) \n", + "print(plasmid_digests) \n", "print(gene_digests)" ] }, @@ -729,7 +730,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "LOCUS name 6161 bp DNA circular UNK 01-JAN-1980\n", + "LOCUS name 6163 bp DNA circular UNK 01-JAN-1980\n", "DEFINITION description.\n", "ACCESSION id\n", "VERSION id\n", @@ -815,10 +816,10 @@ " primer_bind 3859..3876\n", " /label=\"SP6\"\n", " /note=\"SP6 promoter, forward primer\"\n", - " primer_bind complement(6131..6148)\n", - " /label=\"name_rc\"\n", + " primer_bind complement(6131..6149)\n", + " /label=\"name\"\n", " /PCR_conditions=\"primer\n", - " sequence:ATGGCGCGCCTAAAAGCCTTCTTCTCCC\"\n", + " sequence:GGCGCGCCATTAAAAGCCTTCTTCTCCC\"\n", " /ApEinfo_fwdcolor=\"#baffa3\"\n", " /ApEinfo_revcolor=\"#ffbaba\"\n", "ORIGIN\n", @@ -924,7 +925,7 @@ " 5941 gcaaagaact aatctgaaag aacaaacacc cgagatggac attgaaaaca gctcgcagaa\n", " 6001 ccttcctttt tctcctatga agatatcccc cataagagca tcacccgtaa agacaattcc\n", " 6061 atcatcaccg tcccccacta ccaacatttt ttctgctcca ctcaacaata ttacaaattg\n", - " 6121 tacaccgatg gaggatgaat ggggagaaga aggcttttag g\n", + " 6121 tacaccgatg gaggatgaat ggggagaaga aggcttttaa tgg\n", "//\n" ] } @@ -932,12 +933,12 @@ "source": [ "# Ligating, then circularising the synthetic plasmid\n", "\n", - "Synthetic_Vector = plamsid_digests[1] + gene_digests [1]\n", - "Synthetic_Vector = Synthetic_Vector.looped()\n", + "synthetic_vector = plasmid_digests[1] + gene_digests [1]\n", + "synthetic_vector = synthetic_vector.looped()\n", "\n", "# Printing out the completed cloning vector\n", "\n", - "print(Synthetic_Vector.format(\"gb\"))" + "print(synthetic_vector.format(\"gb\"))" ] } ], @@ -957,7 +958,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.12.6" } }, "nbformat": 4,