<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>REBELSCIENCE</title><link>https://rebelscience.club/</link><description>Bioinformatics, Programming and Open-Source Science</description><item><title>Genome Toolkit. Part 4.1: Building a Scientific Python Package</title><link>https://rebelscience.club/2026/08/genome-toolkit-part-4-1-building-a-scientific-python-package/</link><guid isPermaLink="true">https://rebelscience.club/2026/08/genome-toolkit-part-4-1-building-a-scientific-python-package/</guid><pubDate>Mon, 24 Aug 2026 12:21:46 GMT</pubDate><description>In Part 4.1, we take a step back and look at where Genome Toolkit is going next. We introduce refactoring, explain why our small project is ready to grow into a proper scientific Python package, and show how this gives us a cleaner foundation for future biological tools and experiments. We also look at something pretty exciting: by building Genome Toolkit properly now, we are gradually making it AI-ready for future APIs, MCP tools, and AI agents.
</description><content:encoded><![CDATA[
<p class="wp-block-paragraph">Welcome back to the Genome Toolkit series!</p>



<p class="wp-block-paragraph">If you have been following rebelScience and our Genome Toolkit series for a while, you know that it has been quite a while since our last video. A few years, actually. And a lot has changed across software engineering, bioinformatics, and scientific research.</p>



<p class="wp-block-paragraph">In Parts 1, 2, and 3, we built our first useful bioinformatics algorithms using a very small Python project:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">genome_toolkit/
├── .git/
├── .gitignore
├── application.py
├── genome_toolkit.py
├── Pipfile
└── Pipfile.lock</pre></div>



<p class="wp-block-paragraph">That project already works. <code>application.py</code> creates our <code>genomeToolkit</code> object, runs the two k-mer algorithms we have built so far, and gives us:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">Sequence: AATTTTAAAAC
k-mer: AA
Repeats found: 4
Most frequent k-mer: ['TTT', 'AAA']</pre></div>



<p class="wp-block-paragraph">This was exactly the right structure for learning our first algorithms. We could keep everything close together, focus on the biology and Python, and immediately see what our code produced.</p>



<p class="wp-block-paragraph">We are absolutely going to continue building Genome Toolkit. We want to add more biological sequence types, load real biological data from files and databases, add more bioinformatics algorithms, and eventually use those tools together in larger experiments.</p>



<p class="wp-block-paragraph">Before we add all of that, however, we are going to improve the structure underneath the project and turn Genome Toolkit into a small scientific Python package.</p>



<p class="wp-block-paragraph">That process is called <strong>refactoring</strong>. Refactoring means reorganizing and improving the structure of existing software without changing what its core functionality is supposed to do.</p>



<p class="wp-block-paragraph">And by doing this now, relatively early in the project, we are going to get something pretty amazing almost for free. While we are turning Genome Toolkit into a cleaner, more professional scientific Python package, we are also gradually making it <strong>AI-ready</strong>.</p>



<p class="wp-block-paragraph">We will see exactly what that means as we progress through Parts 4.x. For now, the important idea is simple: the same clean, tested Genome Toolkit that we use ourselves will also become much easier for APIs, MCP tools, and AI agents to use later, without having to rebuild our scientific logic every time.</p>



<p class="wp-block-paragraph">We will keep using the same working Genome Toolkit while we improve it step by step. <code>application.py</code> will remain our familiar test: after each major change, we can run it again and make sure our original calculations still work.</p>



<h2 class="wp-block-heading">A Note for the Biologists</h2>



<p class="wp-block-paragraph">The next few parts will contain more software engineering than Parts 1 through 3, but our biological goal is not changing. We are still building Genome Toolkit so we can work with biological sequences, run useful algorithms, and eventually combine those tools into real experiments.</p>



<p class="wp-block-paragraph">The workflow will stay familiar:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">biological data
      ↓
Genome Toolkit
      ↓
scientific result</pre></div>



<p class="wp-block-paragraph">We are simply going to make the code underneath that workflow cleaner, easier to test, and easier to expand.</p>



<p class="wp-block-paragraph">You do not need to become a Python packaging expert to use Genome Toolkit. If your main interest is biology, you can treat these parts as the engineering foundation underneath the experiments we will build later.</p>



<h2 class="wp-block-heading">What Refactoring Means for Genome Toolkit</h2>



<p class="wp-block-paragraph">Right now, our project is very simple:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;textile&quot;,&quot;mime&quot;:&quot;text/x-textile&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Textile&quot;,&quot;language&quot;:&quot;Textile&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;textile&quot;}">application.py
      ↓
genome_toolkit.py
      ↓
two working algorithms</pre></div>



<p class="wp-block-paragraph">As Genome Toolkit grows, we want something closer to:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;textile&quot;,&quot;mime&quot;:&quot;text/x-textile&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Textile&quot;,&quot;language&quot;:&quot;Textile&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;textile&quot;}">application.py
      ↓
