Skip to main content

Standalone footprint tools with vendored Cython internals

Project description

fp-tools

fp-tools is a Python package for ATAC-seq footprint analysis. It helps users turn ATAC-seq data into bias-corrected cut-site tracks, footprint scores, motif-centered comparisons, aggregate plots, and static HTML reports.

Documentation: https://oncologylab.github.io/fp-tools/

Install

pip install fp-tools-bio

Supported and tested platform: Linux x86_64 with Python 3.12. macOS source builds may work in compatible bioinformatics environments, but macOS wheels are not published yet. Windows is not currently supported.

To use the browser interface:

pip install "fp-tools-bio[gui]"
fp-tools-gui

The GUI opens in a browser and writes the same YAML configs that can be run from the command line.

What You Can Do

  • Correct ATAC-seq cut-site signal for Tn5 sequence bias.
  • Call footprint scores from corrected bigWig tracks.
  • Scan known motif databases, including bundled JASPAR 2026 and HOCOMOCO files.
  • Compare footprint scores across conditions or replicates.
  • Generate volcano-style differential footprint HTML reports.
  • Plot motif-centered aggregate footprints.
  • Group single-cell ATAC fragments into pseudobulk cell-type profiles.
  • Plot per-cell footprint-signature heatmaps and UMAP reports from single-cell fragments.

Typical Workflow

atac-correct -> call-footprints -> match-motifs or motif-discovery -> diff-footprints -> plot-aggregate

Use match-motifs to inspect motif sites and bound/unbound calls for one or more footprint tracks. Use motif-discovery when candidate footprint intervals should be searched for de novo motifs. For two or more conditions, use diff-footprints; it can scan the same motif database, compare conditions, and write an interactive HTML report.

Minimal Example

Create a simple sample table:

sample	condition	bam	peaks
A	conditionA	A.bam	A_peaks.bed
B	conditionB	B.bam	B_peaks.bed

For condition comparisons, create a comparison table:

comparison	cond1	cond2
conditionA_vs_conditionB	conditionA	conditionB
atac-correct \
  --sample-table project/metadata/samples.tsv \
  --genome hg38.fa.gz \
  --blacklist hg38.blacklist.bed \
  --outdir project

normalize-bigwig \
  --sample-table project/metadata/samples.tsv \
  --background project/peaks/merged_peaks.analysis.bed \
  --outdir project \
  --method background-scale \
  --stat q95 \
  --target median

call-footprints \
  --sample-table project/metadata/samples.tsv \
  --regions project/peaks/merged_peaks.analysis.bed \
  --outdir project

match-motifs \
  --sample-table project/metadata/samples.tsv \
  --genome hg38.fa.gz \
  --peaks project/peaks/merged_peaks.analysis.bed \
  --motif-db jaspar2026_vertebrates \
  --outdir project

diff-footprints \
  --sample-table project/metadata/samples.tsv \
  --comparison-table project/metadata/comparisons.tsv \
  --genome hg38.fa.gz \
  --peaks project/peaks/merged_peaks.analysis.bed \
  --motif-db jaspar2026_vertebrates \
  --outdir project

With a sample table and --outdir project, fp-tools uses the recommended project layout by default: merged peaks in project/peaks, per-sample outputs in project/samples/<sample>/, differential reports in project/comparisons, and review pages in project/reports. Custom paths remain available with --layout custom.

After match-motifs, project-mode diff-footprints reuses each sample folder's cached motif-site tables and background scores instead of rescanning motifs or rereading footprint bigWigs. Repeated samples with the same condition are treated as biological replicates.

Pseudobulk Workflow

For single-cell ATAC data, start with pseudobulk-fragments to group fragments by cell annotation. Then run the standard footprint workflow on the grouped pseudobulk samples. After motif-aware comparisons are available, use find-signature-fp to write marker footprint-signature heatmaps and UMAP reports. pseudobulk-footprints is the convenience wrapper that can run grouping, correction, scoring, motif reports, aggregate plots, and optional signature reporting in one command.

pseudobulk-footprints \
  --fragments pbmc_fragments.tsv.gz \
  --annotations cell_annotations.tsv \
  --group-by cell_type \
  --genome-sizes hg38.chrom.sizes \
  --genome hg38.fa.gz \
  --peaks merged_peaks.bed \
  --motif-db jaspar2026_vertebrates \
  --tf-site-dir marker_motif_sites \
  --single-cell-signature-h5ad pbmc_embedding.h5ad \
  --outdir project/pseudobulk

To run the signature report as a standalone step:

