From ecb7aa4876788481193b86f31c42d7f86f230bc0 Mon Sep 17 00:00:00 2001 From: Hiroyuki Mishima <51609+misshie@users.noreply.github.com> Date: Fri, 9 May 2025 13:47:22 +0900 Subject: [PATCH] Make 2nd arguments of IGV#color_by and IGV#group optional (default=nil) --- lib/igv.rb | 4 ++-- test/igv_test.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/igv.rb b/lib/igv.rb index 29efd62..a6e26ae 100644 --- a/lib/igv.rb +++ b/lib/igv.rb @@ -559,7 +559,7 @@ def max_panel_height(height) # @example # igv.color_by("SAMPLE") # igv.color_by("TAG", "NM") - def color_by(option, tag) + def color_by(option, tag = nil) send :colorBy, option, tag end @@ -572,7 +572,7 @@ def color_by(option, tag) # @example # igv.group("SAMPLE") # igv.group("TAG", "NM") - def group(option, tag) + def group(option, tag = nil) send :group, option, tag end diff --git a/test/igv_test.rb b/test/igv_test.rb index d9c9562..90ec267 100644 --- a/test/igv_test.rb +++ b/test/igv_test.rb @@ -26,6 +26,10 @@ def test_igv assert_equal 'OK', @igv.goto('chr2') assert_equal 'OK', @igv.snapshot('test.png') assert_true File.exist?(File.expand_path('fixtures/test.png', __dir__)) + assert_equal 'OK', @igv.color_by('READ_STRAND', nil) + assert_equal 'OK', @igv.color_by('READ_STRAND') + assert_equal 'OK', @igv.group('NONE', nil) + assert_equal 'OK', @igv.group('NONE') end def teardown