@@ -205,40 +205,21 @@ sub run {
205
205
206
206
# Pull out MechPredict prediction data for gene_name
207
207
my ( $pdn , $pgof , $plof ) = @{$gene_data }{qw( pDN pGOF pLOF) };
208
-
208
+
209
+ # Compare values to thresholds and populate prediction
209
210
# Create prediction field
210
211
my $prediction = " " ;
211
212
212
- # Compare values to thresholds and populate prediction
213
- # This does not provide prediction for the following cases:
214
- # - Two probabilities are high at the same time
215
- # - All probabilities are below their respective thresholds
216
- # - All probabilities are above their respective thresholds
217
- # Instead, these end up categoried as "no_conclusive_mechanism_detected"
218
- if ( $pdn >= $thresholds {pdn }
219
- && $pgof < $thresholds {pgof }
220
- && $plof < $thresholds {plof } )
221
- {
222
- $prediction =
223
- " gene_predicted_as_associated_with_dominant_negative_mechanism" ;
224
- }
225
- elsif ($pgof >= $thresholds {pgof }
226
- && $pdn < $thresholds {pdn }
227
- && $plof < $thresholds {plof } )
228
- {
229
- $prediction =
230
- " gene_predicted_as_associated_with_gain_of_function_mechanism" ;
231
- }
232
- elsif ($plof >= $thresholds {plof }
233
- && $pgof < $thresholds {pgof }
234
- && $pdn < $thresholds {pdn } )
235
- {
236
- $prediction =
237
- " gene_predicted_as_associated_with_loss_of_function_mechanism" ;
238
- }
239
- else {
240
- $prediction = " no_conclusive_mechanism_predicted" ;
241
- }
213
+ # Check each value against its threshold and append to prediction
214
+ $prediction .= " gene_predicted_as_associated_with_dominant_negative_mechanism, " if $pdn >= $thresholds {pdn };
215
+ $prediction .= " gene_predicted_as_associated_with_gain_of_function_mechanism, " if $pgof >= $thresholds {pgof };
216
+ $prediction .= " gene_predicted_as_associated_with_loss_of_function_mechanism, " if $plof >= $thresholds {plof };
217
+
218
+ # Remove trailing comma and space if
219
+ $prediction =~ s / , $// ;
220
+
221
+ # If no predictions met the threshold, assign a default message
222
+ $prediction = " no_conclusive_mechanism_predicted" if $prediction eq " " ;
242
223
243
224
# Add the data to the VEP output
244
225
return {
0 commit comments