find-signature-fp \
  --annotations cell_annotations.tsv \
  --fragments pbmc_fragments.tsv.gz \
  --h5ad pbmc_embedding.h5ad \
  --tf-site-dir marker_motif_sites \
  --all-motif-results project/pseudobulk/pseudobulk_diff_footprints_results.txt \
  --all-motif-diff-dir project/pseudobulk/diff_footprints \
  --outdir project/pseudobulk/signature_fp

Key outputs include pseudobulk fragments, pseudo-BAMs, corrected bigWigs, footprint-score bigWigs, differential footprint reports, aggregate plots, and single-cell footprint-signature heatmaps/UMAPs.

De Novo Motif Workflow

Use candidate footprints from call-footprints --call-candidates in project mode, or --output-bed/--output-beds in custom mode, to prepare de novo motif discovery. This route writes a reproducible MEME/STREME/DREME script and can compare discovered motifs to a built-in motif database.

motif-discovery \
  --candidates project/samples/sample/footprints/sample_candidate_footprints.bed \
  --genome hg38.fa.gz \
  --flank 75 \
  --method streme \
  --known-motif-db jaspar2026_vertebrates \
  --outdir project/de_novo/sample

Use discovered motifs alone for a de novo-only run, or add them to a standard database run:

diff-footprints \
  --signals conditionA_footprints.bw conditionB_footprints.bw \
  --sample-names conditionA conditionB \
  --genome hg38.fa.gz \
  --peaks merged_peaks.bed \
  --cond-names conditionA conditionB \
  --motif-db jaspar2026_vertebrates \
  --motifs project/de_novo/sample/streme/streme.txt \
  --outdir project/comparisons/database_plus_de_novo

Main Commands

Command Use
atac-correct Bias-correct ATAC-seq cut-site signal.
call-footprints Create footprint score tracks from one or more bigWigs.
match-motifs Scan motifs for one or more footprint tracks.
diff-footprints Compare motif footprints across conditions.
normalize-bigwig Scale bigWigs before aggregate plotting.
plot-aggregate Make aggregate footprint plots as PDF/SVG-style output or HTML.
review-multi-comparisons Review multiple differential-footprint HTML reports in one page.
motif-discovery Prepare candidate-centered de novo motif discovery.
motif-summary Summarize motif discovery outputs.
pseudobulk-fragments Group single-cell fragments by annotation.
find-signature-fp Plot per-cell footprint-signature heatmaps and UMAP reports.
pseudobulk-footprints Run the full pseudobulk footprint workflow, including optional signature reporting.
run-workflow Run a saved YAML config.
fp-tools-gui Open the optional browser GUI.
fp-tools-score-variants Optional variant-annotation utility; not part of the standard footprint workflow.

Check any command with --help:

atac-correct --help
call-footprints --help
match-motifs --help
diff-footprints --help
normalize-bigwig --help
plot-aggregate --help
review-multi-comparisons --help
run-workflow --help
fp-tools-gui --help
motif-discovery --help
motif-summary --help
fp-tools-score-variants --help
pseudobulk-fragments --help
find-signature-fp --help
pseudobulk-footprints --help

GUI

fp-tools-gui --host 0.0.0.0 --port 8891

Open the printed URL in a browser. If running on a server or cloud VM, make sure the selected port is allowed by the firewall or security group.

More Examples

Example YAML configs are in examples/gui_configs/. They can be loaded in the GUI or run directly with run-workflow:

run-workflow --config examples/gui_configs/call_footprints_single.yml

Static report demos and GUI screenshots are available in the documentation site.

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

fp_tools_bio-0.1.11.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

fp_tools_bio-0.1.11-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.5+ x86-64

File details

Details for the file fp_tools_bio-0.1.11.tar.gz.

File metadata

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

File hashes

Hashes for fp_tools_bio-0.1.11.tar.gz
Algorithm Hash digest
SHA256 20d839326714decd1dee00ee2bcd4cf99998c5377630d1bcbdeb29a91b57b4d5
MD5 b0e0f3ec0e09f2d07e5a4ee822297ad0
BLAKE2b-256 62eb164a49af72b6ccb1b02352c36a51a2e19b583d845bcd5d29fb0bbfed534e

See more details on using hashes here.

File details

Details for the file fp_tools_bio-0.1.11-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for fp_tools_bio-0.1.11-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a44b9a2cf734efaec70768dd0acd68f42ad5002bfa2cc79100fb91765a89d1e8
MD5 96558f9e03251178492812c8379ec0da
BLAKE2b-256 36064091309f54f8ede116900df0f6b47fb161d30d2ac7b45d582af49bd817b3

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