Skip to content

Commit

Permalink
Merge pull request #755 from aparton/bugfix/shiftvcf
Browse files Browse the repository at this point in the history
Reset shifted positions correctly for VCF and JSON output
  • Loading branch information
at7 authored May 15, 2020
2 parents 4e307de + d14c046 commit 3e10cd3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/Constants.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use warnings;
use base qw(Exporter);

our $VEP_VERSION = 100;
our $VEP_SUB_VERSION = 0;
our $VEP_SUB_VERSION = 1;

our @EXPORT_OK = qw(
@FLAG_FIELDS
Expand Down
3 changes: 3 additions & 0 deletions modules/Bio/EnsEMBL/VEP/OutputFactory/JSON.pm
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ sub get_all_output_hashes_by_InputBuffer {
my $self = shift;
my $buffer = shift;

map {@{$self->reset_shifted_positions($_)}}
@{$buffer->buffer};

$self->rejoin_variants_in_InputBuffer($buffer) if $buffer->rejoin_required;

my @return;
Expand Down
3 changes: 3 additions & 0 deletions modules/Bio/EnsEMBL/VEP/OutputFactory/VCF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ sub get_all_lines_by_InputBuffer {

my @return;

map {@{$self->reset_shifted_positions($_)}}
@{$buffer->buffer};

foreach my $vf(@{$buffer->buffer}) {

my $line;
Expand Down
10 changes: 5 additions & 5 deletions t/OutputFactory_JSON.t
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ SKIP: {
{map {$_->{variant_allele} => $_} @{$json->decode($of->get_all_lines_by_InputBuffer($ib)->[0])->{transcript_consequences}}},
{
'-' => {
'cds_start' => 68,
'cds_start' => 67,
'gene_id' => 'ENSG00000154727',
'variant_allele' => '-',
'cdna_end' => 603,
Expand All @@ -422,7 +422,7 @@ SKIP: {
'protein_end' => 26,
'strand' => 1,
'amino_acids' => 'KKKG/S',
'cdna_start' => 595,
'cdna_start' => 594,
'transcript_id' => 'ENST00000354828',
'impact' => 'MODERATE',
'allele_num' => 2,
Expand All @@ -431,14 +431,14 @@ SKIP: {
'cds_start' => 67,
'gene_id' => 'ENSG00000154727',
'variant_allele' => 'T',
'cdna_end' => 594,
'cdna_end' => 603,
'protein_start' => 23,
'codons' => 'Cca/Tca',
'cds_end' => 67,
'cds_end' => 76,
'consequence_terms' => [
'missense_variant'
],
'protein_end' => 23,
'protein_end' => 26,
'strand' => 1,
'amino_acids' => 'P/S',
'cdna_start' => 594,
Expand Down

0 comments on commit 3e10cd3

Please sign in to comment.