Skip to content

Commit

Permalink
Merge branch 'postreleasefix/110'
Browse files Browse the repository at this point in the history
  • Loading branch information
nakib103 committed May 2, 2023
2 parents 34fa8b6 + 4ea46ce commit 5b93c94
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/Bio/EnsEMBL/VEP/Parser/HGVS.pm
Expand Up @@ -166,6 +166,7 @@ sub create_VariationFeatures {
my $vfa = $self->get_adaptor('variation', 'VariationFeature');
my $vfs = [];
my @errors;
my $max_size = $self->param('max_sv_size') || 5000;

foreach my $core_group(@core_groups) {
next if (($hgvs =~ /NM_/ || $hgvs =~ /XM_/) && $core_group eq 'core');
Expand All @@ -180,6 +181,7 @@ sub create_VariationFeatures {
-slice_adaptor => $sa,
-transcript_adaptor => $ta,
-replace_ref => $self->{lookup_ref} || 0,
-max_size => $max_size,
);
}
else {
Expand All @@ -188,6 +190,7 @@ sub create_VariationFeatures {
-slice_adaptor => $sa,
-transcript_adaptor => $ta,
-replace_ref => $self->{lookup_ref} || 0,
-max_size => $max_size,
);
}
};
Expand All @@ -199,10 +202,14 @@ sub create_VariationFeatures {
}

unless(@$vfs || scalar(@errors) == 0) {
my %known_messages_hash = ('MSG: Region requested must be smaller than 5kb' => 0);
my %known_messages_hash = ("MSG: Region requested must be smaller than $max_size" => 0);

my @grep_names = grep(/^MSG:/, split(/\n/, $errors[0]));
my @error_message = exists( $known_messages_hash{$grep_names[0]}) ? @grep_names : @errors;
my @error_message = @errors;
if (exists( $known_messages_hash{$grep_names[0]})) {
$grep_names[0] .= ". This value can be adjusted with --max_sv_size.";
@error_message = @grep_names;
}

$self->warning_msg("WARNING: Unable to parse HGVS notation \'$hgvs\'\n".join("\n", @error_message));
return $self->create_VariationFeatures;
Expand Down

0 comments on commit 5b93c94

Please sign in to comment.