Skip to content

Commit

Permalink
removed cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
BjornFJohansson committed Dec 7, 2023
1 parent 8022110 commit 6778c08
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 80 deletions.
80 changes: 0 additions & 80 deletions src/pydna/goldengate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,86 +22,6 @@
# ~~^-~^_~^~/ \~^-~^~_~^-~_^~-^~_^~~-^~_~^~-~_~-^~_^/ \~^-~_~^-~~-
# ~ _~~- ~^-^~-^~~- ^~_^-^~~_ -~^_ -~_-~~^- _~~_~-^_ ~^-^~~-_^-~ ~^

from operator import add
from functools import reduce
from pydna.dseq import Dseq
from pydna.dseqrecord import Dseqrecord
import networkx as _nx
from itertools import permutations
import logging as _logging

_module_logger = _logging.getLogger("pydna." + __name__)

a = Dseqrecord(
Dseq.from_representation(
"""
GATCaaa
tttTTCC"""
)
)
b = Dseqrecord(
Dseq.from_representation(
"""
AAGGanna
ttntAGGA"""
)
)
c = Dseqrecord(
Dseq.from_representation(
"""
TCCTcnnnn
gnnnnCTAG"""
)
)

d = Dseqrecord(
Dseq.from_representation(
"""
Tcnnnn
gnnnnC"""
)
)

e = Dseqrecord(
Dseq.from_representation(
"""
Gcnnnn
gnnnn"""
)
)

seqs = [a, b, c, d, e]
G = _nx.DiGraph()
G.add_nodes_from(["begin", "end"])

for node in seqs:
G.add_edge("begin", node)
G.add_edge(node, "end")

for seq1, seq2 in permutations(seqs, 2):
try:
seq1 + seq2
except TypeError as err:
if str(err) != "sticky ends not compatible!":
raise
else:
if seq1.seq.three_prime_end() != (
"blunt",
"",
) and seq2.seq.five_prime_end() != ("blunt", ""):
G.add_edge(seq1, seq2)
G.remove_edge("begin", seq2)
G.remove_edge(seq1, "end")

cpaths = sorted(_nx.simple_cycles(G), key=len, reverse=True)

cseqs = [reduce(add, x).looped() for x in cpaths]

lpaths = sorted(_nx.all_simple_paths(G, "begin", "end"), key=len, reverse=True)

lseqs = [reduce(add, lp[1:-1]) for lp in lpaths]


for s in cseqs + lseqs:
print(repr(s.seq))
print()
Binary file added tests/prof/test_crispr.prof
Binary file not shown.
Binary file added tests/prof/test_ligate.prof
Binary file not shown.

0 comments on commit 6778c08

Please sign in to comment.