How ritatalu/atacgraph works
Project Type and Purpose
• Type: A command-line bioinformatics pipeline (open-source tool), implemented in Python, wrapping standard genomics tools.
• Purpose: Automate end-to-end ATAC-Seq analysis in discrete modules (filtering, fragment stats, peak calling, differential analysis, plotting).
File Structure
• Top level
– script/ : all Python subcommands (00_rmChr.py, 01_calFragDist.py, …, extract_transcript_regions.py, GTF.py)
– Figures/ : output figures used in the README and final reports
– demo/, Tutorial.md, README.md, base.txt, LICENSE
• Pattern: Each numbered script corresponds to a pipeline stage (00 → 05).
• Config/deployment: base.txt installs tools; optional Docker image for Galaxy integration.
README for Insights
• Single entrypoint: “ATACgraph” CLI dispatches to subcommands.
• Dependencies: Python 2.7 for core, Python 3.5 for IDR, external tools (BEDtools, MACS2, deepTools, IDR).
• Data flow described in “ATACgraph modules” section.
Main Components and Interactions
a. Entrypoint
– “ATACgraph” wrapper script (argparse)
b. Module Scripts
– 00_rmChr → 01_calFragDist → 02_selectFragSize / 02_gtftoBed → 03_callPeak / 03_genePlot / 03_junctionBed → 04_specificPeaks / 04_specificPeaksIDR → 05_seqCompare / 05_compareToRNA
c. External Tools
– bedtools, MACS2, deepTools, idr command
d. Python Libraries
– numpy, pandas, matplotlib, pysam, pybedtools, scikit-learn, matplotlib-venn
e. Data Inputs/Outputs
– Inputs: BAM files, GTF files, peak BEDs, bigWig files, expression tables
– Outputs: filtered BAMs, BED tracks, bigWig coverage, figures (PDF/PNG), Venn/bar plots, matrix tables
f. Environment
– Local Linux/Mac OS or Docker/Galaxy container
Architectural Patterns and Design Principles
• Modular pipeline: each script follows single‐responsibility
• Data‐flow orchestration: file-based handoff between stages
• Wrapper pattern: Python code delegates heavy lifting to external tools
• Extensibility: add new numbered script in script/ and register subcommand