genome_toolkit package
      ↓
biological sequences
(DNA, RNA, proteins, etc.)
      ↓
data loaders
(FASTA, NCBI, other formats and sources)
      ↓
algorithms
(k-mer analysis, future sequence algorithms, etc.)
      ↓
scientific results
(results together with useful context)</pre></div>



<p class="wp-block-paragraph">The important point is that the scientific purpose stays the same. We are not changing <code>count_kmer()</code> just because we are reorganizing the project, and we are not changing <code>find_most_frequent_kmers()</code> just because the files around it move.</p>



<p class="wp-block-paragraph">We will improve the project structure first. Later, when we add automated tests, we can look at real edge cases and deliberately decide whether any algorithm behavior needs to change.</p>



<h2 class="wp-block-heading">Why Build a Scientific Python Package?</h2>



<p class="wp-block-paragraph">Our current two-file project works, but it was designed for a much smaller job. As Genome Toolkit grows, we will need to handle more than just two algorithms.</p>



<p class="wp-block-paragraph">For example, we are going to need code for things such as:</p>



<ul class="wp-block-list">
<li>representing and checking biological sequences;</li>



<li>loading sequence data from plain-text and FASTA files;</li>



<li>running different families of bioinformatics algorithms;</li>



<li>returning scientific results with useful context;</li>



<li>testing that calculations and error cases behave correctly.</li>
</ul>



<p class="wp-block-paragraph">If all of that grows inside one file, the project quickly becomes difficult to understand and change. A package lets us separate those jobs into smaller parts that each have a clear purpose.</p>



<p class="wp-block-paragraph">For example:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">genome_toolkit/
├── sequence/
├── load/
└── algorithms/</pre></div>



<p class="wp-block-paragraph"><code>sequence/</code> can contain code for biological sequences such as DNA. <code>load/</code> can contain code for reading biological data from files. <code>algorithms/</code> can contain the scientific calculations themselves.</p>



<p class="wp-block-paragraph">This also makes Genome Toolkit much easier to reuse. Instead of treating it as a couple of Python files that belong to one project folder, we will be able to install it and use it like a normal Python library:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">import genome_toolkit</pre></div>



<p class="wp-block-paragraph">That means the same tested scientific code can later be used from another Python script, a Jupyter notebook, a larger research project, a web application, or another tool.</p>



<p class="wp-block-paragraph">For us, this is also a useful step from an educational project toward a real portfolio project. We are not only showing that we can write individual bioinformatics algorithms. We are showing that we can organize those algorithms into scientific software that other people can install, test, reuse, and expand.</p>



<p class="wp-block-paragraph">Our goal with this refactoring is to move from the following type of simple script output:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">[Genome Toolkit Initiated]

Sequence: AATTTTAAAAC
k-mer: AA
Repeats found: 4
Most frequent k-mer: ['TTT', 'AAA']</pre></div>



<p class="wp-block-paragraph">To a scientific results like these:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application/x-json&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JSON&quot;,&quot;language&quot;:&quot;JSON&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;json&quot;}">{
  &quot;metadata&quot;: {
    &quot;toolkit_version&quot;: &quot;0.1.0&quot;,
    &quot;algorithm&quot;: &quot;count_kmer&quot;,
    &quot;timestamp&quot;: &quot;2026-08-24T09:30:53.399181Z&quot;
  },
  &quot;inputs&quot;: {
    &quot;sequence&quot;: {
      &quot;identifier&quot;: &quot;M57671.1&quot;,
      &quot;description&quot;: &quot;Octodon degus insulin mRNA, complete cds&quot;,
      &quot;length&quot;: 126
    }
  },
  &quot;parameters&quot;: {
    &quot;kmer&quot;: &quot;CCTT&quot;
  },
  &quot;output&quot;: {
    &quot;count&quot;: 5
  }
}

{
  &quot;metadata&quot;: {
    &quot;toolkit_version&quot;: &quot;0.1.0&quot;,
    &quot;algorithm&quot;: &quot;find_most_frequent_kmers&quot;,
    &quot;timestamp&quot;: &quot;2026-08-24T09:30:53.400405Z&quot;
  },
  &quot;inputs&quot;: {
    &quot;sequence&quot;: {
      &quot;identifier&quot;: &quot;M57671.1&quot;,
      &quot;description&quot;: &quot;Octodon degus insulin mRNA, complete cds&quot;,
      &quot;length&quot;: 126
    }
  },
  &quot;parameters&quot;: {
    &quot;k_len&quot;: 5
  },
  &quot;output&quot;: {
    &quot;kmers&quot;: [
      &quot;CTTGG&quot;,
      &quot;TTGGG&quot;,
      &quot;TGGGC&quot;,
      &quot;GGGCC&quot;
    ],
    &quot;frequency&quot;: 6
  }
}</pre></div>



