Skip to main content

pyfraglib

pyfraglib Logo

Overview

pyfraglib is a Python library to analyze high-throughput sequencing data of cell-free DNA (cfDNA). More specifically, it facilitates the investigation of fragmentomics features of which a list can be found below.

Because fragmentation of cfDNA is non-random, tissue- and disease-specific patterns emerge in e.g. fragment length or end motif distributions. To date, no comprehensive tool exists to implement a "fragmentomics workflow". pyfraglib aims at being such at tool.

Installation

It is recommended that pyfraglib is installed into a dedicated conda environment using pip, the Python package manager:

git clone https://github.com/schwarzlab-ccb/pyfraglib.git
cd pyfraglib
conda env create -f pyfraglib.yml
conda activate pyfraglib
python3 -m pip install .

During development, all code in pyfraglib is thoroughly type-checked using mypy. After an initial installation as described above, do:

./tools/dev_install.sh # typing & linting errors are reported

Alternatively, pyfraglib is available via PyPI, the Python package index:

pip install pyfraglib

The only non-Python dependency samtools/htslib is usually bundled with pysam and in those cases, no separate installation of it is required.

Usage

pyfraglib comes with a command line utility. After successful installation, it can be used as follows:

pyfrag.py version # show currently installed version
pyfrag.py --help # show available subcommands and flags

tools/workflow.sh gives an example of a commonly used sequence of commands.

Pipeline

pyfraglib offers a simple batch mode for most operations, i.e. it can take a directory of BAM or FRAG files and perform analyses on them. Some operations (i.e. the extract subcommand) are even parallelized. We explicitly do not recommend using this functionality for the analysis of large cohorts. Even 10 BAM files cannot be extracted at once without exceeding most workstation's memory. Thus, we include a convenient Nextflow pipeline in tools/pipeline.nf. It reads the input data from a TSV file and Nextflow parallelizes pyfraglibs operations as much as possible. See tools/example.config for all paths and variables that must be set by the user. Currently, only slurm is supported as a scheduler.

Available fragmentomics features

Please refer to the project's documentation for a list of currently supported features (see below for instructions on how to build documentation using Sphinx).

Documentation

Documentation for the latest stable build is hosted at ReadTheDocs.

In general, Sphinx is used to create documentation. The easiest way to create repository-wide documentation in HTML or PDF format manually is to run:

./tools/build_docs.sh pdf # or:
./tools/build_docs.sh html

Citation

Please cite our bioRxiv preprint if you use pyfraglib in your work.

License

pyfraglib is licensed under the GPL-v3 as indicated in the source files. Please direct requests to daniel.schuette@iccb-cologne.org.

Metadata

Release files for pyfraglib 0.6.5

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

Source distribution (sdist)

Source distribution for pyfraglib 0.6.5
File Size Uploaded Provenance Actions
pyfraglib-0.6.5.tar.gz 2.1 MB Without provenance Details for pyfraglib-0.6.5.tar.gz

Built distribution (wheel)

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

Total release size: 2.3 MB

Release files / pyfraglib-0.6.5.tar.gz

Download URL pyfraglib-0.6.5.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
346d4b158075246c4f37f8c6ccd5e970018cc97b60d08127f1ad2615d7d48a3d
BLAKE2b-256 checksum
How to use checksums
19613061ad9beb16539348a621efc292facc74d29496d71b1382d667f8b1ec76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pyfraglib-0.6.5-py3-none-any.whl

Download URL pyfraglib-0.6.5-py3-none-any.whl
Size 168.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6653b47422bc35c12f818e517c74778d9bb0ca45d10ef79fb31448ae3009bf8b
BLAKE2b-256 checksum
How to use checksums
b1f5715b64fd7f192e90ea9909a1b17f627ff39769169832320204e2d7571970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for pyfraglib 0.6.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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