Skip to main content

AlternaTe Allele Read vIsualizer - A tool for analyzing genomic data from BAM files

Project description

🎮 Atari

AlternaTe Allele Read vIsualizer

Version License


Atari is a command-line tool to count reference and alternate alleles from BAM files across genomic regions and visualize allele depths.
It uses pysam for BAM parsing, matplotlib for plotting, and supports flexible input with BED files or manual region specification.


✨ Features

  • Count reference and alternate reads per position
  • Aggregate counts into non-overlapping windows
  • Apply quality filters (mapping, base quality, depth)
  • Output clean TSV tables
  • Generate high-quality plots
  • Annotate visualizations with genes from GTF files
  • Multi-sample comparisons
  • Detailed per-base alternate allele breakdown (A, C, G, T, DEL, INS, N)

📦 Installation

pip install atari

# GitHub Installation
pip install git+https://github.com/samarth8392/atari.git

Requirements:

  • Python ≥ 3.7
  • pysam
  • matplotlib
  • numpy
  • pandas
  • tqdm
  • rich

🚀 Quick Start

Ensure BAM and FASTA files are indexed (.bai, .fai).

1. Basic Usage

python atari.py \
  --bam sample1.bam sample2.bam \
  --reference genome.fa \
  --bed regions.bed \
  --window 100 \
  --output results.tsv

2. Full Pipeline with Visualization and Gene Annotation

python atari.py \
  --bam sample1.bam sample2.bam \
  --reference genome.fa \
  --bed regions.bed \
  --window 100 \
  --output results.tsv \
  --plot \
  --plot-output coverage_plot.png \
  --gtf annotations.gtf \
  --verbose

3. Analyze Specific Chromosomal Region

python atari.py \
  --bam sample.bam \
  --reference genome.fa \
  --chromosome chr20 \
  --start 1000000 \
  --end 1100000 \
  --window 100 \
  --output chr20_results.tsv \
  --plot \
  --plot-output chr20_coverage.png

4. Detailed Base-Level Counts

python atari.py \
  --bam sample.bam \
  --reference genome.fa \
  --bed regions.bed \
  --window 100 \
  --output detailed_results.tsv \
  --detailed \
  --verbose
Argument Description Required
--bam BAM file(s) (indexed)
--reference Reference FASTA (indexed)
--bed BED file with regions ➡️ (or --chromosome)
--chromosome Chromosome name (e.g., chr1) ➡️ (or --bed)
--start, --end Region coordinates (if using --chromosome)
--window Window size in bp for summarization
--output Output file name (TSV)
--plot Generate plot Optional
--plot-output Plot output file Optional
--gtf Gene annotations (GTF format) Optional
--verbose Verbose mode Optional
...and many more! (see --help)

🐛 Troubleshooting

  1. Ensure your BAM and FASTA files are indexed (.bai and .fai present).
  2. Use --verbose to print detailed processing steps.
  3. For debugging errors, set ATARI_DEBUG=1 environment variable.

👨‍💻 Contributing

PRs welcome! Feel free to open issues for bugs, feature requests, or improvements.

📫 Contact

For questions, contact samarth8392@gmail.com.

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

atari-0.1.4.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

atari-0.1.4-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file atari-0.1.4.tar.gz.

File metadata

  • Download URL: atari-0.1.4.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for atari-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2d236fc860bf9d9131e44947ab2f9cd2678d5c7efae34339edf476f35c78e0ce
MD5 a44253e9bd1388695105ee4ac561037d
BLAKE2b-256 947d278e120a6d657f37bd0a3f7e594b2b06a581e2399f393292364991d67f6b

See more details on using hashes here.

File details

Details for the file atari-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: atari-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for atari-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 358e56affbf27fd0be77538a2009b6a836831f4fb0ad1346183984714a419d93
MD5 740c787005933676584d2c73311fb777
BLAKE2b-256 6f870157ddc9e1c445aa433416a319cfdc49ed2f59ad11138d9f6285420d408f

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