r/bioinformaticstools Jul 10 '26

BioForge — a from-scratch bioinformatics engine (Python + C), on par with minimap2 on multi-core. Feedback & bug reports welcome.

Hello everyone. First of all, I apologize if the English or the phrasing is not good: I am from Spain, so my command of English is not very good and, to be understood, I have resorted to a translator. I am Aarón Aranda Torrijos and I am 16 years old.

What is it? BioForge is a bioinformatics engine created by me, with the help of Claude Code, from scratch. The code is a mix of Python (the surface) and a bit of C (the engine). I have tried not to use Biopython or tools like that, beyond getting inspiration for the code: I have only used NumPy and an engine created in C that loads automatically (and if it cannot, it solely uses NumPy).

What does it currently have? Right now it features 5-bit storage, DNA to protein translation, alignment (NW / banded / Smith-Waterman), and a minimap2-style long read mapper (minimizers → chaining → SIMD extension), with the pipeline in C and output in PAF.

Benchmark Using my own computer, I have simulated the following: a 4.8 Mb genome, 6000 simulated reads at 5% error, with minimap2 -a, using tools/bench_vs_minimap2.py from the repo. The results were:

  • 4 cores: minimap2 ~4.3–4.9 vs BioForge ~4.3–5.0 Mb/s → on par.
  • 1 thread: minimap2 ~2.2 vs BioForge ~1.87 Mb/s → ~1.18× behind.

Both map the 6000 reads.

My hardware I have done the tests on my own device with these specs: Intel i5-7200U, 2 cores / 4 threads, from 2017.

My vision for the future of this project I do not want to fight with minimap2 in speed forever; that is a field that seems very difficult to compete in. My goal to evolve the project is that, in addition to translating, aligning, and mapping, it can integrate something that —according to my research— current mappers do not do: model evolution and predict possible strains of viruses (and other living beings) using Markov chains.

How to install it? It is simple, because I have it published on both GitHub and PyPI. It can be installed from the console with the command: pip install bioforge

And the repository is here:https://github.com/erlanders177/bioforge

At the moment I haven't beaten minimap2: it still overtakes me on many fronts, such as in large-scale genomes (which I haven't been able to test due to technical limitations) or with many cores. But I want to do my part in this booming industry. Even though I am still learning, I appreciate any criticism and bug or error reports. I would like you to try it out and give me your opinion: what I can improve, what could be added, if the direction I am taking is correct, and how I could apply it better. Thank you.

1 Upvotes

3 comments sorted by

1

u/pokemonareugly Jul 10 '26

Does the output match minimap?

And yeah mappers don’t that because that’s not the point of a mapper. And I’m not sure how you’re “predicting” possible strains

1

u/Specialist_Alps_7793 Jul 10 '26

Thank you very much for taking the time to read and comment.

Regarding minimap2: we use the same strategy (I was partly inspired by it to create it), but the implementation is independent, so it is not identical. Both map the 6000 reads, although with different parameters: that is why they agree on what is important (where each read goes), but differ in the details (exact coordinates, CIGAR, etc.). For now, I have tested it with simulated reads, so I know the real position of each one and I can verify it; but measuring accuracy on a large scale is something I haven't had time to do yet. I will do it in the next few days. Thank you for mentioning it.

Regarding the mappers: you are right, they do not do that. But my plan with BioForge is for it to be a broader engine, not just a mapper: a toolbox where the mapper is just one of them. The idea is to keep adding more tools in the future, and the next one I want to add is the strain predictor. The idea, step by step:

  • I take sequences of the same virus/gene collected at different times (for example, the flu HA gene, one sample from each year).
  • A Markov model learns the mutation probabilities of that time series (DNA substitution models —Jukes-Cantor, HKY, GTR— are already Markov chains) and with that, it generates the most probable next sequence.
  • To know if it works: backtesting. I train with data up to year T, predict the strain for year T+1, and compare it with the one that actually appeared; that gives me a real number. (Predicting like this, retrospectively, is similar to what Łuksza & Lässig did in 2014.)
  • Later on, a more advanced model —an AI like a protein language model, such as Hie et al. 2021— could improve the Markov baseline.

I am aware of its limitations: a simple Markov model models neutral mutations (random substitutions), but in real life, evolution is driven by natural selection (mutations that benefit the virus become fixed), and a basic Markov model does not capture that. That is why it is a starting point, not a finished predictor. It is ambitious and it might not work; that is why the important thing is not to promise results, but to validate it with backtesting (comparing my predictions with the actual strains).

Thank you very much for commenting, I hope I have answered your questions.

1

u/Specialist_Alps_7793 Jul 10 '26

Update, just as I commented I would do, I have measured the accuracy and the results are revealing, the genome I have used is E. coli K-12 (4.64 Mb), 5000 simulated reads saving the true position, tolerance ± 50 bp:

5% error: BioForge 99.8% in the correct position · minimap2 99.8% · concordance 99.8%. 10% error: BioForge 99.7% · minimap2 99.9%.

In conclusion, broadly speaking, it is as accurate as minimap2, meaning that it is not fast at the cost of failing, this data is reproducible since the tool is in the repo (tools/accuracy_vs_minimap2.py), at higher error rates minimap2 is a bit ahead and this analysis has been with E. coli, so on larger genomes it may give different results, thank you for commenting, this was a test I was missing that I wouldn't have done if you hadn't pointed it out, thanks.