PyFuse (Python Fusion Annotator) is a command-line tool for annotating gene fusion breakpoints with exon context, frame status, optional sequence context, and report outputs (Excel, HTML, VCF).
Detailed documentation available at PyFuse-Documentation.
pyfuse resources install --genome grch37
pyfuse annotator -i /path/to/fusions.tsv -o /path/to/output -f star -g grch37We recommend using a virtual environment to avoid dependency conflicts:
python -m venv .venv
source .venv/bin/activate
pip install --upgrade git+https://github.com/gopisiva1616/PyFuse.gitNote: PyPI and Conda packages are not yet available. The commands below will be updated when the packages are published.
pip install pyfuseconda install -c conda-forge pyfuse- Python >=3.10.0
bedtoolsavailable on PATH (required bypybedtoolsworkflows)
pyfuse -hTop-level modes:
annotator: run complete fusion annotationresources: build/install and manage resource bundles
pyfuse annotator \
-i /path/to/breakpoints.tsv \
-o /path/to/output_dir \
-f star \
-g grch38Common options:
-i, --fusion-breakpoints: input breakpoint file (required)-o: output directory (required)-f, --input-format: one of input caller formatdefault,star,arriba,tophat,fusion_catcher,longgf,fusion_inspector(required)-g, --genome: one ofgrch37,grch38(default:grch37)--resource-path: exact resource bundle directory to use for this run; default chooses from inbuilt resource bundle directory-t, --target-bed: BED file used for filtering-r, --reference: FASTA file for fusion sequence annotation-s, --settings: optional custom settings YAML-d: enable debug logs
Notes:
- For normal usage, install bundles with
pyfuse resources installand runpyfuse annotatorwithout resource flags. - Use
--resource-pathonly when you want to pin an exact bundle directory for a run. - Advanced managed-root control is via
PYFUSE_RESOURCE_ROOTenv var orresource_rootin settings.
annotator mode requires a resource bundle per genome (grch37 or grch38).
Use resources mode to install, list, verify, and inspect these bundles.
- First install is a one-time setup per genome.
- Re-running install creates a new version after confirmation.
- If multiple versions exist,
annotatoruses the latest installed version by default. - You can pin an exact bundle for a run with
--resource-pathin annotator mode and--resource-rootin resources mode.
Basic resource commands:
pyfuse resources list
pyfuse resources install --genome grch38
pyfuse resources verify --genome grch38
pyfuse resources path --genome grch37Help menus:
pyfuse resources -h
pyfuse resources install -hinstall subcommand has additional options:
pyfuse resources install \
--genome {grch37,grch38} \
[--source {refseq-gtf,ucsc-gtf}] \
[--gtf <local_path_or_url>] \
[--annot-summary <local_path_or_url>] \
[--mane-file <local_path_or_url>] \
[--cache-dir <path>] \
[--resource-root <path>]What each install option does:
--genome: required target genome for bundle creation.--source: source mode used during bootstrap (refseq-gtfdefault).--gtf: override default GTF with local file or URL.--annot-summary: override default assembly summary with local file or URL.--mane-file/--mane-url: optional MANE input override (file or URL).--cache-dir: temporary/cache location for bootstrap/download assets.--resource-root: persistent managed resource root.
If default source URLs become unavailable, override them directly during install:
# Override with custom URLs
pyfuse resources install --genome grch38 \
--gtf https://example.org/custom_grch38.gtf.gz \
--annot-summary https://example.org/custom_grch38_assembly_report.txt \
--mane-file https://ftp.ncbi.nlm.nih.gov/refseq/MANE/MANE_human/current/
# Or use local files (no download for these inputs)
pyfuse resources install --genome grch37 \
--gtf /data/ref/GRCh37_latest_genomic.gtf.gz \
--annot-summary /data/ref/GRCh37_latest_assembly_report.txtNotes:
installis the primary setup command. It builds and installs a local bundle using defaults from settings or user-provided URLs/files.annotatoruses--resource-pathif provided; otherwise it uses installed bundles under managed resource storage.- Packaged default resource fallback is disabled. If a bundle is missing, run
pyfuse resources install --genome <grch37|grch38>. - Managed resource root precedence is:
--resource-root>PYFUSE_RESOURCE_ROOTenv var >resource_rootin settings file > platform default data dir. - Temporary build/download staging uses cache storage (
--cache-dir), while installed resources are kept in persistent resource storage.
For each run, PyFuse writes a timestamped output folder containing:
pyfuse_output.xlsxpyfuse_fusion_annotation.htmlpyfuse_output.vcfpyfuse_fusion_summary.txtexcluded_breakpoints.txtpyfuse_<timestamp>.log
- PyFuse code: GNU GPLv3 (see
LICENSE.md) - Bundled third-party web/font assets: see
THIRD_PARTY_NOTICES.md - Resource provenance and use restrictions depend on upstream data providers
Attribution request:
- PyFuse is open source under GPLv3 copyleft.
- If PyFuse contributes to your analysis, manuscript, report, presentation, or derivative tool, please credit the project and acknowledge the contributing author/institution .
- Citation is strongly encouraged for academic and scientific use.
Run tests with HTML report generation:
pyfuse-testIntegration tests accept runtime environment variables:
INPUT_BKPT,TRUTH_OUTPUT,INPUT_FORMAT,REFERENCE_GENOME,OUTPUT_PATHCACHE_DIR,RESOURCE_PATH,GENOME,FUSION2VCF,perl
Example:
INPUT_FORMAT=star REFERENCE_GENOME=/data/ref/genome.fa pyfuse-test -m integrationIf pyfuse-test is not found, reinstall in your active environment:
pip install -e .[dev]Fallback invocation:
python -m pyfuse.test_cli -m integrationIf PyFuse contributes to your analysis or publication, please cite it.
Use machine-readable citation metadata in CITATION.cff.
Repository URL: https://github.com/gopisiva1616/PyFuse.git
- Prefer default NCBI RefSeq-based resource generation for a conservative compliance posture.
- Treat optional external datasets (for example COSMIC/GTEx or custom UCSC-derived inputs) as user-managed licensing responsibility.
- Keep provenance records (source URL, date, checksum) for generated resource files.
For practical release guidance and checklists, see docs/publishing-and-compliance.md.
For bundled asset licenses/notices, see THIRD_PARTY_NOTICES.md.
