Skip to main content

A Python 3.9 implementation of the leapdna toolkit

Project description

👩‍🔬 leapdna.py

An implementation of the leapdna toolkit in Python.

Installation

leapdna is compatible with Python 3.9 and greater. Install it from PyPI with

pip install leapdna

Usage

Working with data

leapdna aims to provide a way to represent a lot of the data that is normally dealt with in genetics, with a focus on forensic applications. The usual suspects here are loci, alleles, profiles, allele frequency studies... All of these are represented in leapdna by a block. A block is a Python class which can be stored as a JSON file with the leapdna format. All blocks inherit from the Base block class and define some attributes and functionality of their own. For instance, a Locus block has a name attribute, in addition to a band attribute, which specifies the chromosome band where the locus is. Other Locus blocks will have different values for these attributes while other types of blocks, such as Allele, will have a different set of attributes altogether. The documentation details which attributes are supported (and sometimes required) for a particular block type.

from leapdna.blocks import Allele, Locus


l1 = Locus('L1')
a1 = Allele(name='a1', locus=l1)

leapdna aims to be extensible, so it allows you to specify your own attributes in any kind of block. If you wanted to mark a locus as a potential carrier of a diseas you could do

l1.user['carrier'] = True

Testing

To run the leapdna test suite execute

python3 -m unittest

from the root of the leapdna repository.

In addition, leapdna comes with type annotations which allows for running it through a type checker such as mypy. This can be done by executing mypy leapdna from the root of the repository. If you do not have mypy installed you may do so with python3 -m pip install mypy.

License

Copyright 2021 Elias Hernandis

Leapdna is free and open-source sofware released under the MIT License. Everyone is free to copy, modify and redistribute the sofware, even for commercial purposes. While no attribution is required, it is very much appreciated. The full text of the license is available here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leapdna-0.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

leapdna-0.1.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file leapdna-0.1.0.tar.gz.

File metadata

  • Download URL: leapdna-0.1.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for leapdna-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f9ac60d8747545a7aac361731aaedeafc2d5c3d90cac77612c9971f4c17a7b5b
MD5 89f7a80a268455f264ff7442b17f1270
BLAKE2b-256 2fa89ecd32414b0f50825ff259a0971b716df994a6aa6afaa36b0c7327b0d707

See more details on using hashes here.

File details

Details for the file leapdna-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: leapdna-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for leapdna-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d46792826897a42b39101b46a5f7c3559bc9042016e92e08632a5aba4d8ff876
MD5 3aacd9f4c0a66bb21105b6c4477cf0a9
BLAKE2b-256 e1eb58a44523c7ea53580df7eb7dd898bdef2d703b9cb7270338eb7fc92b78e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page