Skip to main content

Software suite to calculate fragmentomics features from cfDNA and perform downstream analyses.

Project description

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 git@bitbucket.org:schwarzlab/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/nextflow.config for all paths and variables that must be set by the user. Currently, only slurm is supported as a scheduler (via the ramses profile).

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

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

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

Citation

Please cite our bioRxiv preprint (DOI XXX) 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.

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

pyfraglib-0.6.3.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfraglib-0.6.3-py3-none-any.whl (167.1 kB view details)

Uploaded Python 3

File details

Details for the file pyfraglib-0.6.3.tar.gz.

File metadata

  • Download URL: pyfraglib-0.6.3.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyfraglib-0.6.3.tar.gz
Algorithm Hash digest
SHA256 8929768b392f955feed03d88a4cc9cb252ba1c8d0978d8cc7b9c27ed9eab3939
MD5 3132cfc56d6098e022fbef725b6f64c4
BLAKE2b-256 b656593a9f93822b39221cf823e093d67adedb86b589f7f2600b65e4f20acdef

See more details on using hashes here.

File details

Details for the file pyfraglib-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: pyfraglib-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 167.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyfraglib-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 84ded3966fcfdbd4aa1fdc21bdee08bf545d75a2fa2bf9ba36e31129881fe6c0
MD5 03f9c5ab76e47684e1057aaf8d9876c9
BLAKE2b-256 deb2bc6c1e66e30b60510a556b9b4dc00a7fb107987f9cb23f2b74ed0263f3a7

See more details on using hashes here.

Supported by

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