solvebio 1.7.7 → 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.7.7
2
+ current_version = 1.7.8
3
3
  files = lib/solvebio/version.rb
4
4
  commit = True
5
5
  tag = True
data/.gitignore CHANGED
@@ -2,5 +2,6 @@
2
2
  .rvmrc
3
3
  pkg
4
4
  solvebio-*.gem
5
+ Gemfile.lock
5
6
  test/data/.netrc
6
7
  *.swp
data/Gemfile CHANGED
@@ -1,9 +1,7 @@
1
1
  # A bundler Gemfile for specifying dependencies. See http://bundler.io/
2
2
  source "https://rubygems.org"
3
+ gemspec
3
4
 
4
5
  gem 'addressable'
5
- gem 'rest-client'
6
+ gem 'rest-client', '~> 1.7.3'
6
7
  gem 'netrc', '~>0.7.7' # rest-client needs netrc 0.7.7
7
- group :test do
8
- gem 'webmock'
9
- end
data/README.md CHANGED
@@ -61,4 +61,4 @@ The following optional gems can make your shell experience better
61
61
  Documentation
62
62
  -------------
63
63
 
64
- See the [SolveBio API Reference](https://www.solvebio.com/docs/api/?ruby) for more information about using the API.
64
+ See the [SolveBio API Reference](https://docs.solvebio.com/) for more information about using the API.
@@ -59,5 +59,47 @@ module SolveBio
59
59
  params.merge!(:data_url => self.data_url)
60
60
  Query.new(self.id, params)
61
61
  end
62
+
63
+ def beacon(coordinate, chromosome, genome_build=nil, allele=nil)
64
+ unless self.respond_to?(:beacon_url)
65
+ unless self.respond_to?(:id)
66
+ raise Exception,
67
+ 'No Dataset ID was provided. ' +
68
+ 'Please instantiate the Dataset ' +
69
+ 'object with an ID or full_name.'
70
+ end
71
+ # automatically construct the data_url from the ID
72
+ self.beacon_url = url + '/beacon'
73
+ end
74
+
75
+ opts = { :params => {
76
+ :coordinate => coordinate,
77
+ :chromosome => chromosome,
78
+ :genome_build => genome_build,
79
+ :allele => allele
80
+ }
81
+ }
82
+ return Client.request('get', self.beacon_url, opts=opts)
83
+ end
84
+
85
+ def changelog(version=nil, params={})
86
+ unless self.respond_to?(:changelog_url)
87
+ unless self.respond_to?(:id)
88
+ raise Exception,
89
+ 'No Dataset ID was provided. ' +
90
+ 'Please instantiate the Dataset ' +
91
+ 'object with an ID or full_name.'
92
+ end
93
+ # automatically construct the data_url from the ID
94
+ if version
95
+ self.changelog_url = url + '/changelog/' + version
96
+ else
97
+ self.changelog_url = url + '/changelog'
98
+ end
99
+ end
100
+
101
+ params.merge!(:changelog_url => self.changelog_url)
102
+ return Client.request('get', self.changelog_url, params)
103
+ end
62
104
  end
63
105
  end
@@ -36,5 +36,25 @@ module SolveBio
36
36
  def <=>(other)
37
37
  self[:full_name] <=> other[:full_name]
38
38
  end
39
+
40
+ def changelog(version=nil, params={})
41
+ unless self.respond_to?(:changelog_url)
42
+ unless self.respond_to?(:id)
43
+ raise Exception,
44
+ 'No Dataset ID was provided. ' +
45
+ 'Please instantiate the Dataset ' +
46
+ 'object with an ID or full_name.'
47
+ end
48
+ # automatically construct the data_url from the ID
49
+ if version
50
+ self.changelog_url = url + '/changelog/' + version
51
+ else
52
+ self.changelog_url = url + '/changelog'
53
+ end
54
+ end
55
+
56
+ params.merge!(:changelog_url => self.changelog_url)
57
+ return Client.request('get', self.changelog_url, params)
58
+ end
39
59
  end
40
60
  end
@@ -1,3 +1,3 @@
1
1
  module SolveBio
2
- VERSION = '1.7.7'
2
+ VERSION = '1.7.8'
3
3
  end
@@ -47,5 +47,17 @@ module SolveBio
47
47
  # We can get small or large numbers like 0 or 4902851621.0
48
48
  assert(facets['facets'].length >= 0)
49
49
  end
50
+
51
+ # TODO support a Genomic test dataset (grab clinvar one from API build)
52
+ # def test_dataset_beacon
53
+ # beacon = @dataset.beacon(234, '6', allele => 'G')
54
+ # assert(beacon['exist'])
55
+ # end
56
+
57
+ # TODO add another version of TEST_DATASET so we can test changelog
58
+ # def test_dataset_changelog
59
+ # changelog = @dataset.changelog
60
+ # assert(changelog['to_version'])
61
+ # end
50
62
  end
51
63
  end
@@ -18,5 +18,16 @@ module SolveBio
18
18
  "Should find field #{field} in depo version")
19
19
  end
20
20
  end
21
+
22
+ # TODO add another version of TEST_DATASET so we can test changelog
23
+ # def test_depositoryversion_changelog
24
+ # dvs = SolveBio::DepositoryVersion.all
25
+ # dv = dvs.data[0]
26
+ # assert(dv.respond_to?('id'),
27
+ # 'Should be able to get id in depositoryversion')
28
+ #
29
+ # changelog = SolveBio::DepositoryVersion.retrieve(dv.id).changelog
30
+ # assert(changelog['to_version'])
31
+ # end
21
32
  end
22
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solvebio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7
4
+ version: 1.7.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-23 00:00:00.000000000 Z
12
+ date: 2015-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: netrc
@@ -143,8 +143,6 @@ files:
143
143
  - .gitignore
144
144
  - .travis.yml
145
145
  - Gemfile
146
- - Gemfile.lock
147
- - Gemspec
148
146
  - LICENSE
149
147
  - README.md
150
148
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,24 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- addressable (2.3.7)
5
- crack (0.4.2)
6
- safe_yaml (~> 1.0.0)
7
- mime-types (2.4.3)
8
- netrc (0.7.9)
9
- rest-client (1.7.3)
10
- mime-types (>= 1.16, < 3.0)
11
- netrc (~> 0.7)
12
- safe_yaml (1.0.4)
13
- webmock (1.20.4)
14
- addressable (>= 2.3.6)
15
- crack (>= 0.3.2)
16
-
17
- PLATFORMS
18
- ruby
19
-
20
- DEPENDENCIES
21
- addressable
22
- netrc (~> 0.7.7)
23
- rest-client
24
- webmock
data/Gemspec DELETED
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec