Module: Minimap2
- Defined in:
- lib/minimap2.rb,
lib/minimap2.rb,
lib/minimap2/aligner.rb,
lib/minimap2/version.rb,
lib/minimap2/alignment.rb,
ext/ruby_minimap2/ruby_minimap2.c
Overview
Ruby bindings for the minimap2 sequence aligner.
Defined Under Namespace
Modules: Native Classes: Aligner, Alignment, Error
Constant Summary collapse
- VERSION =
. . . "1.2.31.0"
Class Method Summary collapse
-
.execute(*arguments) ⇒ Object
Run minimap2's command entry point.
-
.fastx_read(file_path, comment: false) ⇒ Object
Read records from a FASTA or FASTQ file.
- .revcomp(sequence) ⇒ Object
- .verbose ⇒ Object
- .verbose=(level) ⇒ Object
Class Method Details
.execute(*arguments) ⇒ Object
Run minimap2's command entry point. Each Ruby argument is one argv item.
25 26 27 |
# File 'lib/minimap2.rb', line 25 def execute(*arguments) Native.execute(*arguments) end |
.fastx_read(file_path, comment: false) ⇒ Object
Read records from a FASTA or FASTQ file.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/minimap2.rb', line 38 def fastx_read(file_path, comment: false) path = file_path.to_s == "-" ? "-" : File.(file_path) raise Error, "Cannot open FASTA/FASTQ file: #{path}" unless path == "-" || File.file?(path) reader = Native::FastxReader.new(path) if block_given? begin while (record = reader.next_record(comment)) yield record end ensure reader.close end else Enumerator.new do |yielder| while (record = reader.next_record(comment)) yielder << record end ensure reader.close end end end |