A place to cache linked articles (think custom and personal wayback machine)
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

index.html 19KB

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