Skip to content

Commit

Permalink
Fixing filter when value is hash and contain text and number
Browse files Browse the repository at this point in the history
  • Loading branch information
likhitha-surapaneni committed Aug 9, 2024
1 parent 9ffc8fd commit 7ce6a4c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/Bio/EnsEMBL/VEP/FilterSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,18 @@ sub get_input {

my ($text, $num) = ($1, $2);

if($num ne '') {
if($num ne "") {
## Value can also be a HASH, we pick a key to make it scalar
## Assumes that all the values are of similar format
if (ref $value eq "HASH") {
$value = (keys %{$value})[0];
}
if($value && $value =~ /^[\-\d\.e]+$/) {
$input = $text =~ /^\-?\d+\.?\d*(e\-?\d+)?$/ ? $text : $num;
}
elsif($value =~ /([\w\.\-]+)?\:?\(?([\-\d\.e]*)\)?/) {
return $input;
}
else {
$input = $text;
}
Expand Down

0 comments on commit 7ce6a4c

Please sign in to comment.