Module: Minigraph
- Defined in:
- lib/minigraph.rb,
lib/minigraph/ffi.rb,
lib/minigraph/version.rb,
lib/minigraph/ffi/mappy.rb,
lib/minigraph/ffi/constants.rb,
lib/minigraph/ffi/functions.rb
Overview
Minigraph github.com/lh3/minigraph Li, H., Feng, X. & Chu, C. The design and construction of reference pangenome graphs with minigraph. Genome Biol 21, 265 (2020). doi.org/10.1186
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.0.20.1"
Class Attribute Summary collapse
-
.ffi_lib ⇒ Object
Returns the value of attribute ffi_lib.
Class Method Summary collapse
-
.execute(arg0, arg1, ...) ⇒ Object
Execute minigraph comannd with given options.
-
.verbose ⇒ Integer
Get verbosity level.
-
.verbose=(level) ⇒ Integer
Set verbosity level.
Class Attribute Details
.ffi_lib ⇒ Object
Returns the value of attribute ffi_lib.
18 19 20 |
# File 'lib/minigraph.rb', line 18 def ffi_lib @ffi_lib end |
Class Method Details
.execute(arg0, arg1, ...) ⇒ Object
Execute minigraph comannd with given options.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/minigraph.rb', line 38 def execute(*rb_argv) str_ptrs = [] # First argument is the program name. str_ptrs << ::FFI::MemoryPointer.from_string("minigraph") rb_argv.each do |arg| arg.to_s.split(/\s+/).each do |s| str_ptrs << ::FFI::MemoryPointer.from_string(s) end end str_ptrs << nil # Load all the pointers into a native memory block argv = ::FFI::MemoryPointer.new(:pointer, str_ptrs.length) str_ptrs.each_with_index do |p, i| argv[i].put_pointer(0, p) end FFI.main(str_ptrs.length - 1, argv) end |
.verbose ⇒ Integer
Get verbosity level.
61 62 63 |
# File 'lib/minigraph.rb', line 61 def verbose FFI.mg_verbose_level(-1) end |
.verbose=(level) ⇒ Integer
Set verbosity level.
69 70 71 |
# File 'lib/minigraph.rb', line 69 def verbose=(level) FFI.mg_verbose_level(level) end |