bio-publisci 0.0.3 → 0.0.4
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/Gemfile +1 -0
- data/Rakefile +5 -5
- data/bin/bio-publisci +34 -11
- data/examples/bio-band_integration.rb +9 -0
- data/examples/no_magic.prov +40 -0
- data/examples/primer.prov +28 -0
- data/examples/prov_dsl.prov +51 -0
- data/features/create_generator.feature +5 -9
- data/features/integration_steps.rb +8 -8
- data/features/metadata.feature +15 -2
- data/features/metadata_steps.rb +21 -0
- data/features/orm_steps.rb +5 -5
- data/features/prov_dsl.feature +14 -0
- data/features/prov_dsl_steps.rb +11 -0
- data/lib/bio-publisci/dataset/ORM/data_cube_orm.rb +234 -236
- data/lib/bio-publisci/dataset/ORM/observation.rb +1 -3
- data/lib/bio-publisci/dataset/data_cube.rb +30 -26
- data/lib/bio-publisci/dataset/dataset_for.rb +14 -8
- data/lib/bio-publisci/metadata/metadata.rb +180 -42
- data/lib/bio-publisci/metadata/prov/activity.rb +106 -0
- data/lib/bio-publisci/metadata/prov/agent.rb +94 -0
- data/lib/bio-publisci/metadata/prov/association.rb +73 -0
- data/lib/bio-publisci/metadata/prov/derivation.rb +53 -0
- data/lib/bio-publisci/metadata/prov/dsl.rb +159 -0
- data/lib/bio-publisci/metadata/prov/element.rb +52 -0
- data/lib/bio-publisci/metadata/prov/entity.rb +101 -0
- data/lib/bio-publisci/metadata/prov/plan.rb +32 -0
- data/lib/bio-publisci/metadata/prov/prov.rb +76 -0
- data/lib/bio-publisci/mixins/custom_predicate.rb +26 -0
- data/lib/bio-publisci/mixins/vocabulary.rb +8 -0
- data/lib/bio-publisci/output.rb +27 -0
- data/lib/bio-publisci/parser.rb +17 -8
- data/lib/bio-publisci/readers/csv.rb +9 -7
- data/lib/bio-publisci/readers/dataframe.rb +9 -8
- data/lib/bio-publisci/readers/{big_cross.rb → r_cross.rb} +6 -10
- data/lib/bio-publisci/readers/r_matrix.rb +37 -13
- data/lib/bio-publisci/spira.rb +82 -0
- data/lib/bio-publisci/writers/dataframe.rb +65 -65
- data/lib/bio-publisci.rb +9 -4
- data/spec/ORM/data_cube_orm_spec.rb +3 -3
- data/spec/dataset_for_spec.rb +29 -0
- data/spec/generators/r_cross_spec.rb +51 -0
- data/spec/generators/r_matrix_spec.rb +14 -5
- metadata +42 -8
- data/lib/bio-publisci/readers/cross.rb +0 -72
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-publisci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Will Strinz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -178,8 +178,22 @@ dependencies:
|
|
178
178
|
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '3.12'
|
181
|
-
|
182
|
-
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: spoon
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - '>='
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - '>='
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
description: 'A toolkit for publishing scientific results and datasets using RDF,
|
196
|
+
OWL, and related technologies '
|
183
197
|
email: wstrinz@gmail.com
|
184
198
|
executables:
|
185
199
|
- bio-publisci
|
@@ -198,6 +212,10 @@ files:
|
|
198
212
|
- README.rdoc
|
199
213
|
- Rakefile
|
200
214
|
- bin/bio-publisci
|
215
|
+
- examples/bio-band_integration.rb
|
216
|
+
- examples/no_magic.prov
|
217
|
+
- examples/primer.prov
|
218
|
+
- examples/prov_dsl.prov
|
201
219
|
- features/create_generator.feature
|
202
220
|
- features/integration.feature
|
203
221
|
- features/integration_steps.rb
|
@@ -205,6 +223,8 @@ files:
|
|
205
223
|
- features/metadata_steps.rb
|
206
224
|
- features/orm.feature
|
207
225
|
- features/orm_steps.rb
|
226
|
+
- features/prov_dsl.feature
|
227
|
+
- features/prov_dsl_steps.rb
|
208
228
|
- features/reader.feature
|
209
229
|
- features/reader_steps.rb
|
210
230
|
- features/step_definitions/bio-publisci_steps.rb
|
@@ -221,15 +241,27 @@ files:
|
|
221
241
|
- lib/bio-publisci/dataset/dataset_for.rb
|
222
242
|
- lib/bio-publisci/dataset/interactive.rb
|
223
243
|
- lib/bio-publisci/metadata/metadata.rb
|
244
|
+
- lib/bio-publisci/metadata/prov/activity.rb
|
245
|
+
- lib/bio-publisci/metadata/prov/agent.rb
|
246
|
+
- lib/bio-publisci/metadata/prov/association.rb
|
247
|
+
- lib/bio-publisci/metadata/prov/derivation.rb
|
248
|
+
- lib/bio-publisci/metadata/prov/dsl.rb
|
249
|
+
- lib/bio-publisci/metadata/prov/element.rb
|
250
|
+
- lib/bio-publisci/metadata/prov/entity.rb
|
251
|
+
- lib/bio-publisci/metadata/prov/plan.rb
|
252
|
+
- lib/bio-publisci/metadata/prov/prov.rb
|
253
|
+
- lib/bio-publisci/mixins/custom_predicate.rb
|
254
|
+
- lib/bio-publisci/mixins/vocabulary.rb
|
255
|
+
- lib/bio-publisci/output.rb
|
224
256
|
- lib/bio-publisci/parser.rb
|
225
257
|
- lib/bio-publisci/query/query_helper.rb
|
226
258
|
- lib/bio-publisci/r_client.rb
|
227
259
|
- lib/bio-publisci/readers/arff.rb
|
228
|
-
- lib/bio-publisci/readers/big_cross.rb
|
229
|
-
- lib/bio-publisci/readers/cross.rb
|
230
260
|
- lib/bio-publisci/readers/csv.rb
|
231
261
|
- lib/bio-publisci/readers/dataframe.rb
|
262
|
+
- lib/bio-publisci/readers/r_cross.rb
|
232
263
|
- lib/bio-publisci/readers/r_matrix.rb
|
264
|
+
- lib/bio-publisci/spira.rb
|
233
265
|
- lib/bio-publisci/store.rb
|
234
266
|
- lib/bio-publisci/writers/arff.rb
|
235
267
|
- lib/bio-publisci/writers/dataframe.rb
|
@@ -274,8 +306,10 @@ files:
|
|
274
306
|
- spec/csv/bacon.csv
|
275
307
|
- spec/csv/moar_bacon.csv
|
276
308
|
- spec/data_cube_spec.rb
|
309
|
+
- spec/dataset_for_spec.rb
|
277
310
|
- spec/generators/csv_spec.rb
|
278
311
|
- spec/generators/dataframe_spec.rb
|
312
|
+
- spec/generators/r_cross_spec.rb
|
279
313
|
- spec/generators/r_matrix_spec.rb
|
280
314
|
- spec/queries/integrity/1.rq
|
281
315
|
- spec/queries/integrity/11.rq
|
@@ -316,5 +350,5 @@ rubyforge_project:
|
|
316
350
|
rubygems_version: 2.0.3
|
317
351
|
signing_key:
|
318
352
|
specification_version: 4
|
319
|
-
summary: Publish
|
353
|
+
summary: Publish scientific results to the semantic web
|
320
354
|
test_files: []
|
@@ -1,72 +0,0 @@
|
|
1
|
-
module R2RDF
|
2
|
-
module Reader
|
3
|
-
class Cross
|
4
|
-
include R2RDF::Dataset::DataCube
|
5
|
-
|
6
|
-
def generate_n3(rexp, var, options={})
|
7
|
-
@rexp = rexp
|
8
|
-
@options = options
|
9
|
-
generate(measures, dimensions, codes, observation_data, observation_labels, var, options)
|
10
|
-
end
|
11
|
-
|
12
|
-
def dimensions
|
13
|
-
["individual","chr","sex","marker"]
|
14
|
-
end
|
15
|
-
|
16
|
-
def codes
|
17
|
-
["individual","chr","sex","marker"]
|
18
|
-
end
|
19
|
-
|
20
|
-
def measures
|
21
|
-
((@rexp.payload["pheno"].payload.names - ["sex"]) | ["genotype","markerpos"])
|
22
|
-
end
|
23
|
-
|
24
|
-
def observation_labels
|
25
|
-
# row_names = @rexp.attr.payload["row.names"].to_ruby
|
26
|
-
# entries_per_individual = @rexp.payload["geno"].payload[0].payload["map"].payload.size * @rexp.payload["geno"].payload.names.size
|
27
|
-
entries_per_individual = 0
|
28
|
-
@rexp.payload["geno"].payload.to_ruby.map{|v| entries_per_individual += (v["map"].size)}
|
29
|
-
individuals = @rexp.payload["pheno"].payload.first.to_ruby.size
|
30
|
-
(1..(entries_per_individual * individuals)).to_a
|
31
|
-
end
|
32
|
-
|
33
|
-
def observation_data
|
34
|
-
|
35
|
-
data = {}
|
36
|
-
n_individuals = @rexp.payload["pheno"].payload.first.to_ruby.size
|
37
|
-
entries_per_individual = 0
|
38
|
-
@rexp.payload["geno"].payload.to_ruby.map{|v| entries_per_individual += (v["map"].size)}
|
39
|
-
# entries_per_individual = @rexp.payload["geno"].payload[row_individ].payload["map"].payload.size * @rexp.payload["geno"].payload.names.size
|
40
|
-
data["chr"] = []
|
41
|
-
data["genotype"] = []
|
42
|
-
data["individual"] = []
|
43
|
-
data["marker"] = []
|
44
|
-
data["markerpos"] = []
|
45
|
-
@rexp.payload["pheno"].payload.names.map{|name|
|
46
|
-
data[name] = []
|
47
|
-
}
|
48
|
-
n_individuals.times{|row_individ|
|
49
|
-
# puts row_individ
|
50
|
-
data["individual"] << (1..entries_per_individual).to_a.fill(row_individ)
|
51
|
-
@rexp.payload["pheno"].payload.names.map{|name|
|
52
|
-
data[name] << (1..entries_per_individual).to_a.fill(@rexp.payload["pheno"].payload[name].to_ruby[row_individ])
|
53
|
-
}
|
54
|
-
@rexp.payload["geno"].payload.names.map { |chr|
|
55
|
-
geno_chr = @rexp.payload["geno"].payload[chr]
|
56
|
-
num_markers = geno_chr.payload.first.to_ruby.column_size
|
57
|
-
data["chr"] << (1..num_markers).to_a.fill(chr)
|
58
|
-
data["genotype"] << geno_chr.payload["data"].to_ruby.row(row_individ).to_a
|
59
|
-
data["marker"] << geno_chr.payload["map"].to_ruby.names
|
60
|
-
data["markerpos"] << geno_chr.payload["map"].to_a
|
61
|
-
}
|
62
|
-
}
|
63
|
-
# data["chr"].flatten!
|
64
|
-
# data["genotype"].flatten!
|
65
|
-
data.keys.map{|k| data[k].flatten!}
|
66
|
-
|
67
|
-
#data["refRow"] = observation_labels()
|
68
|
-
data
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|