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.3.tar.gz (18.0 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.3-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atari-0.1.3.tar.gz
  • Upload date:
  • Size: 18.0 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.3.tar.gz
Algorithm Hash digest
SHA256 08a6e352d9cdafbef6938e4acf811aac9358e53a8ca18c321a400b51518ebc3a
MD5 af9b17e264277300ca5b3c11ffde3c37
BLAKE2b-256 c1abbecb3c4d9ba95fd15facece642e7461e21c22e76c08b9a7d66c971896fde

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atari-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 18.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cff5381de4acf9b0e6470d0d1b7f9161e517490de655ce698adaad8c8f59a775
MD5 89b283e4ced11b9817ebaf81cc77e4be
BLAKE2b-256 d4a4f9e9e38c555ac9049b19fe4fc129eaaddea6b98e9bd70eb1e37fc832ebef

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