read_until.cr

Read Until sessions, signal buffers, classification filters and action tracking for Crystal. Uses minknow.cr for connectivity.

Installation

Requires Crystal >= 1.20 and libnghttp2. Add to shard.yml, then run shards install:

dependencies:
  read_until:
    github: kojix2/read_until

Stream reads

require "read_until"

manager = Minknow::Manager.new
begin
  position = manager.fetch_flow_cell_positions.first? || raise "No sequencing position"
  connection = manager.connect(position)
  client = ReadUntil::Client.new(connection)
  client.open(channels: 1..128,
    raw_data: ReadUntil::RawDataKind::Uncalibrated,
    mode: ReadUntil::StreamMode::OneChunk) do |session|
    session.each_read(batch_size: 16) do |read|
      puts "#{read.channel}: #{read.signal(Int16).size} samples"
    end
  end
ensure
  connection.try &.channel.close
  manager.channel.close
end

Uncalibrated supplies raw ADC values; the default Calibrated mode uses signal(Float32) with the usual device formats. OneChunk returns the first chunk per read; use MultiChunk for subsequent chunks. session.unblock(read, for: 100.milliseconds) ejects a molecule; session.stop(read) stops further signal delivery while sequencing continues. Client#open closes the session when its block exits.

See MinKNOW authentication for TLS, CA and token configuration.

Development

crystal spec
crystal run examples/basic.cr

basic.cr demonstrates a synthetic buffer without starting a live stream.

License: MPL-2.0, including derived Oxford Nanopore Read Until code.

Repository

read_until

Owner
Statistic
  • 0
  • 0
  • 1
  • 1
  • 1
  • 9 days ago
  • April 19, 2026
License

Other

Links
Synced at

Sun, 01 Nov 2026 08:36:25 GMT

Languages