Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kloetzl committed May 27, 2024
2 parents 557cdb8 + 64bce74 commit 3802e09
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/Readme.md
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
MIT License
1 change: 1 addition & 0 deletions python/examples/libdna
21 changes: 21 additions & 0 deletions python/examples/random.py
Original file line number Diff line number Diff line change
@@ -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()
15 changes: 15 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "libdna"
version = "1.3"
description = "Essential Functions for DNA Manipulation"
authors = ["Fabian Klötzl <[email protected]>"]
license = "MIT"
readme = "Readme.md"

[tool.poetry.dependencies]
python = "^3.11"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 3802e09

Please sign in to comment.