read_until.cr

Test Lines of Code

🕳️⚡ Oxford Nanopore Read Until - for Crystal

Installation

Add the dependency to your shard.yml:

dependencies:
  read_until:
    github: kojix2/read_until

Run shards install

Usage

require "read_until"

Run example:

crystal run examples/basic.cr

Minimal streaming shape:

client = ReadUntil::Client.new(connection)

client.open(
  channels: 1..512,
  mode: ReadUntil::StreamMode::OneChunk,
  prefilter: ReadUntil::Prefilter.strand_like(:strand, :adapter),
) do |session|
  session.each_read(batch_size: 16) do |read|
    signal = read.signal(Int16)
    if reject?(signal)
      session.unblock(read, for: 100.milliseconds)
    end
  end
end

Development

License

This project is distributed under the Mozilla Public License 2.0 (MPL-2.0).

It includes a Crystal port of Oxford Nanopore's Python read_until_api and inherits the upstream license requirements for derived source files.