Skip to content

Commit

Permalink
user & bugfix amplicon
Browse files Browse the repository at this point in the history
  • Loading branch information
BjornFJohansson committed Mar 24, 2024
1 parent 69b7ec7 commit 6ce5a3f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/pydna/amplicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def figure(self):
faz = tp[fp.position - fp._fp : fp.position].seq
raz = tp[rp.position : rp.position + rp._fp].seq
sp3 = " " * (len(fp.seq) + 3)
fzc = tp.seq.rc()[::-1][fp.position - fp._fp : fp.position]
rzc = tp.seq.rc()[::-1][rp.position : rp.position + rp._fp]
# breakpoint()
fzc = tp.seq.crick[::-1][fp.position - fp._fp : fp.position]
rzc = tp.seq.crick[::-1][rp.position : rp.position + rp._fp]
f = f"""
{" " *ft}5{faz}...{raz}3
{sp3}{"|" * rp._fp}
Expand Down
29 changes: 29 additions & 0 deletions src/pydna/user_cloning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Copyright 2013-2023 by Björn Johansson. All rights reserved.
# This code is part of the Python-dna distribution and governed by its
# license. Please see the LICENSE.txt file that should have been included
# as part of this package.


# from abc import ABC, abstractmethod
# import re
# from pydna.utils import rc


"""
Nicking & USER cloning
CGAuGTCGACTTAGATCTCACAGGCTTTTTTCAAGaCGGCCTTGAATTCAGTCATTTGGATCCGGCCGATC
GCTACAGCTGAATCTAGAGTGTCCGAAAAAAGTTCTGCCGGAACTTAAGTCAGTAAACCTAGGCCGGCuAG
1. Digest both strands
2. Collect all linear ssDNA
3. Anneal all combinations
4. Keep ones present in original molecule
5. Rank by stability
6.
"""
16 changes: 8 additions & 8 deletions tests/format_sequences.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -50,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -200,9 +200,9 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [conda env:bjorn38]",
"display_name": "bjorn311",
"language": "python",
"name": "conda-env-bjorn38-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -214,7 +214,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_USERcloning.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def test_USER_cloning():
assert p.seq.crick == "GAUCGGCCGGATCCAAATGACTGAATTCAAGGCCGtCTTGAAAAAAGCCTGTGAGATCTAAGTCGACATCG"








# hej = p.seq

# from Bio.SeqFeature import SeqFeature
Expand Down
3 changes: 2 additions & 1 deletion tests/test_module_dseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def cut_and_religate_Dseq(seq_string, enz, top):
]

for s in seqs:
print(s)
sek, enz, lin = s
for i in range(len(sek)):
zek = sek[i:] + sek[:i]
Expand Down Expand Up @@ -591,6 +592,7 @@ def test_Dseq_slicing2():


def test_Dseq___getitem__():
# test the slicing
from pydna.dseq import Dseq

s = Dseq("GGATCC", circular=False)
Expand All @@ -603,7 +605,6 @@ def test_Dseq___getitem__():
assert s[5:1:-1] == Dseq("CCTA")

assert t[5:1] == Dseq("CG")

assert s[9:1] == Dseq("")
assert t[9:1] == Dseq("")

Expand Down

0 comments on commit 6ce5a3f

Please sign in to comment.