Skip to content

Commit

Permalink
Merge pull request #605 from helensch/fix/vcf_zero_values_97
Browse files Browse the repository at this point in the history
Keep zero values in VCF - 97
  • Loading branch information
at7 authored Sep 20, 2019
2 parents d896ba4 + 7492fd2 commit 2e1aacb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
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 = 97;
our $VEP_SUB_VERSION = 3;
our $VEP_SUB_VERSION = 4;

our @EXPORT_OK = qw(
@FLAG_FIELDS
Expand Down
5 changes: 5 additions & 0 deletions modules/Bio/EnsEMBL/VEP/OutputFactory/VCF.pm
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ sub output_hash_to_vcf_info_chunk {

push @chunk, $data;
}
# keep 0 values
elsif (defined $hash->{$col}
&& ($hash->{$col} == 0)) {
push @chunk, $hash->{$col};
}
else {
push @chunk, '';
}
Expand Down
16 changes: 16 additions & 0 deletions t/OutputFactory_VCF.t
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,22 @@ is(
'output_hash_to_vcf_info_chunk - whitespace converted'
);

$of = Bio::EnsEMBL::VEP::OutputFactory::VCF->new({
config => Bio::EnsEMBL::VEP::Config->new({fields => 'Allele,SIFT'})
});

is(
$of->output_hash_to_vcf_info_chunk({Allele => 'A', SIFT => '0'}),
'A|0',
"output_hash_to_vcf_info_chunk - '0' kept"
);

is(
$of->output_hash_to_vcf_info_chunk({Allele => 'A', SIFT => 0}),
'A|0',
"output_hash_to_vcf_info_chunk - 0 kept"
);


## get_all_lines_by_InputBuffer
###############################
Expand Down

0 comments on commit 2e1aacb

Please sign in to comment.