A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="fr">
  4. <!-- Has to be within the first 1024 bytes, hence before the <title>
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>DNA Chisel - a versatile sequence optimizer (archive) — David Larlet</title>
  13. <meta name="description" content="Publication mise en cache pour en conserver une trace.">
  14. <!-- That good ol' feed, subscribe :). -->
  15. <link rel="alternate" type="application/atom+xml" title="Feed" href="/david/log/">
  16. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  17. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  18. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  19. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  20. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  21. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  22. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  23. <meta name="msapplication-TileColor" content="#f0f0ea">
  24. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  25. <meta name="theme-color" content="#f0f0ea">
  26. <!-- Documented, feel free to shoot an email. -->
  27. <link rel="stylesheet" href="/static/david/css/style_2021-01-20.css">
  28. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  29. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  30. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  31. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  32. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  34. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  35. <script>
  36. function toggleTheme(themeName) {
  37. document.documentElement.classList.toggle(
  38. 'forced-dark',
  39. themeName === 'dark'
  40. )
  41. document.documentElement.classList.toggle(
  42. 'forced-light',
  43. themeName === 'light'
  44. )
  45. }
  46. const selectedTheme = localStorage.getItem('theme')
  47. if (selectedTheme !== 'undefined') {
  48. toggleTheme(selectedTheme)
  49. }
  50. </script>
  51. <meta name="robots" content="noindex, nofollow">
  52. <meta content="origin-when-cross-origin" name="referrer">
  53. <!-- Canonical URL for SEO purposes -->
  54. <link rel="canonical" href="https://edinburgh-genome-foundry.github.io/DnaChisel/">
  55. <body class="remarkdown h1-underline h2-underline h3-underline em-underscore hr-center ul-star pre-tick">
  56. <article>
  57. <header>
  58. <h1>DNA Chisel - a versatile sequence optimizer</h1>
  59. </header>
  60. <nav>
  61. <p class="center">
  62. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  63. <use xlink:href="/static/david/icons2/symbol-defs.svg#icon-home"></use>
  64. </svg> Accueil</a> •
  65. <a href="https://edinburgh-genome-foundry.github.io/DnaChisel/" title="Lien vers le contenu original">Source originale</a>
  66. </p>
  67. </nav>
  68. <hr>
  69. <p>DNA Chisel (complete documentation <a class="reference external" href="https://edinburgh-genome-foundry.github.io/DnaChisel/">here</a>)
  70. is a Python library for optimizing DNA sequences with respect to a set of
  71. constraints and optimization objectives. It comes with over 15 classes of
  72. sequence specifications which can be composed to, for instance, codon-optimize
  73. genes, meet the constraints of a commercial DNA provider, avoid homologies
  74. between sequences, tune GC content, or all of this at once!</p>
  75. <p>DNA Chisel also allows users to define their own specifications in Python,
  76. making the library suitable for a large range of automated sequence design
  77. applications, and complex custom design projects. It can be used as a Python
  78. library, a command-line interface, or a <a class="reference external" href="https://cuba.genomefoundry.org/sculpt_a_sequence">web application</a>.</p>
  79. <div class="section" id="example-of-use">
  80. <h2>Example of use</h2>
  81. <div class="section" id="defining-a-problem-via-scripts">
  82. <h3>Defining a problem via scripts</h3>
  83. <p>In this basic example we generate a random sequence and optimize it so that</p>
  84. <ul class="simple">
  85. <li><p>It will be rid of BsaI sites.</p></li>
  86. <li><p>GC content will be between 30% and 70% on every 50bp window.</p></li>
  87. <li><p>The reading frame at position 500-1400 will be codon-optimized for <em>E. coli</em>.</p></li>
  88. </ul>
  89. <p>Here is the code to achieve that:</p>
  90. <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">dnachisel</span> <span class="kn">import</span> <span class="o">*</span>
  91. <span class="c1"># DEFINE THE OPTIMIZATION PROBLEM</span>
  92. <span class="n">problem</span> <span class="o">=</span> <span class="n">DnaOptimizationProblem</span><span class="p">(</span>
  93. <span class="n">sequence</span><span class="o">=</span><span class="n">random_dna_sequence</span><span class="p">(</span><span class="mi">10000</span><span class="p">),</span>
  94. <span class="n">constraints</span><span class="o">=</span><span class="p">[</span>
  95. <span class="n">AvoidPattern</span><span class="p">(</span><span class="s2">"BsaI_site"</span><span class="p">),</span>
  96. <span class="n">EnforceGCContent</span><span class="p">(</span><span class="n">mini</span><span class="o">=</span><span class="mf">0.3</span><span class="p">,</span> <span class="n">maxi</span><span class="o">=</span><span class="mf">0.7</span><span class="p">,</span> <span class="n">window</span><span class="o">=</span><span class="mi">50</span><span class="p">),</span>
  97. <span class="n">EnforceTranslation</span><span class="p">(</span><span class="n">location</span><span class="o">=</span><span class="p">(</span><span class="mi">500</span><span class="p">,</span> <span class="mi">1400</span><span class="p">))</span>
  98. <span class="p">],</span>
  99. <span class="n">objectives</span><span class="o">=</span><span class="p">[</span><span class="n">CodonOptimize</span><span class="p">(</span><span class="n">species</span><span class="o">=</span><span class="s1">'e_coli'</span><span class="p">,</span> <span class="n">location</span><span class="o">=</span><span class="p">(</span><span class="mi">500</span><span class="p">,</span> <span class="mi">1400</span><span class="p">))]</span>
  100. <span class="p">)</span>
  101. <span class="c1"># SOLVE THE CONSTRAINTS, OPTIMIZE WITH RESPECT TO THE OBJECTIVE</span>
  102. <span class="n">problem</span><span class="o">.</span><span class="n">resolve_constraints</span><span class="p">()</span>
  103. <span class="n">problem</span><span class="o">.</span><span class="n">optimize</span><span class="p">()</span>
  104. <span class="c1"># PRINT SUMMARIES TO CHECK THAT CONSTRAINTS PASS</span>
  105. <span class="k">print</span><span class="p">(</span><span class="n">problem</span><span class="o">.</span><span class="n">constraints_text_summary</span><span class="p">())</span>
  106. <span class="k">print</span><span class="p">(</span><span class="n">problem</span><span class="o">.</span><span class="n">objectives_text_summary</span><span class="p">())</span>
  107. </pre></div>
  108. </div>
  109. <p>DnaChisel implements advanced constraints such as the preservation of coding
  110. sequences, or the inclusion or exclusion of advanced patterns (see
  111. <a class="reference external" href="https://edinburgh-genome-foundry.github.io/DnaChisel/ref/builtin_specifications.html">this page</a>
  112. for an overview of available specifications), but it is also easy to implement
  113. our own constraints and objectives as subclasses of <code class="docutils literal notranslate"><span class="pre">dnachisel.Specification</span></code>.</p>
  114. </div>
  115. <div class="section" id="defining-a-problem-via-genbank-features">
  116. <h3>Defining a problem via Genbank features</h3>
  117. <p>You can also define a problem by annotating directly a Genbank as follows:</p>
  118. <p align="center">
  119. <img alt="report" title="report" src="https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/DnaChisel/master/docs/_static/images/example_sequence_map.png">
  120. <br><br>
  121. </p><p>I this record:</p>
  122. <ul class="simple">
  123. <li><p>Constraints (colored in blue in the illustration) are features of type
  124. <code class="docutils literal notranslate"><span class="pre">misc_feature</span></code> with a prefix <code class="docutils literal notranslate"><span class="pre">@</span></code> followed
  125. by the name of the constraints and its parameters, which are the same as in
  126. python scripts.</p></li>
  127. <li><p>Optimization objectives (colored in yellow in the illustration) are features
  128. of type <code class="docutils literal notranslate"><span class="pre">misc_feature</span></code> with a prefix <code class="docutils literal notranslate"><span class="pre">~</span></code> followed by the name of the
  129. constraints and its parameters.</p></li>
  130. </ul>
  131. <p>The file can be directly fed to the <a class="reference external" href="https://cuba.genomefoundry.org/sculpt_a_sequence">web app</a>
  132. or processed via the command line interface:</p>
  133. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># Output the result to "optimized_record.gb"</span>
  134. dnachisel annotated_record.gb optimized_record.gb
  135. </pre></div>
  136. </div>
  137. <p>Or via a Python script:</p>
  138. <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">dnachisel</span> <span class="kn">import</span> <span class="n">DnaOptimizationProblem</span>
  139. <span class="n">problem</span> <span class="o">=</span> <span class="n">DnaOptimizationProblem</span><span class="o">.</span><span class="n">from_record</span><span class="p">(</span><span class="s2">"my_record.gb"</span><span class="p">)</span>
  140. <span class="n">problem</span><span class="o">.</span><span class="n">optimize_with_report</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="s2">"report.zip"</span><span class="p">)</span>
  141. </pre></div>
  142. </div>
  143. <p>By default, only the built-in specifications of DnaChisel can be used in the
  144. annotations, however it is easy to add your own specifications to the Genbank
  145. parser, and build applications supporting custom specifications on top of
  146. DnaChisel.</p>
  147. </div>
  148. <div class="section" id="reports">
  149. <h3>Reports</h3>
  150. <p>DnaChisel also implements features for verification and troubleshooting. For
  151. instance by generating optimization reports:</p>
  152. <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">problem</span><span class="o">.</span><span class="n">optimize_with_report</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="s2">"report.zip"</span><span class="p">)</span>
  153. </pre></div>
  154. </div>
  155. <p>Here is an example of summary report:</p>
  156. <p align="center">
  157. <img alt="report" title="report" src="https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/DnaChisel/master/docs/_static/images/report_screenshot.png">
  158. <br><br>
  159. </p></div>
  160. </div>
  161. <div class="section" id="how-it-works">
  162. <h2>How it works</h2>
  163. <p>DnaChisel hunts down every constraint breach and suboptimal region by
  164. recreating local version of the problem around these regions. Each type of
  165. constraint can be locally <em>reduced</em> and solved in its own way, to ensure fast
  166. and reliable resolution.</p>
  167. <p>Below is an animation of the algorithm in action:</p>
  168. <p align="center">
  169. <img alt="DNA Chisel algorithm" title="DNA Chisel" src="https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/DnaChisel/master/docs/_static/images/dnachisel_algorithm.gif">
  170. <br>
  171. </p></div>
  172. <div class="section" id="installation">
  173. <h2>Installation</h2>
  174. <p>You can install DnaChisel through PIP:</p>
  175. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">dnachisel</span><span class="p">[</span><span class="n">reports</span><span class="p">]</span>
  176. </pre></div>
  177. </div>
  178. <p>The <code class="docutils literal notranslate"><span class="pre">[reports]</span></code> suffix will install some heavier libraries
  179. (Matplotlib, PDF reports, sequenticon) for report generation,
  180. you can omit it if you just want to use DNA chisel to edit sequences and
  181. generate genbanks (for any interactive use, reports are highly recommended).</p>
  182. <p>Alternatively, you can unzip the sources in a folder and type</p>
  183. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">python</span> <span class="n">setup</span><span class="o">.</span><span class="n">py</span> <span class="n">install</span>
  184. </pre></div>
  185. </div>
  186. <p>Optionally, also install Bowtie to be able to use <code class="docutils literal notranslate"><span class="pre">AvoidMatches</span></code> (which
  187. removes short homologies with existing genomes). On Ubuntu:</p>
  188. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">bowtie</span>
  189. </pre></div>
  190. </div>
  191. </div>
  192. <div class="section" id="more-biology-software">
  193. <h2>More biology software</h2>
  194. <a class="reference external image-reference" href="https://edinburgh-genome-foundry.github.io/"><img alt="https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Edinburgh-Genome-Foundry.github.io/master/static/imgs/logos/egf-codon-horizontal.png" src="https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Edinburgh-Genome-Foundry.github.io/master/static/imgs/logos/egf-codon-horizontal.png"></a>
  195. <p>DNA Chisel is part of the <a class="reference external" href="https://edinburgh-genome-foundry.github.io/">EGF Codons</a> synthetic biology software suite for DNA design, manufacturing and validation.</p>
  196. </article>
  197. <hr>
  198. <footer>
  199. <p>
  200. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  201. <use xlink:href="/static/david/icons2/symbol-defs.svg#icon-home"></use>
  202. </svg> Accueil</a> •
  203. <a href="/david/log/" title="Accès au flux RSS"><svg class="icon icon-rss2">
  204. <use xlink:href="/static/david/icons2/symbol-defs.svg#icon-rss2"></use>
  205. </svg> RSS</a> •
  206. <a href="http://larlet.com" title="Go to my English profile" data-instant><svg class="icon icon-user-tie">
  207. <use xlink:href="/static/david/icons2/symbol-defs.svg#icon-user-tie"></use>
  208. </svg> Pro</a> •
  209. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel"><svg class="icon icon-mail">
  210. <use xlink:href="/static/david/icons2/symbol-defs.svg#icon-mail"></use>
  211. </svg> Email</a> •
  212. <abbr class="nowrap" title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340"><svg class="icon icon-hammer2">
  213. <use xlink:href="/static/david/icons2/symbol-defs.svg#icon-hammer2"></use>
  214. </svg> Légal</abbr>
  215. </p>
  216. <template id="theme-selector">
  217. <form>
  218. <fieldset>
  219. <legend><svg class="icon icon-brightness-contrast">
  220. <use xlink:href="/static/david/icons2/symbol-defs.svg#icon-brightness-contrast"></use>
  221. </svg> Thème</legend>
  222. <label>
  223. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  224. </label>
  225. <label>
  226. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  227. </label>
  228. <label>
  229. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  230. </label>
  231. </fieldset>
  232. </form>
  233. </template>
  234. </footer>
  235. <script>
  236. function loadThemeForm(templateName) {
  237. const themeSelectorTemplate = document.querySelector(templateName)
  238. const form = themeSelectorTemplate.content.firstElementChild
  239. themeSelectorTemplate.replaceWith(form)
  240. form.addEventListener('change', (e) => {
  241. const chosenColorScheme = e.target.value
  242. localStorage.setItem('theme', chosenColorScheme)
  243. toggleTheme(chosenColorScheme)
  244. })
  245. const selectedTheme = localStorage.getItem('theme')
  246. if (selectedTheme && selectedTheme !== 'undefined') {
  247. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  248. }
  249. }
  250. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  251. window.addEventListener('load', () => {
  252. let hasDarkRules = false
  253. for (const styleSheet of Array.from(document.styleSheets)) {
  254. let mediaRules = []
  255. for (const cssRule of styleSheet.cssRules) {
  256. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  257. continue
  258. }
  259. // WARNING: Safari does not have/supports `conditionText`.
  260. if (cssRule.conditionText) {
  261. if (cssRule.conditionText !== prefersColorSchemeDark) {
  262. continue
  263. }
  264. } else {
  265. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  266. continue
  267. }
  268. }
  269. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  270. }
  271. // WARNING: do not try to insert a Rule to a styleSheet you are
  272. // currently iterating on, otherwise the browser will be stuck
  273. // in a infinite loop…
  274. for (const mediaRule of mediaRules) {
  275. styleSheet.insertRule(mediaRule.cssText)
  276. hasDarkRules = true
  277. }
  278. }
  279. if (hasDarkRules) {
  280. loadThemeForm('#theme-selector')
  281. }
  282. })
  283. </script>
  284. </body>
  285. </html>