rbbt-sources 3.0.18 → 3.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/sources/kegg.rb +38 -38
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bffa0f27abdce0727b9aa6a95a2538c275cac02
4
- data.tar.gz: 014e18755856b61315c6e1566f3fb2a7b4470892
3
+ metadata.gz: 09103120ab258ebec5b5229f3af3b8f81b08a09d
4
+ data.tar.gz: 859133185352820244010f79dcbff16fb74c8472
5
5
  SHA512:
6
- metadata.gz: b78601699a107f0a8565efa66068ee2b85185d4c55868cb813186fc0969140f11763666bf6e14b73f9e4c797d4a21b1dcee5a253a41d15275627e802be3a2da9
7
- data.tar.gz: 181eab2593ad778f945632522802b5992b9f28718a6ec91f1fd56cc1112cf52261f572d195878919846ee4e661f69c56117473281a2ac275584e87d280cc6bf0
6
+ metadata.gz: 973ad5daac0276bf77ca2d8379415ffb8933dbee131a40795c07316b4f78af6e1776a24c4036b52248f435864264a339d7f3205516094f2d332e5e8a2032f59e
7
+ data.tar.gz: 2ff6ccd29f102f4c256a4aa84e151210e6fb51586dc97e1f19ed08b9ab7b0e9afcbc61ed39543b9d0a1be68edcce2627ab92ebc4afc1537f124a6cd4f7306499
@@ -79,44 +79,44 @@ if defined? Entity
79
79
 
80
80
  if defined? Gene and Entity === Gene
81
81
  module Gene
82
- self.format = "KEGG Gene ID"
83
-
84
- def to_kegg
85
- return self if format == "KEGG Gene ID"
86
- if Array === self
87
- Gene.setup(KEGG.index2kegg.values_at(*to("Ensembl Gene ID")), "KEGG Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
88
- else
89
- Gene.setup(KEGG.index2kegg[to("Ensembl Gene ID")], "KEGG Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
90
- end
91
- end
92
-
93
- def from_kegg
94
- return self unless format == "KEGG Gene ID"
95
- if Array === self
96
- Gene.setup(KEGG.index2ens.values_at(*self), "Ensembl Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
97
- else
98
- Gene.setup(KEGG.index2ens[self], "Ensembl Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
99
- end
100
- end
101
-
102
- def self.gene_kegg_pathway_index
103
- @@gene_kegg_pathway_index ||=
104
- KEGG.gene_pathway.tsv(:persist => true, :key_field => "KEGG Gene ID", :fields => ["KEGG Pathway ID"], :type => :flat, :merge => true)
105
- end
106
-
107
- property :to => :array2single do |new_format|
108
- case
109
- when format == new_format
110
- self
111
- when format == "KEGG Gene ID"
112
- ensembl = from_kegg.clean_annotations
113
- Gene.setup(Translation.job(:tsv_translate, "", :organism => organism, :genes => ensembl, :format => new_format).exec.chunked_values_at(ensembl), new_format, organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
114
- when new_format == "KEGG Gene ID"
115
- to_kegg
116
- else
117
- Gene.setup(Translation.job(:tsv_translate, "", :organism => organism, :genes => self, :format => new_format).exec.chunked_values_at(self), new_format, organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
118
- end
119
- end
82
+ add_identifiers KEGG.identifiers
83
+
84
+ #def to_kegg
85
+ # return self if format == "KEGG Gene ID"
86
+ # if Array === self
87
+ # Gene.setup(KEGG.index2kegg.values_at(*to("Ensembl Gene ID")), "KEGG Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
88
+ # else
89
+ # Gene.setup(KEGG.index2kegg[to("Ensembl Gene ID")], "KEGG Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
90
+ # end
91
+ #end
92
+
93
+ #def from_kegg
94
+ # return self unless format == "KEGG Gene ID"
95
+ # if Array === self
96
+ # Gene.setup(KEGG.index2ens.values_at(*self), "Ensembl Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
97
+ # else
98
+ # Gene.setup(KEGG.index2ens[self], "Ensembl Gene ID", organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
99
+ # end
100
+ #end
101
+
102
+ #def self.gene_kegg_pathway_index
103
+ # @@gene_kegg_pathway_index ||=
104
+ # KEGG.gene_pathway.tsv(:persist => true, :key_field => "KEGG Gene ID", :fields => ["KEGG Pathway ID"], :type => :flat, :merge => true)
105
+ #end
106
+
107
+ #property :to => :array2single do |new_format|
108
+ # case
109
+ # when format == new_format
110
+ # self
111
+ # when format == "KEGG Gene ID"
112
+ # ensembl = from_kegg.clean_annotations
113
+ # Gene.setup(Translation.job(:tsv_translate, "", :organism => organism, :genes => ensembl, :format => new_format).exec.chunked_values_at(ensembl), new_format, organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
114
+ # when new_format == "KEGG Gene ID"
115
+ # to_kegg
116
+ # else
117
+ # Gene.setup(Translation.job(:tsv_translate, "", :organism => organism, :genes => self, :format => new_format).exec.chunked_values_at(self), new_format, organism).tap{|o| o.extend AnnotatedArray if AnnotatedArray === self }
118
+ # end
119
+ #end
120
120
 
121
121
  property :kegg_pathways => :array2single do
122
122
  @kegg_pathways ||= Gene.gene_kegg_pathway_index.values_at(*self.to_kegg).
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-sources
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.18
4
+ version: 3.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util