minimap2-cr

minimap2-cr

CI Lines of Code

Crystal bindings for minimap2 (long-read mapper).

This shard downloads/builds minimap2 during install (see shard.yml postinstall).

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      minimap2:
        github: kojix2/minimap2-cr
    
  2. Run shards install

System requirements (Linux)

Building minimap2 requires a C toolchain and zlib headers.

sudo apt-get update
sudo apt-get install -y build-essential curl bzip2 zlib1g-dev

Usage

new (shortcut)

new accepts keyword options for common settings.

require "minimap2"

aligner = Minimap2::Aligner.new("reference.fasta", preset: "map-ont", cigar: true, threads: 4)
hits = aligner.map("ACGTACGTACGT")
puts hits.size

new with block

new applies keyword options first, then yields the builder for extra configuration.

require "minimap2"

aligner = Minimap2::Aligner.new("reference.fasta") do |b|
  b.map_ont
  b.with_cigar
  b.with_index_threads(4)
end

Utilities

require "minimap2"

puts Minimap2.revcomp("ACGTN")

Development

  • Build vendored minimap2: shards install (runs ext/build.cr via postinstall)
  • Run tests: crystal spec

If you see runtime linker errors, try:

export LD_LIBRARY_PATH="$PWD/ext"
Repository

minimap2-cr

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • 6 days ago
  • February 11, 2026
License

MIT License

Links
Synced at

Thu, 12 Feb 2026 03:20:38 GMT

Languages