<h2 class="wp-block-heading">Preparing Genome Toolkit for APIs, MCP, and AI Agents</h2>



<p class="wp-block-paragraph">There is another reason this structure is becoming increasingly useful.</p>



<p class="wp-block-paragraph">Today, scientific software does not have to be used only by someone manually writing Python code. The same package can later be connected to a web interface, an API, or an AI agent.</p>



<p class="wp-block-paragraph">An <strong>API</strong>, or Application Programming Interface, gives one program a structured way to use another program. <strong>MCP</strong>, or Model Context Protocol, gives AI systems a standardized way to connect to external tools.</p>



<p class="wp-block-paragraph">We will explain both properly when they become relevant. For now, the important idea is simply that Genome Toolkit can become the tested scientific tool underneath those systems.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2.png"><img decoding="async" width="1280" height="720" src="https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-1280x720.png" alt="" class="wp-image-2440" srcset="https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-1280x720.png 1280w, https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-512x288.png 512w, https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-768x432.png 768w, https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-1536x864.png 1536w, https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-24x14.png 24w, https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-36x20.png 36w, https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2-48x27.png 48w, https://rebelscience.club/wp-content/uploads/2026/08/apu_mcp-2.png 1672w" sizes="(max-width: 1280px) 100vw, 1280px" /></a></figure>
</div>


<p class="wp-block-paragraph">Imagine asking an AI agent:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Find 100 genomes of this bacterium, run our k-mer analyses on them, compare the results, and prepare a summary.</p>
</blockquote>



<p class="wp-block-paragraph">Without dedicated scientific tools, the AI has to figure out much of that workflow by itself. It may search for genome sequences from different places, choose how to download them, write analysis code while it is working, pick libraries, and decide how to organize the calculations.</p>



<p class="wp-block-paragraph">That flexibility can be useful, but it creates a problem for science. Modern language models are <strong>non-deterministic</strong>, which means they can make different choices across separate runs. If the AI is also writing the algorithms and deciding where the data comes from every time, reproducing exactly the same experiment becomes much harder.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rebelscience.club/wp-content/uploads/2026/08/determ-1.png"><img decoding="async" width="1280" height="720" src="https://rebelscience.club/wp-content/uploads/2026/08/determ-1-1280x720.png" alt="" class="wp-image-2435" srcset="https://rebelscience.club/wp-content/uploads/2026/08/determ-1-1280x720.png 1280w, https://rebelscience.club/wp-content/uploads/2026/08/determ-1-512x288.png 512w, https://rebelscience.club/wp-content/uploads/2026/08/determ-1-768x432.png 768w, https://rebelscience.club/wp-content/uploads/2026/08/determ-1-1536x864.png 1536w, https://rebelscience.club/wp-content/uploads/2026/08/determ-1-24x14.png 24w, https://rebelscience.club/wp-content/uploads/2026/08/determ-1-36x20.png 36w, https://rebelscience.club/wp-content/uploads/2026/08/determ-1-48x27.png 48w, https://rebelscience.club/wp-content/uploads/2026/08/determ-1.png 1672w" sizes="(max-width: 1280px) 100vw, 1280px" /></a></figure>
</div>


<p class="wp-block-paragraph">Now imagine that the AI can use Genome Toolkit instead.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">AI agent
    ↓
Genome Toolkit tools
    ↓
tested scientific calculations
    ↓
structured results</pre></div>



<p class="wp-block-paragraph">The AI can still help organize the work, choose which tools to call, compare many results, and prepare a report. But the actual k-mer calculation can come from the same <code>count_kmer()</code> function that we already wrote, understand, and test.</p>



<p class="wp-block-paragraph">The same idea applies to loading biological data. Instead of inventing a new FASTA parser every time, the AI can use our loader. Instead of returning a number with no context, Genome Toolkit can later return a structured result that tells us which sequence, parameters, algorithm, and software version produced it.</p>



