r/elixir • u/Shoddy_One4465 • 17h ago
BAM 0.1.0 — streaming SAM and BAM for Elixir
I just released bam 0.1.0, a library for reading and writing SAM and BAM alignment files.
It streams records, reads a genomic interval through a BAI or CSI index, and writes BAM plus an index. Compression goes through OTP :zlib. There is no NIF. Elixir ~> 1.18, no runtime dependencies.
{:bam, "~> 0.1.0"}
{:ok, handle} = BAM.open("sample.bam")
{:ok, reads} = BAM.read(handle, "chr1:1-1000")
This is a first release. It uses samtools 1.25 for synthetic fixtures. It is not a claim of full SAMv1 conformance. CRAM is not implemented.
- https://hex.pm/packages/bam
- https://hexdocs.pm/bam
- https://github.com/baoulo/bam-elixir