ruby-igv 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/lib/igv.rb +14 -9
  4. data/lib/igv/version.rb +3 -1
  5. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8915f9a26a6b4b4bbe15dc5dd35d156ca9c84a5b2737c4b81ffa1441b5049e2d
4
- data.tar.gz: 44980727b24b348a3167566179e9a75755cda0023761624de1fb72fdfe3701cd
3
+ metadata.gz: a162dd0aa5d26fd45b3da87eb9c8e4faec6bc47f6922dc850dc5f5f556405c26
4
+ data.tar.gz: 6ceb747c0f8b5b697f561c2836c8e021d29fd2bcc0cc5bc91cc7916bc24b0c61
5
5
  SHA512:
6
- metadata.gz: 232bc8a829604e65fb67e7b39aa0480e3c0165e1291022c1162469ed5d126caefe0881b124e70fb4c386a51937e1530d812fb5ec459d8067fa9264e78b368202
7
- data.tar.gz: c57afdcf2dcbf5d9829fd3815e4fdc91148a1757906027f663690598438ec3e284b54ff75b07f8ab8c699be93b7674192b78821953cc0846cc333a48bc4572f8
6
+ metadata.gz: 0e05cd137522d371629790616283c5f2c31f96f9882979d64f46ab83530ccf14569bc039213ddda103653ad009d9818e50f1e95e5f3738cb985903da6d8c6ed2
7
+ data.tar.gz: 361d5f9e770f4f78304e4b99672e6e5e2c116bd8994b5d57076b808b40b27ae5fa493c74842923d4165adef2b79827ae85e5d711d9ce279f001afddb0676df95
data/README.md CHANGED
@@ -4,9 +4,7 @@
4
4
  [![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://rubydoc.info/gems/ruby-igv)
5
5
  [![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg)](LICENSE.txt)
6
6
 
7
- Using [Integrative Genomics Viewer (IGV)](http://software.broadinstitute.org/software/igv/) with the Ruby language.
8
-
9
- Based on [brentp/bio-playground/igv](https://github.com/brentp/bio-playground).
7
+ Controlling [Integrative Genomics Viewer (IGV)](http://software.broadinstitute.org/software/igv/) with the [Ruby](https://github.com/ruby/ruby) language.
10
8
 
11
9
  ## Installation
12
10
 
@@ -37,6 +35,10 @@ igv.send 'echo' # whatever you want
37
35
  * Write, clarify, or fix documentation
38
36
  * Suggest or add new features
39
37
 
38
+ # Acknowledgement
39
+ This gem is strongly inspired by a Python script developed by Brent Pedersen.
40
+ * [brentp/bio-playground/igv](https://github.com/brentp/bio-playground).
41
+
40
42
  ## License
41
43
 
42
44
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/lib/igv.rb CHANGED
@@ -1,11 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'igv/version'
2
4
  require 'socket'
3
5
  require 'fileutils'
4
6
 
7
+ # The Integrative Genomics Viewer (IGV)
8
+ # https://software.broadinstitute.org/software/igv/
5
9
  class IGV
6
10
  class Error < StandardError; end
7
11
 
8
12
  attr_reader :host, :port, :snapshot_dir, :history
13
+
9
14
  def initialize(host: '127.0.0.1', port: 60_151, snapshot_dir: Dir.pwd)
10
15
  @host = host
11
16
  @port = port
@@ -25,24 +30,24 @@ class IGV
25
30
  end
26
31
 
27
32
  def go(position)
28
- send 'goto ' + position
33
+ send "goto #{position}"
29
34
  end
30
35
  alias goto go
31
36
 
32
37
  def genome(name_or_path)
33
38
  path = File.expand_path(name_or_path)
34
39
  if File.exist?(path)
35
- send 'genome ' + path
40
+ send "genome #{path}"
36
41
  else
37
- send 'genome ' + name_or_path
42
+ send "genome #{name_or_path}"
38
43
  end
39
44
  end
40
45
 
41
46
  def load(path_or_url)
42
47
  if URI.parse(path_or_url).scheme
43
- send 'load ' + path_or_url
48
+ send "load #{path_or_url}"
44
49
  else
45
- send 'load ' + File.expand_path(path_or_url)
50
+ send "load #{File.expand_path(path_or_url)}"
46
51
  end
47
52
  end
48
53
 
@@ -51,11 +56,11 @@ class IGV
51
56
  end
52
57
 
53
58
  def sort(option = 'base')
54
- if %w[base position strand quality sample readGroup].include? option
55
- send 'sort ' + option
56
- else
59
+ unless %w[base position strand quality sample readGroup].include? option
57
60
  raise 'options is one of: base, position, strand, quality, sample, and readGroup.'
58
61
  end
62
+
63
+ send "sort #{option}"
59
64
  end
60
65
 
61
66
  def expand(_track = '')
@@ -97,7 +102,7 @@ class IGV
97
102
  # we can set the snapshot dir. then just use the filename.
98
103
  dir_path = File.dirname(file_path)
99
104
  set_snapshot_dir(File.expand_path(dir_path)) if dir_path != '.'
100
- send 'snapshot ' + File.basename(file_path)
105
+ send "snapshot #{File.basename(file_path)}"
101
106
  else
102
107
  send 'snapshot'
103
108
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class IGV
2
- VERSION = '0.0.4'.freeze
4
+ VERSION = '0.0.5'
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-igv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-23 00:00:00.000000000 Z
11
+ date: 2020-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Operate IGV (Integrative Genomics Viewer) from Ruby.
69
+ description: Control IGV (Integrative Genomics Viewer) with Ruby.
70
70
  email:
71
71
  - 2xijok@gmail.com
72
72
  executables: []
@@ -89,15 +89,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 2.3.0
92
+ version: '2.4'
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.1.2
99
+ rubygems_version: 3.1.4
100
100
  signing_key:
101
101
  specification_version: 4
102
- summary: Operate IGV (Integrative Genomics Viewer) from Ruby.
102
+ summary: Control IGV (Integrative Genomics Viewer) with Ruby.
103
103
  test_files: []