From 14313035b429c9335ae3d35e35c24ba6c4342ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kl=C3=B6tzl?= Date: Sun, 25 Feb 2024 11:50:20 +0000 Subject: [PATCH 1/2] python: create pyproject.toml --- python/Readme.md | 12 ++++++++++++ python/pyproject.toml | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 python/Readme.md create mode 100644 python/pyproject.toml diff --git a/python/Readme.md b/python/Readme.md new file mode 100644 index 0000000..76ca7d1 --- /dev/null +++ b/python/Readme.md @@ -0,0 +1,12 @@ +# libdna - Python API + +The 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 routines. + +This is the Python API with similar functionality as the C funtions. Support is experimental and may change in the future. + + + +# License + +Copyright © 2018 - 2024 Fabian Klötzl +MIT License diff --git a/python/pyproject.toml b/python/pyproject.toml new file mode 100644 index 0000000..af648eb --- /dev/null +++ b/python/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "libdna" +version = "1.3" +description = "Essential Functions for DNA Manipulation" +authors = ["Fabian Klötzl "] +license = "MIT" +readme = "Readme.md" + +[tool.poetry.dependencies] +python = "^3.11" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" From 64bce7438320f7705e000ab25981ffc150f3e7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kl=C3=B6tzl?= Date: Sun, 25 Feb 2024 12:13:31 +0000 Subject: [PATCH 2/2] python: add examples --- python/examples/libdna | 1 + python/examples/random.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 120000 python/examples/libdna create mode 100644 python/examples/random.py diff --git a/python/examples/libdna b/python/examples/libdna new file mode 120000 index 0000000..e849611 --- /dev/null +++ b/python/examples/libdna @@ -0,0 +1 @@ +../libdna \ No newline at end of file diff --git a/python/examples/random.py b/python/examples/random.py new file mode 100644 index 0000000..3b6899d --- /dev/null +++ b/python/examples/random.py @@ -0,0 +1,21 @@ +from libdna import dna4 +import argparse + + +def main(): + parser = argparse.ArgumentParser( + prog='random', + description='Create a random string of DNA') + parser.add_argument('-s', type=int, help='seed', default=1729) + parser.add_argument('-l', type=int, help='length', default=80) + + args = parser.parse_args() + seed = args.s + length = args.l + + print(f">rnd {seed=}") + print(dna4.random(length, seed)) + + +if __name__ == '__main__': + main()