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

Uploaded Python 3

File details

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

File metadata

  • Download URL: atari-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5af9550c15cd735b74e38fd39b9c6d668eeabd749622626fd0506e949edaa63a
MD5 74a7b3d99499fc92bb4000d2310bebc0
BLAKE2b-256 cf22b14bd958cc63bae934ea15a688745158157e44933e0bf2b949a7070bdab5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atari-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f56dfb3e2228ed9c8f6183b6f25fda46efdbbfa6c068e161575c9f62881ee03
MD5 34db89bf4f23de0250f10120da65cdb9
BLAKE2b-256 fcfcf2f3fc44a677f9d04af9f7db427e18106b47a7a489690c23f4e230828835

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