<p class="wp-block-paragraph">This is where <strong>reproducibility</strong> and <strong>provenance</strong> become important. Reproducibility means that we should be able to repeat the same scientific calculation using the same data, algorithm, parameters, and software version. Provenance means keeping enough information to understand where a result came from.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rebelscience.club/wp-content/uploads/2026/08/prov-1.png"><img decoding="async" width="1280" height="720" src="https://rebelscience.club/wp-content/uploads/2026/08/prov-1-1280x720.png" alt="" class="wp-image-2437" srcset="https://rebelscience.club/wp-content/uploads/2026/08/prov-1-1280x720.png 1280w, https://rebelscience.club/wp-content/uploads/2026/08/prov-1-512x288.png 512w, https://rebelscience.club/wp-content/uploads/2026/08/prov-1-768x432.png 768w, https://rebelscience.club/wp-content/uploads/2026/08/prov-1-1536x864.png 1536w, https://rebelscience.club/wp-content/uploads/2026/08/prov-1-24x14.png 24w, https://rebelscience.club/wp-content/uploads/2026/08/prov-1-36x20.png 36w, https://rebelscience.club/wp-content/uploads/2026/08/prov-1-48x27.png 48w, https://rebelscience.club/wp-content/uploads/2026/08/prov-1.png 1672w" sizes="(max-width: 1280px) 100vw, 1280px" /></a></figure>
</div>


<p class="wp-block-paragraph">We are not going to build all of that in this article. We will introduce each piece when we actually need it and can immediately see what problem it solves.</p>



<p class="wp-block-paragraph">For now, the high-level idea is enough:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">Python script / notebook / web app / AI agent
                    ↓
              Genome Toolkit
                    ↓
          tested scientific code
                    ↓
             scientific result</pre></div>



<p class="wp-block-paragraph">Genome Toolkit itself will stay focused on the science. Web servers, APIs, MCP connections, authentication, databases, and AI-agent logic can live outside the package and use Genome Toolkit as the scientific core underneath them.</p>



<h2 class="wp-block-heading">What We Will Build Next</h2>



<p class="wp-block-paragraph">Over the next few parts, we will gradually turn the same working project into a modern scientific Python package.</p>



<p class="wp-block-paragraph">At a high level, we will:</p>



<ul class="wp-block-list">
<li>modernize the project with <code>uv</code> and a proper Python package structure;</li>



<li>add validated biological sequence objects such as <code>DNA</code>;</li>



<li>load biological data from plain-text and FASTA files;</li>



<li>return more useful scientific results;</li>



<li>add automated tests and clearer error behavior.</li>
</ul>



<p class="wp-block-paragraph">We do not need to understand all of those pieces yet. We will introduce them one at a time, when we actually build and use them.</p>



<p class="wp-block-paragraph">The important thing to remember is where we are going:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text/x-python&quot;,&quot;theme&quot;:&quot;monokai&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Python&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}">biological data
      ↓
Genome Toolkit
      ↓
tested algorithms
      ↓
scientific results</pre></div>



<p class="wp-block-paragraph">Everything else we add is there to make that workflow easier to use, easier to trust, and easier to expand.</p>



<h2 class="wp-block-heading">Summary</h2>



<p class="wp-block-paragraph">Our original Genome Toolkit project was exactly what we needed for learning our first algorithms. Now we want to grow it into a scientific Python package that can handle biological sequences, external data, more algorithms, better results, and automated testing without becoming difficult to maintain.</p>



<p class="wp-block-paragraph">The scientific goal stays the same. We are still building a practical bioinformatics toolkit, and our existing k-mer algorithms remain the starting point.</p>



<p class="wp-block-paragraph">The new package structure will also make Genome Toolkit much easier to reuse from other Python projects, notebooks, future web applications, APIs, MCP tools, and AI agents. Most importantly, it gives us a cleaner foundation for building scientific workflows that are easier to test, understand, and reproduce.</p>



<h3 class="wp-block-heading">What is Next?</h3>



<p class="wp-block-paragraph">In <strong>Genome Toolkit Part 4.2</strong>, we will finally start changing the project.</p>



<p class="wp-block-paragraph">We will begin by running our current <code>application.py</code> one more time and confirming the familiar output. Then we will modernize the same project with <code>uv</code>, create a proper Python package structure, move our existing k-mer algorithms into it, and run <code>application.py</code> again.</p>



<p class="wp-block-paragraph">That gives us a very simple first goal: change how Genome Toolkit is organized while keeping the scientific calculations working.</p>



<p class="wp-block-paragraph">From there, we will continue one useful step at a time.</p>



<p class="wp-block-paragraph">I hope this introduction to building our scientific Python package was useful for your bioinformatics and programming journey! If you found this article valuable and want to help us continue building rebelScience, please consider supporting our project. You can explore various ways to contribute <a href="https://rebelscience.club/cryptocurrency-donations/">here</a>.</p>



<p class="wp-block-paragraph">Until next time, rebelCoder, signing out.</p>



<p class="wp-block-paragraph">A video version of this article:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Genome Toolkit. Part 4.1: Building a Scientific Python Package" width="640" height="360" src="https://www.youtube.com/embed/tkaVS_LCfpo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph"></p>
]]></content:encoded></item></channel></rss>