Skip to main content

👩‍🔬 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.

Metadata

Release files for leapdna 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leapdna 0.1.0
File Size Uploaded
leapdna-0.1.0.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for leapdna 0.1.0
File Interpreter ABI Platform
leapdna-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.7 kB

Release files / leapdna-0.1.0.tar.gz

Download URL leapdna-0.1.0.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f9ac60d8747545a7aac361731aaedeafc2d5c3d90cac77612c9971f4c17a7b5b
BLAKE2b-256 checksum
How to use checksums
2fa89ecd32414b0f50825ff259a0971b716df994a6aa6afaa36b0c7327b0d707
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / leapdna-0.1.0-py3-none-any.whl

Download URL leapdna-0.1.0-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d46792826897a42b39101b46a5f7c3559bc9042016e92e08632a5aba4d8ff876
BLAKE2b-256 checksum
How to use checksums
e1eb58a44523c7ea53580df7eb7dd898bdef2d703b9cb7270338eb7fc92b78e2
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page