rbbt-util 5.37.8 → 5.37.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/knowledge_base/enrichment.rb +1 -1
- data/lib/rbbt/resource/util.rb +1 -1
- data/lib/rbbt/util/migrate.rb +1 -1
- data/lib/rbbt/workflow/examples.rb +23 -18
- data/lib/rbbt/workflow/step/save_load_inputs.rb +0 -55
- data/lib/rbbt/workflow.rb +6 -2
- data/share/rbbt_commands/app/start +3 -1
- data/test/rbbt/association/test_database.rb +25 -16
- data/test/rbbt/entity/test_identifiers.rb +10 -8
- data/test/rbbt/hpc/test_batch.rb +5 -2
- data/test/rbbt/hpc/test_slurm.rb +7 -5
- data/test/rbbt/knowledge_base/test_enrichment.rb +29 -23
- data/test/rbbt/knowledge_base/test_traverse.rb +4 -1
- data/test/rbbt/test_knowledge_base.rb +9 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5b8f1cf0bc5999c1b467eb794cf337e0a315ed24ca3de3809a7d9eff73e175
|
4
|
+
data.tar.gz: 3d2f6a70bba07a441cc6ae7325e0ecd149440173975e8b6ba7e3328d858795a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a02576707e38808f545af7d7a17556b9e38ac84ccb203d320ce3ed7d7dd6b5f1c0834c2b26e726e68b8b731d517de4ce2694956c86c565c19329380ffee1a037
|
7
|
+
data.tar.gz: 71813abce39b34076f97e16b8d2c26ff8e2f3287a75cf43e15cd3ed97205c4e4d8239e19b4fa670d0129e6de81c42bb1f6b1c4ec908f3554e6ac54c56106bb66
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rbbt/knowledge_base/registry'
|
2
|
-
require 'rbbt/statistics/hypergeometric'
|
3
2
|
class KnowledgeBase
|
4
3
|
def enrichment(name, entities, options = {})
|
4
|
+
require 'rbbt/statistics/hypergeometric'
|
5
5
|
database = get_database(name, options)
|
6
6
|
entities = identify_source name, entities
|
7
7
|
database.enrichment entities, database.fields.first, :persist => false
|
data/lib/rbbt/resource/util.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Path
|
2
2
|
|
3
|
-
def self.caller_lib_dir(file = nil, relative_to = ['lib', 'bin'])
|
3
|
+
def self.caller_lib_dir(file = nil, relative_to = ['lib', 'bin', 'workflow.rb'])
|
4
4
|
#file = caller.reject{|l|
|
5
5
|
# l =~ /rbbt\/(?:resource\.rb|workflow\.rb)/ or
|
6
6
|
# l =~ /rbbt\/resource\/path\.rb/ or
|
data/lib/rbbt/util/migrate.rb
CHANGED
@@ -61,7 +61,7 @@ puts resource[path].find(search_path)
|
|
61
61
|
|
62
62
|
real_paths.each do |source_path|
|
63
63
|
Log.medium "Migrating #{source_path} #{options[:files].length} files to #{target} - #{Misc.fingerprint(options[:files])}}" if options[:files]
|
64
|
-
if File.directory?(source_path) || source_path.
|
64
|
+
if File.directory?(source_path) || source_path.end_with?("/")
|
65
65
|
source_path += "/" unless source_path.end_with? '/'
|
66
66
|
target += "/" unless target.end_with? '/'
|
67
67
|
end
|
@@ -25,27 +25,32 @@ module Workflow
|
|
25
25
|
end.compact
|
26
26
|
end
|
27
27
|
|
28
|
+
#def example_inputs_old(task_name, example)
|
29
|
+
# inputs = {}
|
30
|
+
# IndiferentHash.setup(inputs)
|
31
|
+
# example(task_name, example).each do |input,type,file|
|
32
|
+
|
33
|
+
# case type
|
34
|
+
# when :tsv, :array, :text
|
35
|
+
# Log.debug "Pointing #{ input } to #{file}"
|
36
|
+
# inputs[input.to_sym] = file
|
37
|
+
# when :boolean
|
38
|
+
# inputs[input.to_sym] = (file.read.strip == 'true')
|
39
|
+
# else
|
40
|
+
# Log.debug "Loading #{ input } from #{file}"
|
41
|
+
# inputs[input.to_sym] = file.read.strip
|
42
|
+
# end
|
43
|
+
# end
|
44
|
+
# inputs
|
45
|
+
#end
|
46
|
+
|
28
47
|
def example_inputs(task_name, example)
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
case type
|
34
|
-
when :tsv, :array, :text
|
35
|
-
Log.debug "Pointing #{ input } to #{file}"
|
36
|
-
inputs[input.to_sym] = file
|
37
|
-
when :boolean
|
38
|
-
inputs[input.to_sym] = (file.read.strip == 'true')
|
39
|
-
else
|
40
|
-
Log.debug "Loading #{ input } from #{file}"
|
41
|
-
inputs[input.to_sym] = file.read.strip
|
42
|
-
end
|
43
|
-
end
|
44
|
-
inputs
|
48
|
+
dir = example_dir[task_name][example]
|
49
|
+
info = self.task_info(task_name)
|
50
|
+
Workflow.load_inputs(dir, info[:inputs], info[:input_types])
|
45
51
|
end
|
46
52
|
|
47
|
-
|
48
|
-
def example_step(task_name, example, new_inputs = {})
|
53
|
+
def example_step(task_name, example="Example", new_inputs = {})
|
49
54
|
inputs = example_inputs(task_name, example)
|
50
55
|
|
51
56
|
if new_inputs and new_inputs.any?
|
@@ -250,59 +250,4 @@ class Step
|
|
250
250
|
inputs.keys
|
251
251
|
end
|
252
252
|
|
253
|
-
#def self.save_inputs_old(inputs, input_types, input_options, dir)
|
254
|
-
# inputs.each do |name,value|
|
255
|
-
# type = input_types[name]
|
256
|
-
# type = type.to_s if type
|
257
|
-
# path = File.join(dir, name.to_s)
|
258
|
-
|
259
|
-
# if (IO === value || Step === value) && ! (input_options[name] && input_options[name][:nofile])
|
260
|
-
# path = path + '.as_io'
|
261
|
-
# elsif Misc.is_filename?(value, false)
|
262
|
-
# path = path + '.as_filename'
|
263
|
-
# end
|
264
|
-
|
265
|
-
# Log.debug "Saving job input #{name} (#{type}) into #{path}"
|
266
|
-
|
267
|
-
# case
|
268
|
-
# when IO === value
|
269
|
-
# Open.write(path, value.to_s)
|
270
|
-
# when Step === value
|
271
|
-
# Open.ln_s(value.path, path)
|
272
|
-
# when type.to_s == "binary"
|
273
|
-
# if String === value && File.exist?(value)
|
274
|
-
# value = File.expand_path(value)
|
275
|
-
# Open.ln_s(value, path)
|
276
|
-
# elsif String === value && Misc.is_filename?(value, false)
|
277
|
-
# Open.write(path + '.as_path' , value)
|
278
|
-
# else
|
279
|
-
# Open.write(path, value, :mode => 'wb')
|
280
|
-
# end
|
281
|
-
# when TSV === value
|
282
|
-
# Open.write(path, value.to_s)
|
283
|
-
# when Array === value
|
284
|
-
# Open.write(path, value.collect{|v| Step === v ? v.path : v.to_s} * "\n")
|
285
|
-
# when %w(file tsv array).include?(type.to_s)
|
286
|
-
# if String === value && File.exist?(value)
|
287
|
-
# value = File.expand_path(value)
|
288
|
-
# Open.ln_s(value, path)
|
289
|
-
# elsif String === value && Misc.is_filename?(value, false)
|
290
|
-
# Open.write(path + '.as_path' , value)
|
291
|
-
# else
|
292
|
-
# value = value.collect{|v| v = "#{v}" if Path === v; v } if Array === value
|
293
|
-
# value = "#{value}" if Path === value
|
294
|
-
# Open.write(path + '.yaml', value.to_yaml)
|
295
|
-
# end
|
296
|
-
# when IO === value
|
297
|
-
# if value.filename && String === value.filename && File.exist?(value.filename)
|
298
|
-
# Open.ln_s(value.filename, path)
|
299
|
-
# else
|
300
|
-
# Open.write(path, value)
|
301
|
-
# end
|
302
|
-
# else
|
303
|
-
# Open.write(path, value.to_s)
|
304
|
-
# end
|
305
|
-
# end.any?
|
306
|
-
#end
|
307
|
-
|
308
253
|
end
|
data/lib/rbbt/workflow.rb
CHANGED
@@ -206,7 +206,7 @@ module Workflow
|
|
206
206
|
(Workflow.autoinstall and `rbbt workflow install #{Misc.snake_case(wf_name)} || rbbt workflow install #{wf_name}` and require_local_workflow(wf_name)) or raise("Workflow not found or could not be loaded: #{ wf_name }")
|
207
207
|
|
208
208
|
workflow = begin
|
209
|
-
Misc.string2const Misc.camel_case(wf_name
|
209
|
+
Misc.string2const Misc.camel_case(wf_name)
|
210
210
|
rescue
|
211
211
|
Workflow.workflows.last || true
|
212
212
|
end
|
@@ -370,11 +370,15 @@ module Workflow
|
|
370
370
|
def exec_exports
|
371
371
|
@exec_exports ||= []
|
372
372
|
end
|
373
|
-
|
373
|
+
|
374
374
|
def all_exports
|
375
375
|
@all_exports ||= asynchronous_exports + synchronous_exports + exec_exports + stream_exports
|
376
376
|
end
|
377
377
|
|
378
|
+
def documented_tasks
|
379
|
+
tasks.select{|k,v| v.description && ! v.description.empty? }.collect{|k,v| k }
|
380
|
+
end
|
381
|
+
|
378
382
|
# {{{ JOB MANAGEMENT
|
379
383
|
DEFAULT_NAME="Default"
|
380
384
|
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'rbbt-util'
|
4
4
|
require 'rbbt/util/simpleopt'
|
5
|
+
require 'rack'
|
6
|
+
require 'rack/server'
|
5
7
|
|
6
8
|
$0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands
|
7
9
|
|
@@ -60,7 +62,7 @@ app_dir = app_dir[app].find
|
|
60
62
|
|
61
63
|
server = options[:server] || 'puma'
|
62
64
|
Misc.in_dir(app_dir) do
|
63
|
-
|
65
|
+
|
64
66
|
ENV["RBBT_FINDER"] = "true" if options[:finder]
|
65
67
|
ENV["RACK_ENV"] = options[:environment] if options.include?(:environment)
|
66
68
|
ENV["RBBT_VIEWS_DIR"] = options[:views] if options.include?(:views)
|
@@ -6,50 +6,59 @@ require 'rbbt/association/database'
|
|
6
6
|
|
7
7
|
class TestAssociationDatabase < Test::Unit::TestCase
|
8
8
|
|
9
|
-
|
9
|
+
def effect_options
|
10
|
+
effect_options = {
|
11
|
+
:source => "SG=~Associated Gene Name",
|
12
|
+
:target => "TG=~Associated Gene Name=>Ensembl Gene ID",
|
13
|
+
:persist => false,
|
14
|
+
:identifiers => datafile_test('identifiers'),
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
def effect_tsv
|
19
|
+
effect =<<-END
|
10
20
|
#: :sep=" "#:type=:double
|
11
21
|
#SG TG Effect directed?
|
12
22
|
MDM2 TP53 inhibition false
|
13
23
|
TP53 NFKB1|GLI1 activation|activation true|true
|
14
|
-
|
24
|
+
END
|
15
25
|
|
16
|
-
EFFECT_OPTIONS = {
|
17
|
-
:source => "SG=~Associated Gene Name",
|
18
|
-
:target => "TG=~Associated Gene Name=>Ensembl Gene ID",
|
19
|
-
:persist => false,
|
20
|
-
:identifiers => datafile_test('identifiers'),
|
21
|
-
}
|
22
26
|
|
23
|
-
|
27
|
+
effect_tsv = TSV.open effect, effect_options.dup
|
28
|
+
end
|
29
|
+
|
30
|
+
def effect_database
|
31
|
+
effect_database = Association.database(effect_tsv)
|
32
|
+
end
|
33
|
+
|
24
34
|
def test_tsv
|
25
|
-
assert_equal %w(NFKB1 GLI1),
|
35
|
+
assert_equal %w(NFKB1 GLI1), effect_tsv["TP53"]["TG"]
|
26
36
|
end
|
27
37
|
|
28
|
-
EFFECT_DATABASE = Association.database(EFFECT_TSV, EFFECT_OPTIONS.dup)
|
29
38
|
|
30
39
|
def test_open_new_tsv
|
31
|
-
tsv = Association.database
|
40
|
+
tsv = Association.database effect_tsv, :fields => ["Effect"], :target => "TG=~Associated Gene Name=>Ensembl Gene ID"
|
32
41
|
assert_equal ["Ensembl Gene ID", "Effect"], tsv.fields
|
33
42
|
assert_equal "SG", tsv.key_field
|
34
43
|
assert tsv.include? "MDM2"
|
35
44
|
end
|
36
45
|
|
37
46
|
def test_open_new_tsv_reverse
|
38
|
-
tsv = Association.database
|
47
|
+
tsv = Association.database effect_tsv, :fields => ["Effect"], :target => "SG=~Associated Gene Name=>Ensembl Gene ID", :zipped => true
|
39
48
|
assert_equal ["Ensembl Gene ID", "Effect"], tsv.fields
|
40
49
|
assert_equal "TG", tsv.key_field
|
41
50
|
assert tsv.include? "NFKB1"
|
42
51
|
end
|
43
52
|
|
44
53
|
def test_database_translate
|
45
|
-
database = Association.database(
|
54
|
+
database = Association.database(effect_tsv, effect_options.merge({:source => "SG=~Associated Gene Name=>Ensembl Gene ID", :target => "TG"}))
|
46
55
|
assert_equal %w(inhibition), database["ENSG00000135679"]["Effect"]
|
47
56
|
assert_equal %w(activation activation), database["ENSG00000141510"]["Effect"]
|
48
57
|
end
|
49
58
|
|
50
59
|
def test_database
|
51
|
-
assert_equal %w(inhibition),
|
52
|
-
assert_equal %w(activation activation),
|
60
|
+
assert_equal %w(inhibition), effect_database["MDM2"]["Effect"]
|
61
|
+
assert_equal %w(activation activation), effect_database["TP53"]["Effect"]
|
53
62
|
end
|
54
63
|
|
55
64
|
def test_index_list
|
@@ -7,14 +7,16 @@ module Gene
|
|
7
7
|
extend Entity
|
8
8
|
end
|
9
9
|
|
10
|
-
require 'rbbt/sources/kegg'
|
11
|
-
require 'rbbt/sources/organism'
|
12
|
-
Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
|
13
|
-
Gene.add_identifiers KEGG.identifiers
|
14
|
-
Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
|
15
|
-
Gene.add_identifiers KEGG.identifiers
|
16
|
-
|
17
10
|
class TestEntityIdentifiers < Test::Unit::TestCase
|
11
|
+
def setup
|
12
|
+
require 'rbbt/sources/kegg'
|
13
|
+
require 'rbbt/sources/organism'
|
14
|
+
Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
|
15
|
+
Gene.add_identifiers KEGG.identifiers
|
16
|
+
Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
|
17
|
+
Gene.add_identifiers KEGG.identifiers
|
18
|
+
|
19
|
+
end
|
18
20
|
def test_name
|
19
21
|
Gene.add_identifiers datafile_test('identifiers'), "Ensembl Gene ID", "Associated Gene Name"
|
20
22
|
assert_equal "TP53", Gene.setup("ENSG00000141510").name
|
@@ -62,7 +64,7 @@ class TestEntityIdentifiers < Test::Unit::TestCase
|
|
62
64
|
mod.instance_eval do
|
63
65
|
extend Entity
|
64
66
|
add_identifiers Path.setup(description_file), key_field, description_field
|
65
|
-
|
67
|
+
|
66
68
|
annotation :format
|
67
69
|
end
|
68
70
|
entity = "CORUM:6052"
|
data/test/rbbt/hpc/test_batch.rb
CHANGED
@@ -2,10 +2,13 @@ require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helpe
|
|
2
2
|
require 'rbbt/hpc/batch'
|
3
3
|
require 'rbbt/workflow'
|
4
4
|
|
5
|
-
Workflow.require_workflow "Sample"
|
6
|
-
Workflow.require_workflow "HTS"
|
7
5
|
class TestSLURM < Test::Unit::TestCase
|
8
6
|
|
7
|
+
def setup
|
8
|
+
Workflow.require_workflow "Sample"
|
9
|
+
Workflow.require_workflow "HTS"
|
10
|
+
end
|
11
|
+
|
9
12
|
def test_batch_options
|
10
13
|
job = Sample.job(:mutect2, "small", :reference => "hg38")
|
11
14
|
|
data/test/rbbt/hpc/test_slurm.rb
CHANGED
@@ -2,11 +2,13 @@ require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helpe
|
|
2
2
|
require 'rbbt/hpc/slurm'
|
3
3
|
require 'rbbt/workflow'
|
4
4
|
|
5
|
-
Workflow.require_workflow "Sample"
|
6
|
-
Workflow.require_workflow "HTS"
|
7
5
|
class TestSLURM < Test::Unit::TestCase
|
6
|
+
def setup
|
7
|
+
Workflow.require_workflow "Sample"
|
8
|
+
Workflow.require_workflow "HTS"
|
9
|
+
end
|
8
10
|
|
9
|
-
def
|
11
|
+
def __test_template
|
10
12
|
job = Sample.job(:mutect2, "small", :reference => "hg38")
|
11
13
|
|
12
14
|
TmpFile.with_file do |batch_dir|
|
@@ -17,13 +19,13 @@ class TestSLURM < Test::Unit::TestCase
|
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
20
|
-
def
|
22
|
+
def __test_run_job
|
21
23
|
job = Sample.job(:mutect2, "small", :reference => "hg38")
|
22
24
|
|
23
25
|
job.clean
|
24
26
|
|
25
27
|
jobid = HPC::SLURM.run_job(job, :workflows => "HTS", :batch_modules => 'java', :env_cmd => '_JAVA_OPTIONS="-Xms1g -Xmx${MAX_MEMORY}m"', :queue => :debug, :time => '01:00:00', :config_keys => "HTS_light", :task_cpus => '10', :tail => true, :clean_task => "HTS#mutect2")
|
26
|
-
|
28
|
+
assert jobid.to_s =~ /^\d+$/
|
27
29
|
end
|
28
30
|
|
29
31
|
end
|
@@ -6,35 +6,41 @@ require 'rbbt/knowledge_base/enrichment'
|
|
6
6
|
|
7
7
|
|
8
8
|
class TestKnowledgeBaseEnrichment < Test::Unit::TestCase
|
9
|
+
def knowledge_base(file)
|
9
10
|
|
10
|
-
|
11
|
+
effect =StringIO.new <<-END
|
11
12
|
#: :sep=" "#:type=:double
|
12
13
|
#SG TG Effect
|
13
14
|
MDM2 TP53 inhibition
|
14
15
|
TP53 NFKB1|GLI1 activation|activation true|true
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
16
|
+
END
|
17
|
+
|
18
|
+
effect_options = {
|
19
|
+
:source => "SG=~Associated Gene Name",
|
20
|
+
:target => "TG=~Associated Gene Name=>Ensembl Gene ID",
|
21
|
+
:persist => false,
|
22
|
+
:identifiers => datafile_test('identifiers'),
|
23
|
+
:undirected => true,
|
24
|
+
:namespace => "Hsa"
|
25
|
+
}
|
26
|
+
|
27
|
+
effect_tsv = TSV.open effect, effect_options.dup
|
28
|
+
|
29
|
+
knowledge_base = KnowledgeBase.new file, "Hsa/feb2014"
|
30
|
+
knowledge_base.format = {"Gene" => "Ensembl Gene ID"}
|
31
|
+
|
32
|
+
knowledge_base.register :effects, effect_tsv, effect_options.dup
|
33
|
+
knowledge_base.register :gene_ages, datafile_test('gene_ages')
|
34
|
+
knowledge_base.register :nature, datafile_test('nature'), :source => "UniProt/SwissProt Accession", :target => "NCI Nature Pathway ID"
|
35
|
+
|
36
|
+
knowledge_base
|
37
|
+
end
|
38
|
+
|
35
39
|
def test_enrichment
|
36
|
-
|
37
|
-
|
40
|
+
TmpFile.with_file do |tmp_kb|
|
41
|
+
genes = %w(P17706-2 LMAN1 P17706-1 P29353-2 JAK3 Q8NFM1 EIF2AK2 JAK1 SRC PIAS1 KPNB1 KPNA2 STAT3 PTPN1 ATR CREBBP PTPRA SGK1 P46108-1 NCK2 O00145 PTPN1 CBL SORBS1 IRS1 SHC1 AKT2 GRB2 SOS1 RPS6KB1 AKT1 DOK1 RASA1 NCK1 FOXO3 RAPGEF1 TRIP10 EIF4EBP1 PDPK1 GRB14 PTPN11 INS GRB10 CAV1 EIF4B RPS6KB1 EEF2 EEF2K AKT1 TSC1 TSC2 CLIP1 DDIT4 SGK1 PDPK1 DEPTOR SREBF1 CYCS IRS1 RPS6KA1 BNIP3 RRN3 RICTOR IKBKB AKT1S1 PXN PML EIF4A1 PPARGC1A YY1 PRKCA RPTOR PDCD4 SIK1 P10636-8 BRSK1 MYC SMARCD3 STK11 ETV4 MARK4 MAP2 MARK2 CRTC2 PSEN2 MST4 CTSD BRSK2 SIK2 ESR1 CAB39 STK11IP SMAD4 CREB1 PRKACA EZR TP53 GSK3B SIK3 CDC37 HSP90AA1 )
|
42
|
+
assert knowledge_base(tmp_kb).enrichment(:nature, genes).any?
|
43
|
+
end
|
38
44
|
end
|
39
45
|
|
40
46
|
end
|
@@ -2,8 +2,11 @@ require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helpe
|
|
2
2
|
require 'rbbt/knowledge_base/traverse'
|
3
3
|
require 'rbbt/workflow'
|
4
4
|
|
5
|
-
Workflow.require_workflow "Genomics"
|
6
5
|
class TestKnowledgeBaseTraverse < Test::Unit::TestCase
|
6
|
+
def setup
|
7
|
+
Workflow.require_workflow "Genomics"
|
8
|
+
end
|
9
|
+
|
7
10
|
def kb
|
8
11
|
Genomics.knowledge_base
|
9
12
|
end
|
@@ -9,15 +9,8 @@ require 'rbbt/entity/identifiers'
|
|
9
9
|
require 'rbbt/association'
|
10
10
|
require 'rbbt/knowledge_base'
|
11
11
|
|
12
|
-
require 'rbbt/sources/organism'
|
13
|
-
require 'rbbt/sources/tfacts'
|
14
|
-
require 'rbbt/sources/kegg'
|
15
|
-
|
16
12
|
module Gene
|
17
13
|
extend Entity
|
18
|
-
add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
|
19
|
-
add_identifiers KEGG.identifiers
|
20
|
-
|
21
14
|
property :follow => :single do |kb,name,annotate=nil|
|
22
15
|
if annotate.nil? or annotate
|
23
16
|
l = kb.children(name, self).target_entity
|
@@ -55,6 +48,15 @@ end
|
|
55
48
|
|
56
49
|
|
57
50
|
class TestKnowledgeBase < Test::Unit::TestCase
|
51
|
+
def setup
|
52
|
+
require 'rbbt/sources/organism'
|
53
|
+
require 'rbbt/sources/tfacts'
|
54
|
+
require 'rbbt/sources/kegg'
|
55
|
+
|
56
|
+
Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
|
57
|
+
Gene.add_identifiers KEGG.identifiers
|
58
|
+
|
59
|
+
end
|
58
60
|
|
59
61
|
def test_knowledge_base_reverse
|
60
62
|
organism = Organism.default_code("Hsa")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.37.
|
4
|
+
version: 5.37.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -585,7 +585,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
585
585
|
- !ruby/object:Gem::Version
|
586
586
|
version: '0'
|
587
587
|
requirements: []
|
588
|
-
rubygems_version: 3.
|
588
|
+
rubygems_version: 3.4.8
|
589
589
|
signing_key:
|
590
590
|
specification_version: 4
|
591
591
|
summary: Utilities for the Ruby Bioinformatics Toolkit (rbbt)
|