How wjidea/defusion works
Project type and purpose
• This is an open-source, Python-based CLI pipeline (“deFusion”) whose sole purpose is to untangle fused gene predictions produced by the MAKER genome annotation suite.
• It orchestrates a linear set of steps (detect fused genes, extract them, prepare FASTA, re-run MAKER, generate a report) by invoking internal modules and the external MAKER tool.
File structure
• Top-level modules:
• defusion/1_detect_fused_gene.py through 5_generate_report.py – each implements one pipeline stage
• defusion/utility_functions.py & sync_gff_fasta.py – reusable routines and GFF/FASTA synchronization logic
• setup.py & requirements.txt – packaging and dependency declaration
• docs/ – Sphinx documentation (installation, file formats, tutorial)
• tests/ – unit tests covering basic and advanced cases
• Build/deployment artifacts: Makefile (to run the pipeline or build docs), LICENSE, demo_file.tgz
Pull architecture hints from README
• It calls out an external dependency: MAKER.
a. Main components
1. Input Data Layer
– Raw annotation files (.gff, .fasta)
2. Pipeline Modules (core library + CLI scripts)
– DetectFusedGenes
– ExtractToMaker
– ProcessFasta
– RunMakerStandard
– GenerateReport
– UtilityFunctions & GffFastaSync (shared code)
3. External Tool
– MAKER (invoked by RunMakerStandard)
4. Output Data Layer
– Final annotation GFF, FASTA, HTML/CSV report
5. Supporting Components
– Tests suite (unit tests)
– Documentation (Sphinx)
b. Relationships and data flow
[Input Files] → 1_detect_fused_gene → 2_extract_to_maker → 3_process_fasta → 4_run_maker_standard → 5_generate_report → [Final Output Files]
c. Architectural patterns & design principles
• Pipeline pattern: each script = one stage, clear hand-off by files
• Modularization: reusable utilities factored out
• CLI-driven: each module exposes a command-line interface
• File-based integration: no database layer, pure file I/O
d. Key technologies & libraries
• Language: Python
• Packaging: setuptools (setup.py), requirements.txt
• External tool: MAKER
• Testing: pytest/unittest (tests/test_*.py)
• Documentation: Sphinx (docs/)
Final pointers
• Be very detailed: capture each script as its own component, don’t lump everything into “backend.”
• Keep it simple and linear—this is a pure pipeline, not a microservice mesh.