diff --git a/src/pydna/goldengate.py b/src/pydna/goldengate.py index c16325d8..39d7ec33 100644 --- a/src/pydna/goldengate.py +++ b/src/pydna/goldengate.py @@ -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() diff --git a/tests/prof/test_crispr.prof b/tests/prof/test_crispr.prof new file mode 100644 index 00000000..738cb404 Binary files /dev/null and b/tests/prof/test_crispr.prof differ diff --git a/tests/prof/test_ligate.prof b/tests/prof/test_ligate.prof new file mode 100644 index 00000000..afd4c146 Binary files /dev/null and b/tests/prof/test_ligate.prof differ