diff --git a/src/pydna/dseq.py b/src/pydna/dseq.py index 5f556a00..93a29e97 100644 --- a/src/pydna/dseq.py +++ b/src/pydna/dseq.py @@ -1619,7 +1619,7 @@ def get_cut_parameters(self, cut: tuple, is_left: bool): if is_left: return *self.left_end_position(), self.ovhg # In the right end, the overhang does not matter - return *self.right_end_position(), None + return *self.right_end_position(), self.watson_ovhg() def apply_cut(self, left_cut, right_cut): """Extracts a subfragment of the sequence between two cuts. diff --git a/src/pydna/dseqrecord.py b/src/pydna/dseqrecord.py index cd8bf341..05981dc5 100644 --- a/src/pydna/dseqrecord.py +++ b/src/pydna/dseqrecord.py @@ -1402,9 +1402,6 @@ def apply_cut(self, left_cut, right_cut): left_watson, left_crick, left_ovhg = self.seq.get_cut_parameters(left_cut, True) right_watson, right_crick, right_ovhg = self.seq.get_cut_parameters(right_cut, False) - # left_watson, left_crick = left_cut[0] if left_cut is not None else (0, 0) - # right_watson, right_crick = right_cut[0] if right_cut is not None else (None, None) - left_edge = left_crick if left_ovhg > 0 else left_watson right_edge = right_watson if right_ovhg > 0 else right_crick features = self[left_edge:right_edge].features diff --git a/tests/test_module_dseq.py b/tests/test_module_dseq.py index 05916d9b..4c672bc9 100644 --- a/tests/test_module_dseq.py +++ b/tests/test_module_dseq.py @@ -976,7 +976,7 @@ def test_get_cut_parameters(): dseq = Dseq.from_full_sequence_and_overhangs('aaaACGTaaa', 3, 3) assert dseq.get_cut_parameters(None, True) == (*dseq.left_end_position(), dseq.ovhg) - assert dseq.get_cut_parameters(None, False) == (*dseq.right_end_position(), None) + assert dseq.get_cut_parameters(None, False) == (*dseq.right_end_position(), dseq.watson_ovhg()) assert dseq.get_cut_parameters(((4, -2), None), True) == (4, 6, -2) assert dseq.get_cut_parameters(((4, -2), None), False) == (4, 6, -2) @@ -994,7 +994,7 @@ def test_get_cut_parameters(): assert False, 'Expected AssertionError' try: - assert dseq.get_cut_parameters(None, False) == (*dseq.right_end_position(), None) + assert dseq.get_cut_parameters(None, False) == (*dseq.right_end_position(), dseq.watson_ovhg()) except AssertionError as e: assert e.args[0] == 'Circular sequences should not have None cuts' else: