{"id":37863432,"url":"https://github.com/kloetzl/libdna","last_synced_at":"2026-01-18T00:32:47.155Z","repository":{"id":44633020,"uuid":"136008071","full_name":"kloetzl/libdna","owner":"kloetzl","description":"♥ Essential Functions for DNA Manipulation","archived":false,"fork":false,"pushed_at":"2025-06-15T12:10:22.000Z","size":814,"stargazers_count":20,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T13:27:12.577Z","etag":null,"topics":["bioinformatics","dna","simd-optimizations"],"latest_commit_sha":null,"homepage":"https://libdna.readthedocs.io/en/latest/","language":"C","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/kloetzl.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","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":"2018-06-04T10:17:12.000Z","updated_at":"2025-06-15T12:10:27.000Z","dependencies_parsed_at":"2023-02-02T19:45:28.959Z","dependency_job_id":"5e5f816a-1e23-4957-88ad-a696ae915d8f","html_url":"https://github.com/kloetzl/libdna","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kloetzl/libdna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kloetzl%2Flibdna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kloetzl%2Flibdna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kloetzl%2Flibdna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kloetzl%2Flibdna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kloetzl","download_url":"https://codeload.github.com/kloetzl/libdna/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kloetzl%2Flibdna/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","dna","simd-optimizations"],"created_at":"2026-01-16T16:34:26.878Z","updated_at":"2026-01-16T16:34:27.443Z","avatar_url":"https://github.com/kloetzl.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libdna\n\n\nThe aim of this project is to unify functionality commonly found in bioinformatics projects working on DNA. DNA, as opposed to RNA or amino acid sequences, are very long strings. Even bacterial genomes are easily a few megabyte in size. Thus, for efficient analysis the length has to be taken into account in the design of an application. To this end, libdna contains SIMD routines highly optimised for DNA strings. For some functions the library even chooses the optimal implementation depending on the CPU at runtime.\n\n# Installation\n\nLibdna requires the [Meson](https://mesonbuild.com/) buildsystem. It is commonly available via package managers. Then execute the following steps to compile and install the latest version of libdna.\n\n    git clone https://github.com/kloetzl/libdna.git\n    meson builddir\n    cd builddir\n    meson compile\n    meson install\n\nContributors may also want to take a look at the `Makefile.Maintainer`. It contains handy shortcuts set up tests, benchmarks and other release related files.\n\n# How to use\n\nLibdna is both simple, efficient and customizable. For instance, many bioinformatics tools need to compute the reverse complement of some DNA sequence. Now it is just one function call away, `dna4_revcomp`. The prefix `dna4` indicates that this function is optimised for strings containing only the four canonical nucleotides A, C, G and T. The first parameter is a pointer to the beginning of the string. The second parameter points to the first byte just past the string. So for a string starting at `str` of length `len` the arguments are `str` and `str + len` representing the string `[str, str+1, …, str+len)`. The last parameter is a pointer to a location with enough space to hold the reverse compliment.\n\n```C\n#include \u003ckloetzl/dna.h\u003e\n\nint main()\n{\n\tchar buffer[] = \"ACGT\";\n\tchar rev[5] = {0};\n\tdna4_revcomp(buffer, buffer + 4, rev);\n\n\tprintf(\"%s\\n\", rev);\n}\n```\n\nIn C++ things are even simpler thanks to a thin wrapper. Instead of raw pointers it uses `std::string_view` and `std::string` to make the API more convenient.\n\n```C++\n#include \u003ckloetzl/dna.hpp\u003e\n\nint main()\n{\n\tstd::cout \u003c\u003c dna4::revcomp(\"ACGT\") \u003c\u003c \"\\n\";\n}\n```\n\nAs the wrapper relies on automatic memory management, which can incur a significant runtime overhead, the underlying C functions are still available for use. Don't forget to link with `-ldna`.\n\n# Bonus\n\n- libdna comes with man pages for IUPAC codes and the standard genetic code.\n- Where a `dna4_` function provides high performance at the expense of limited applicability the `dnax_` functions provide generality at the expense of speed.\n- Some functions pick the optimal SIMD instruction set at runtime.\n- To prove efficiency, benchmarks with alternate implementations are included.\n\n# License\n\nCopyright © 2018 - 2023 Fabian Klötzl \u003cfabian-libdna@kloetzl.info\u003e  \nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkloetzl%2Flibdna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkloetzl%2Flibdna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkloetzl%2Flibdna/lists"}