Skip to content

Commit a2b5c95

Browse files
fix: output all predicted mechanisms
1 parent 1946a21 commit a2b5c95

File tree

1 file changed

+12
-31
lines changed

1 file changed

+12
-31
lines changed

MechPredict.pm

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -205,40 +205,21 @@ sub run {
205205

206206
# Pull out MechPredict prediction data for gene_name
207207
my ( $pdn, $pgof, $plof ) = @{$gene_data}{qw(pDN pGOF pLOF)};
208-
208+
209+
# Compare values to thresholds and populate prediction
209210
# Create prediction field
210211
my $prediction = "";
211212

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 "";
242223

243224
# Add the data to the VEP output
244225
return {

0 commit comments

Comments
 (0)