rbbt-util 5.25.4 → 5.25.5
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.
- checksums.yaml +4 -4
- data/lib/rbbt/knowledge_base/registry.rb +20 -9
- data/lib/rbbt/workflow/accessor.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e07b6ec4cc5c33daa9aa1ab26b968c7dd42b1c7d
|
4
|
+
data.tar.gz: 7a2cbbba275dac3f7981ce794468880faac8e306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a185e9f04e0be73b6d71b8d8358f4cd6c36669c7c93439e1e75876366a14b3aaf392f22be4fa0d19d363fd1256365d5e5258305e3fb9f3d1506aba862e7afc6
|
7
|
+
data.tar.gz: 02c0a3c7457da08b7445cfde0ef3e5799b69078a26a59b69f913b7c0f631647cf02e0cbb07ef821d82d193de0fd44a6a31dadda6ccbc3871e524183b78282fb3
|
@@ -45,6 +45,9 @@ class KnowledgeBase
|
|
45
45
|
begin
|
46
46
|
if options.empty?
|
47
47
|
key = name.to_s
|
48
|
+
elsif options[:key]
|
49
|
+
key = options[:key]
|
50
|
+
key = name if key == :name
|
48
51
|
else
|
49
52
|
fp = Misc.hash2md5(options)
|
50
53
|
key = name.to_s + "_" + fp
|
@@ -90,7 +93,13 @@ class KnowledgeBase
|
|
90
93
|
def get_database(name, options = {})
|
91
94
|
name = name.to_s
|
92
95
|
|
93
|
-
options
|
96
|
+
options = options.dup
|
97
|
+
if self.namespace == options[:namespace]
|
98
|
+
options.delete(:namespace)
|
99
|
+
end
|
100
|
+
if self.namespace == options[:organism]
|
101
|
+
options.delete(:organism)
|
102
|
+
end
|
94
103
|
@databases[[name, options]] ||=
|
95
104
|
begin
|
96
105
|
fp = Misc.fingerprint([name,options])
|
@@ -102,6 +111,8 @@ class KnowledgeBase
|
|
102
111
|
key = name.to_s + "_" + fp
|
103
112
|
end
|
104
113
|
|
114
|
+
options[:organism] ||= options[:namespace] ||= self.namespace unless self.namespace.nil?
|
115
|
+
|
105
116
|
key += '.database'
|
106
117
|
Persist.memory("Database:" << [key, dir] * "@") do
|
107
118
|
options = options.dup
|
@@ -124,14 +135,14 @@ class KnowledgeBase
|
|
124
135
|
persist_options = Misc.pull_keys options, :persist
|
125
136
|
|
126
137
|
database = if persist_file.exists? and persist_options[:persist] and not persist_options[:update]
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
138
|
+
Log.low "Re-opening database #{ name } from #{ Misc.fingerprint persist_file }. #{options}"
|
139
|
+
Association.open(file, options, persist_options)
|
140
|
+
else
|
141
|
+
options = Misc.add_defaults options, registered_options if registered_options
|
142
|
+
raise "Repo #{ name } not found and not registered" if file.nil?
|
143
|
+
Log.medium "Opening database #{ name } from #{ Misc.fingerprint file }. #{options}"
|
144
|
+
Association.open(file, options, persist_options)
|
145
|
+
end
|
135
146
|
|
136
147
|
database.namespace = self.namespace if self.namespace
|
137
148
|
|
@@ -640,6 +640,13 @@ class Step
|
|
640
640
|
done? && info[:path] && info[:path] != path
|
641
641
|
end
|
642
642
|
|
643
|
+
def knowledge_base(organism = nil)
|
644
|
+
@_kb ||= begin
|
645
|
+
kb_dir = self.file('knowledge_base')
|
646
|
+
KnowledgeBase.new kb_dir, organism
|
647
|
+
end
|
648
|
+
end
|
649
|
+
|
643
650
|
end
|
644
651
|
|
645
652
|
module Workflow
|