bsi-pipeline 0.0.5 → 0.0.6
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/bsi-pipeline/importer.rb +15 -11
- data/lib/bsi-pipeline/version.rb +1 -1
- data/spec/add_batch_spec.rb +1 -0
- 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: 50e0b28ec4df04a63b0d9c6a530b36c30e7072b7
|
4
|
+
data.tar.gz: 58b68121e0ea1345f0321d00d46ef63f2f3b1a9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67ba71b202d5062375f2585f580f2dd589d520217ffe039b01de598e2877092b70078b56e7e1fbfea3d35872c41501b5570e2cf13c3d894f3e629f9c2d0353aa
|
7
|
+
data.tar.gz: aeb9871c95343cc74790eee7bb9661dc280715d412d790be1dcab265504c6eb115b36ec15c3d326ababb59f363858ee530f41103a615855abf5fee5e32ee8c96
|
@@ -56,7 +56,7 @@ module Pipeline
|
|
56
56
|
specimen_family.each_with_index do |spec, i|
|
57
57
|
# Assign sample and sequence numbers
|
58
58
|
spec.sample_id = family_sample_id
|
59
|
-
spec.sequence
|
59
|
+
spec.sequence = i+1
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -81,21 +81,25 @@ module Pipeline
|
|
81
81
|
|
82
82
|
def import(all_specimens, options={})
|
83
83
|
@specimens = all_specimens
|
84
|
+
study_ids = @specimens.map{|e| e.study_id}.uniq
|
84
85
|
subject_ids = @specimens.map{|e| e.subject_id}.uniq
|
85
86
|
|
86
|
-
|
87
|
-
|
88
|
-
|
87
|
+
study_ids.each do |study|
|
88
|
+
subject_ids.each_with_index do |sid, i|
|
89
|
+
# Filter by subject_id and study_id
|
90
|
+
subset = @specimens.select{|e| e.study_id == study && e.subject_id == sid}
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
-
|
92
|
+
batch_properties = {
|
93
|
+
'batch.description' => "Subject: #{sid}",
|
94
|
+
'batch.study_id' => study.to_s
|
95
|
+
}
|
93
96
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
+
@batch = AddBatch.new(@bsi, batch_properties)
|
98
|
+
@batch.add_specimens(subset)
|
99
|
+
@batch.commit if options['commit']
|
97
100
|
|
98
|
-
|
101
|
+
@batches << @batch
|
102
|
+
end
|
99
103
|
end
|
100
104
|
|
101
105
|
@bsi.common.logoff
|
data/lib/bsi-pipeline/version.rb
CHANGED
data/spec/add_batch_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bsi-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elijah Christensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|