ensembl 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ensembl/core/activerecord.rb +5 -1
- data/lib/ensembl/variation/activerecord.rb +12 -5
- data/lib/ensembl/version.rb +1 -1
- data/lib/ensembl.rb +11 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9184473a4f510dc3c745429272faf91ece792c13
|
4
|
+
data.tar.gz: b2cf56a525faae69a4ef6d1555e1fcdd193738af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 116db18ee8d13e996dbe637dbfee8e50a3a0bc6fa8774c5097bc9b4543650e87dcd0d31df25355323e15698760bdc337f7841da1b945e23cc4fa09ea2ff364e2
|
7
|
+
data.tar.gz: 9e6f98c89c2c3018b930478144b2e17207ae166fed90b0425aab18b0ddec924c2153177e26880e9efdba67ebe5acd6df16607193c1e6b93e996f8ade840d45e6
|
@@ -7,12 +7,16 @@ module Ensembl
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
+
# ConnectionPool implemented from:
|
11
|
+
# http://www.lucasallan.com/2014/05/26/fixing-concurrency-issues-with-active-record-in-a-rack-application.html
|
10
12
|
class Connection < ActiveRecord::Base
|
11
|
-
self.extend TableNameOverrides
|
13
|
+
self.extend Ensembl::TableNameOverrides
|
14
|
+
self.extend Ensembl::ConnectionPool
|
12
15
|
|
13
16
|
self.abstract_class = true
|
14
17
|
|
15
18
|
self.establish_connection :core
|
19
|
+
|
16
20
|
end
|
17
21
|
|
18
22
|
class ModelBase < Connection
|
@@ -2,8 +2,13 @@ require 'active_record'
|
|
2
2
|
|
3
3
|
module Ensembl
|
4
4
|
module Variation
|
5
|
+
|
6
|
+
# ConnectionPool implemented from:
|
7
|
+
# http://www.lucasallan.com/2014/05/26/fixing-concurrency-issues-with-active-record-in-a-rack-application.html
|
5
8
|
class Connection < ActiveRecord::Base
|
6
|
-
|
9
|
+
|
10
|
+
self.extend Ensembl::TableNameOverrides
|
11
|
+
self.extend Ensembl::ConnectionPool
|
7
12
|
|
8
13
|
self.abstract_class = true
|
9
14
|
|
@@ -234,15 +239,17 @@ module Ensembl
|
|
234
239
|
belongs_to :study
|
235
240
|
belongs_to :seq_region, class_name: 'Ensembl::Core::SeqRegion'
|
236
241
|
|
242
|
+
has_one :variation, primary_key: 'object_id', foreign_key: 'name'
|
243
|
+
|
237
244
|
has_many :phenotype_feature_attribs
|
238
245
|
has_many :attrib_types, through: :phenotype_feature_attribs
|
239
246
|
|
240
247
|
scope :significant, -> { where(is_significant: true )}
|
241
248
|
scope :with_studies, -> { where.not(study_id:nil)}
|
242
249
|
|
243
|
-
def variation
|
244
|
-
|
245
|
-
end
|
250
|
+
# def variation
|
251
|
+
# Variation.find_by name: object_id
|
252
|
+
# end
|
246
253
|
|
247
254
|
def risk_allele
|
248
255
|
pf=phenotype_feature_attribs.risk_alleles.first
|
@@ -489,7 +496,7 @@ module Ensembl
|
|
489
496
|
end
|
490
497
|
|
491
498
|
def all_phenotype_features
|
492
|
-
object_ids =
|
499
|
+
object_ids = synonym_names
|
493
500
|
object_ids<<name
|
494
501
|
PhenotypeFeature.eager_load(:phenotype).where(object_id: object_ids, type: 'Variation')
|
495
502
|
end
|
data/lib/ensembl/version.rb
CHANGED
data/lib/ensembl.rb
CHANGED
@@ -19,18 +19,17 @@ module Ensembl
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
#
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
# end
|
22
|
+
# ConnectionPool implemented from:
|
23
|
+
# http://www.lucasallan.com/2014/05/26/fixing-concurrency-issues-with-active-record-in-a-rack-application.html
|
24
|
+
module ConnectionPool
|
25
|
+
singleton_class.send(:alias_method, :original_connection, :connection)
|
26
|
+
|
27
|
+
def self.connection
|
28
|
+
ActiveRecord::Base.connection_pool.with_connection do |conn|
|
29
|
+
conn
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
34
33
|
end
|
35
34
|
|
36
35
|
require File.dirname(__FILE__) + '/ensembl/helpers/like_search.rb'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ensembl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristjan Metsalu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|