{"id":21466739,"url":"https://github.com/edinburgh-genome-foundry/dnachisel","last_synced_at":"2025-05-14T22:07:28.230Z","repository":{"id":47256089,"uuid":"102761506","full_name":"Edinburgh-Genome-Foundry/DnaChisel","owner":"Edinburgh-Genome-Foundry","description":":pencil2: A versatile DNA sequence optimizer","archived":false,"fork":false,"pushed_at":"2025-05-10T10:17:31.000Z","size":9745,"stargazers_count":235,"open_issues_count":13,"forks_count":47,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-14T22:07:22.306Z","etag":null,"topics":["bioinformatics","codon-optimization","dna-optimization","sequence-design","synbio","synthetic-biology"],"latest_commit_sha":null,"homepage":"https://edinburgh-genome-foundry.github.io/DnaChisel/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Edinburgh-Genome-Foundry.png","metadata":{"files":{"readme":"README.rst","changelog":"changes.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-09-07T16:37:36.000Z","updated_at":"2025-05-12T23:35:50.000Z","dependencies_parsed_at":"2023-01-29T18:01:15.703Z","dependency_job_id":"91bc37b7-882a-4373-90b7-2c9612df585b","html_url":"https://github.com/Edinburgh-Genome-Foundry/DnaChisel","commit_stats":{"total_commits":400,"total_committers":11,"mean_commits":36.36363636363637,"dds":"0.29000000000000004","last_synced_commit":"4be08c2696710387ae6d5b0346e6680a69d88c64"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edinburgh-Genome-Foundry%2FDnaChisel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edinburgh-Genome-Foundry%2FDnaChisel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edinburgh-Genome-Foundry%2FDnaChisel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edinburgh-Genome-Foundry%2FDnaChisel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edinburgh-Genome-Foundry","download_url":"https://codeload.github.com/Edinburgh-Genome-Foundry/DnaChisel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235696,"owners_count":22036963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","codon-optimization","dna-optimization","sequence-design","synbio","synthetic-biology"],"created_at":"2024-11-23T08:15:18.622Z","updated_at":"2025-05-14T22:07:23.197Z","avatar_url":"https://github.com/Edinburgh-Genome-Foundry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. raw:: html\n\n    \u003cp align=\"center\"\u003e\n    \u003cimg alt=\"DNA Chisel Logo\" title=\"DNA Chisel\" src=\"https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/DnaChisel/master/docs/_static/images/title.png\" width=\"450\"\u003e\n    \u003cbr /\u003e\u003cbr /\u003e\n    \u003c/p\u003e\n\nDNA Chisel - a versatile sequence optimizer\n===========================================\n\n.. image:: https://github.com/Edinburgh-Genome-Foundry/DnaChisel/actions/workflows/build.yml/badge.svg\n   :target: https://github.com/Edinburgh-Genome-Foundry/DnaChisel/actions/workflows/build.yml\n   :alt: GitHub CI build status\n\n.. image:: https://coveralls.io/repos/github/Edinburgh-Genome-Foundry/DnaChisel/badge.svg?branch=master\n   :target: https://coveralls.io/github/Edinburgh-Genome-Foundry/DnaChisel?branch=master\n\n\nDNA Chisel (complete documentation `here \u003chttps://edinburgh-genome-foundry.github.io/DnaChisel/\u003e`_)\nis a Python library for optimizing DNA sequences with respect to a set of\nconstraints and optimization objectives. It can also be used via a command-line\ninterface, or a `web application \u003chttps://cuba.genomefoundry.org/sculpt_a_sequence\u003e`_.\n\nThe library comes with over 15 classes of sequence specifications which can be\ncomposed to, for instance, codon-optimize genes, meet the constraints of a\ncommercial DNA provider, avoid homologies between sequences, tune GC content,\nor all of this at once! Users can also define their own specifications using\nPython, making the library suitable for a large range of automated sequence\ndesign applications, and complex custom design projects. A specification can be\neither a hard constraint, which must be satisfied in the final sequence, or an\noptimization objective, whose score must be maximized.\nFor more information, please see the publication.\n\n\nCitation\n--------\n\nDNA Chisel, a versatile sequence optimizer, *Valentin Zulkower, Susan Rosser.* `Bioinformatics \u003chttps://academic.oup.com/bioinformatics/article/36/16/4508/5869515\u003e`_ (2020) 36, 16, 4508–4509\n\n\nUsage\n-----\n\nDefining a problem via scripts\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe example below will generate a random sequence and optimize it so that:\n\n- It will be rid of BsaI sites (on both strands).\n- GC content will be between 30% and 70% on every 50bp window.\n- The reading frame at position 500-1400 will be codon-optimized for *E. coli*.\n\n.. code:: python\n\n    from dnachisel import *\n\n    # DEFINE THE OPTIMIZATION PROBLEM\n\n    problem = DnaOptimizationProblem(\n        sequence=random_dna_sequence(10000),\n        constraints=[\n            AvoidPattern(\"BsaI_site\"),\n            EnforceGCContent(mini=0.3, maxi=0.7, window=50),\n            EnforceTranslation(location=(500, 1400))\n        ],\n        objectives=[CodonOptimize(species='e_coli', location=(500, 1400))]\n    )  # Note: always use a codon optimisation specification with EnforceTranslation\n\n    # SOLVE THE CONSTRAINTS, OPTIMIZE WITH RESPECT TO THE OBJECTIVE\n\n    problem.resolve_constraints()\n    problem.optimize()\n\n    # PRINT SUMMARIES TO CHECK THAT CONSTRAINTS PASS\n\n    print(problem.constraints_text_summary())\n    print(problem.objectives_text_summary())\n\n    # GET THE FINAL SEQUENCE (AS STRING OR ANNOTATED BIOPYTHON RECORDS)\n\n    final_sequence = problem.sequence  # string\n    final_record = problem.to_record(with_sequence_edits=True)\n\n\nDefining a problem via Genbank features\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nYou can also define a problem by annotating directly a Genbank as follows:\n\n.. raw:: html\n\n    \u003cp align=\"center\"\u003e\n    \u003cimg alt=\"report\" title=\"report\" src=\"https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/DnaChisel/master/docs/_static/images/example_sequence.png\" width=\"450\"\u003e\n    \u003cbr /\u003e\u003cbr /\u003e\n    \u003c/p\u003e\n\n\nNote that constraints (colored in blue in the illustration) are features of type\n``misc_feature`` with a prefix ``@`` followed by the name of the constraints\nand its parameters, which are the same as in python scripts. Optimization\nobjectives (colored in yellow in the illustration) use prefix ``~``. See\n`the Genbank API documentation \u003chttps://edinburgh-genome-foundry.github.io/DnaChisel/genbank/genbank_api.html\u003e`_\nfor more details.\n\nGenbank files with specification annotations can be directly fed to the\n`web application \u003chttps://cuba.genomefoundry.org/sculpt_a_sequence\u003e`_\nor processed via the command line interface:\n\n.. code:: bash\n\n    # Output the result to \"optimized_record.gb\"\n    dnachisel annotated_record.gb optimized_record.gb\n\nOr via a Python script:\n\n.. code:: python\n\n    from dnachisel import DnaOptimizationProblem\n    problem = DnaOptimizationProblem.from_record(\"my_record.gb\")\n    problem.optimize_with_report(target=\"report.zip\")\n\nBy default, only the built-in specifications of DNA Chisel can be used in the\nannotations, however it is easy to add your own specifications to the Genbank\nparser, and build applications supporting custom specifications on top of\nDNA Chisel.\n\n\nReports\n~~~~~~~\n\nDNA Chisel also implements features for verification and troubleshooting. For\ninstance by generating optimization reports:\n\n.. code:: python\n\n    problem = DnaOptimizationProblem(...)\n    problem.optimize_with_report(target=\"report.zip\")\n\nHere is an example of summary report:\n\n.. raw:: html\n\n    \u003cp align=\"center\"\u003e\n    \u003cimg alt=\"report\" title=\"report\" src=\"https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/DnaChisel/master/docs/_static/images/report_screenshot.png\" width=\"600\"\u003e\n    \u003cbr /\u003e\u003cbr /\u003e\n    \u003c/p\u003e\n\n\n\n\nHow it works\n------------\n\nDNA Chisel hunts down every constraint breach and suboptimal region by\nrecreating local version of the problem around these regions. Each type of\nconstraint can be locally *reduced* and solved in its own way, to ensure fast\nand reliable resolution.\n\nBelow is an animation of the algorithm in action:\n\n.. raw:: html\n\n    \u003cp align=\"center\"\u003e\n    \u003cimg alt=\"DNA Chisel algorithm\" title=\"DNA Chisel\" src=\"https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/DnaChisel/master/docs/_static/images/dnachisel_algorithm.gif\" width=\"800\"\u003e\n    \u003cbr /\u003e\n    \u003c/p\u003e\n\nInstallation\n------------\n\nDNA Chisel requires Python 3, and can be installed via a pip command:\n\n.. code::\n\n    pip install dnachisel     # \u003c= minimal install without reports support\n    pip install 'dnachisel[reports]' # \u003c= full install with all dependencies\n\nThe full installation using ``dnachisel[reports]`` downloads heavier libraries\n(Matplotlib, PDF reports, sequenticon) for report generation, but is highly\nrecommended to use DNA Chisel interactively via Python scripts. Also install\n`GeneBlocks \u003chttps://edinburgh-genome-foundry.github.io/Geneblocks\u003e`_ and its\ndependencies if you wish to include a plot of sequence edits in the report.\n\nOptionally, also install Bowtie to be able to use ``AvoidMatches`` (which\nremoves short homologies with existing genomes). On Ubuntu:\n\n.. code::\n\n    sudo apt-get install bowtie\n\n\nLicense = MIT\n-------------\n\nDNA Chisel is an open-source software originally written at the `Edinburgh Genome Foundry\n\u003chttp://edinburgh-genome-foundry.github.io/home.html\u003e`_ by `Zulko \u003chttps://github.com/Zulko\u003e`_\nand `released on Github \u003chttps://github.com/Edinburgh-Genome-Foundry/DnaChisel\u003e`_ under the MIT licence (Copyright 2017 Edinburgh Genome Foundry, University of Edinburgh). Everyone is welcome to contribute!\n\nMore biology software\n---------------------\n\n.. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Edinburgh-Genome-Foundry.github.io/master/static/imgs/logos/egf-codon-horizontal.png\n  :target: https://edinburgh-genome-foundry.github.io/\n\nDNA Chisel is part of the `EGF Codons \u003chttps://edinburgh-genome-foundry.github.io/\u003e`_ synthetic biology software suite for DNA design, manufacturing and validation.\n\nRelated projects\n----------------\n\n(If you would like to see a DNA Chisel-related project advertized here, please open\nan issue or propose a PR)\n\n- `Benchling \u003chttps://www.benchling.com/\u003e`_ uses DNA Chisel as part of its sequence\n  optimization pipeline according to `this webinar video \u003chttps://www.youtube.com/watch?v=oIcz5fQgtS8\u0026t=865s\u003e`_.\n- `dnachisel-dtailor-mode \u003chttps://github.com/Lix1993/dnachisel_dtailor_mode\u003e`_ brings\n  features from `D-tailor \u003chttps://academic.oup.com/bioinformatics/article/30/8/1087/254801\u003e`_\n  to DNA Chisel, in particular for the generation of large collection of sequences\n  covering the objectives fitness landscape (i.e. with sequences with are good at\n  some objectives and bad at others, and vice versa).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedinburgh-genome-foundry%2Fdnachisel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedinburgh-genome-foundry%2Fdnachisel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedinburgh-genome-foundry%2Fdnachisel/lists"}