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

git clone https://github.com/yourusername/atari.git
cd atari
pip install -r requirements.txt

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.1.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.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for atari-0.1.1.tar.gz
Algorithm Hash digest
SHA256 add337e76334d08d8c0bf116a80dced180476722187152fcc78ea0743c8a17e4
MD5 f21b80ad646586608f8d7eff3f1cb558
BLAKE2b-256 15120a8f6b58a364d934e78144885e9265ff7417599dc97b8ce6b635ffe7f9ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atari-0.1.1-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.13.3

File hashes

Hashes for atari-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 589ef0557c589eb68fc53dfc338ef3862c522d9c99ff43416b0d63fd992b9167
MD5 542b92262d581fcb9d4747946d623995
BLAKE2b-256 cb8a846f1ca05481a0395fe5358d73d5b12c298cd02289b2c267fbdbeee58e6e

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