Module: Minimap2
- Defined in:
- lib/minimap2.rb,
lib/minimap2/ffi.rb,
lib/minimap2/aligner.rb,
lib/minimap2/version.rb,
lib/minimap2/alignment.rb,
lib/minimap2/ffi/mappy.rb,
lib/minimap2/ffi/constants.rb,
lib/minimap2/ffi/functions.rb
Overview
Defined Under Namespace
Modules: FFI Classes: Aligner, Alignment, Error
Constant Summary collapse
- VERSION =
"0.0.1"
Class Attribute Summary collapse
-
.ffi_lib ⇒ Object
Returns the value of attribute ffi_lib.
Class Method Summary collapse
-
.fastx_read(file_path, read_comment = false) {|name, seq, qual, comment| ... } ⇒ Object
read fasta/fastq file Note: You can also use a generic library such as BioRuby instead of this method.
-
.revcomp(seq) ⇒ string
reverse complement sequence.
-
.verbose(level = -1)) ⇒ Object
set verbosity level.
Class Attribute Details
.ffi_lib ⇒ Object
Returns the value of attribute ffi_lib.
22 23 24 |
# File 'lib/minimap2.rb', line 22 def ffi_lib @ffi_lib end |
Class Method Details
.fastx_read(file_path, read_comment = false) {|name, seq, qual, comment| ... } ⇒ Object
read fasta/fastq file Note: You can also use a generic library such as BioRuby instead of this method.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/minimap2.rb', line 43 def fastx_read(file_path, read_comment = false) path = File.(file_path) ks = FFI.mm_fastx_open(path) while FFI.kseq_read(ks) >= 0 qual = ks[:qual][:s] if (ks[:qual][:l]).positive? name = ks[:name][:s] seq = ks[:seq][:s] if read_comment comment = ks[:comment][:s] if (ks[:comment][:l]).positive? yield [name, seq, qual, comment] else yield [name, seq, qual] end end FFI.mm_fastx_close(ks) end |
.revcomp(seq) ⇒ string
reverse complement sequence
64 65 66 67 68 69 |
# File 'lib/minimap2.rb', line 64 def revcomp(seq) l = seq.size bseq = ::FFI::MemoryPointer.new(:char, l) bseq.put_bytes(0, seq) FFI.mappy_revcomp(l, bseq) end |
.verbose(level = -1)) ⇒ Object
set verbosity level
74 75 76 |
# File 'lib/minimap2.rb', line 74 def verbose(level = -1) FFI.mm_verbose_level(level) end |