From ebe859657a29deaacff0f9fa4cb0a2e6923ec6a5 Mon Sep 17 00:00:00 2001 From: Koeng101 Date: Sat, 5 Oct 2024 22:18:11 -0700 Subject: [PATCH] fragment fix (#101) fixes a small bug in the recursive fragmenter --- README.md | 1 + lib/synthesis/fragment/fragment.go | 6 +----- py/setup.py | 2 +- py/tests/test_fragment.py | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 55a1e5c..26ff098 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Fixes add flank bug, releases new version of python lib [#101](https://github.com/Koeng101/dnadesign/pull/101) - Adds feature for adding flanks to RecursiveFragment. [#100](https://github.com/Koeng101/dnadesign/pull/100) - Adds cloning and recursion functions to python. [#96](https://github.com/Koeng101/dnadesign/pull/96) - Adds recursive fragmentation. [#92](https://github.com/Koeng101/dnadesign/pull/92) diff --git a/lib/synthesis/fragment/fragment.go b/lib/synthesis/fragment/fragment.go index a9fbae7..1c8ab8a 100644 --- a/lib/synthesis/fragment/fragment.go +++ b/lib/synthesis/fragment/fragment.go @@ -291,11 +291,7 @@ func RecursiveFragment(sequence string, maxCodingSizeOligo int, assemblyPattern if err != nil { return assembly, err } - var fragmentsAppended []string - for _, fragment := range fragments { - fragmentsAppended = append(fragmentsAppended, forwardFlank+fragment+reverseFlank) - } - return Assembly{Sequence: sequence, Fragments: fragmentsAppended, Efficiency: efficiency}, nil + return Assembly{Sequence: sequence, Fragments: fragments, Efficiency: efficiency}, nil } // After the smallest possible block, begin iterating for each size. for i, size := range sizes[1:] { diff --git a/py/setup.py b/py/setup.py index 54620d1..9d98edb 100644 --- a/py/setup.py +++ b/py/setup.py @@ -13,7 +13,7 @@ def get_shared_lib_ext(): setup( name='dnadesign', - version='0.1.7', + version='0.1.8', packages=find_packages(), package_data={'dnadesign': ['definitions.h', 'libdnadesign.h', "libdnadesign" + get_shared_lib_ext()]}, install_requires=[ diff --git a/py/tests/test_fragment.py b/py/tests/test_fragment.py index 1500e45..1969d1d 100644 --- a/py/tests/test_fragment.py +++ b/py/tests/test_fragment.py @@ -42,4 +42,4 @@ def test_recursive_fragment(): result = recursive_fragment(gene, max_oligo_len, assembly_pattern, exclude_overhangs, default_overhangs, "GTCTCT", "CGAG") assert result is not None, "RecursiveFragment failed" # Add more specific assertions based on the expected structure of the result - assert result.fragments == ['GTCTCTGTCTCTATGACCATGATTACGCCAAGCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGTCGTGACTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAGCGAG', 'GTCTCTCCAGCTGGCGTAATAGCGAAGAGGCCCGCACCGATCGCCCTTCCCAACAGTTGCGCAGCCTGAATGGCGAATGGCGCCTGATGCGGTATTTTCTCCTTACGCATCTGTGCGGTATTTCACACCGCATATGGTGCACTCTCAGTACAATCTGCTCTGATGCCGCATAGCGAGCGAG'] + assert result.fragments == ['GTCTCTATGACCATGATTACGCCAAGCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGTCGTGACTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAG', 'CCAGCTGGCGTAATAGCGAAGAGGCCCGCACCGATCGCCCTTCCCAACAGTTGCGCAGCCTGAATGGCGAATGGCGCCTGATGCGGTATTTTCTCCTTACGCATCTGTGCGGTATTTCACACCGCATATGGTGCACTCTCAGTACAATCTGCTCTGATGCCGCATAGCGAG']