determinations_comparison 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/determinations_comparison.rb +39 -32
- data/lib/determinations_comparison/version.rb +1 -1
- 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: 79959ff2127c7711cea316f073102ea1b989b535
|
4
|
+
data.tar.gz: 5ef63457ad94ad279643ed0c66588f8a4fa5900a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a95afd74682cc4aa92c76ec1f67ab6e4f97dd623914a744f33cd3159fd5427e4a3fbfc3247ad9adf9fa36256156fa69c39f9bd1941a2c208c636fef1a6094e0
|
7
|
+
data.tar.gz: 386971b6139d45c32fc2ff55a968dcea2af31f423a3182d657c7a037eb1fbf5a145942d846c84753654b772978c1fb684aafb6549499a351293ca2bba120ad7f
|
@@ -150,58 +150,65 @@ module DeterminationsComparison
|
|
150
150
|
|
151
151
|
hashCategory = Hash.new
|
152
152
|
|
153
|
+
# peak picked by baseline and not undertest?
|
154
|
+
arr = Array.new
|
153
155
|
@hashDiffs.each_pair do |chrom,hashChrom|
|
154
156
|
|
155
|
-
|
157
|
+
hash = Hash.new
|
158
|
+
|
156
159
|
if hashChrom['peak_picked'] == 'by baseline but not by undertest'
|
157
|
-
|
160
|
+
hash[:desc] = "peak picked #{hashChrom['peak_picked']}"
|
161
|
+
hash[:chrom] = chrom.to_s
|
162
|
+
hash[:per_diff] = 100 # temporarily using per_diff for a severity level
|
163
|
+
arr << hash
|
158
164
|
end
|
159
165
|
|
160
|
-
break unless
|
166
|
+
break unless arr.empty?
|
161
167
|
|
162
168
|
if hashChrom['peak_picked'] == 'by baseline (simpsons rule) but not by undertest'
|
163
|
-
|
169
|
+
hash[:desc] = "peak picked #{hashChrom['peak_picked']}"
|
170
|
+
hash[:chrom] = chrom.to_s
|
171
|
+
hash[:per_diff] = 50
|
172
|
+
arr << hash
|
164
173
|
end
|
165
174
|
|
166
|
-
|
175
|
+
end
|
167
176
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
hashCategory[:per_diff] = per_diff
|
174
|
-
end
|
177
|
+
unless arr.empty?
|
178
|
+
arr.sort_by! { |h| h[:per_diff] }
|
179
|
+
arr.first.delete(:per_diff)
|
180
|
+
return arr.first
|
181
|
+
end
|
175
182
|
|
176
|
-
break unless hashCategory.empty?
|
177
183
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
hashCategory[:per_diff] = per_diff
|
184
|
-
end
|
184
|
+
# area, apex_time, apex_intensity within threshold?
|
185
|
+
[:area,:apex_time,:apex_intensity].each do |prop|
|
186
|
+
|
187
|
+
arr = Array.new
|
188
|
+
@hashDiffs.each_pair do |chrom,hashChrom|
|
185
189
|
|
186
|
-
|
190
|
+
hash = Hash.new
|
191
|
+
|
192
|
+
per_diff = hashChrom['peak'][prop.to_s][:percent_diff]
|
193
|
+
threshold = hashPropertyThresholds[prop]
|
194
|
+
|
195
|
+
if per_diff > threshold
|
196
|
+
hash[:desc] = "difference in #{prop.to_s}"
|
197
|
+
hash[:per_diff] = per_diff
|
198
|
+
end
|
187
199
|
|
188
|
-
# apex intensity within threshould
|
189
|
-
per_diff = hashChrom['peak']['apex_intensity'][:percent_diff]
|
190
|
-
threshold = hashPropertyThresholds[:apex_intensity]
|
191
|
-
if per_diff > threshold
|
192
|
-
hashCategory[:desc] = 'difference in apex_intensity'
|
193
|
-
hashCategory[:per_diff] = per_diff
|
194
200
|
end
|
195
201
|
|
196
|
-
|
202
|
+
unless arr.empty?
|
203
|
+
arr.sort_by! { |h| h[:per_diff] }.reverse
|
204
|
+
return arr.first
|
205
|
+
end
|
197
206
|
|
198
207
|
end
|
199
208
|
|
200
|
-
|
201
|
-
hashCategory[:desc] = 'match within thresholds'
|
202
|
-
end
|
209
|
+
hash[:desc] = 'match within thresholds'
|
203
210
|
|
204
|
-
return
|
211
|
+
return hash
|
205
212
|
|
206
213
|
end
|
207
214
|
|