diff --git a/modules/Bio/EnsEMBL/VEP/OutputFactory/VCF.pm b/modules/Bio/EnsEMBL/VEP/OutputFactory/VCF.pm index f4b425b65..4beae3fef 100755 --- a/modules/Bio/EnsEMBL/VEP/OutputFactory/VCF.pm +++ b/modules/Bio/EnsEMBL/VEP/OutputFactory/VCF.pm @@ -204,8 +204,9 @@ sub headers { # add VEP version string push @headers, sprintf( - '##VEP="v%i" time="%s"%s%s', + '##VEP="v%s" API="v%s" time="%s"%s%s', $info->{vep_version}, + $info->{api_version}, $info->{time}, $info->{cache_dir} ? ' cache="'.$info->{cache_dir}.'"' : '', $info->{db_name} ? ' db="'.$info->{db_name}.'@'.$info->{db_host}.'"' : '' diff --git a/modules/Bio/EnsEMBL/VEP/Stats.pm b/modules/Bio/EnsEMBL/VEP/Stats.pm index 3d986d44d..048bdb48d 100644 --- a/modules/Bio/EnsEMBL/VEP/Stats.pm +++ b/modules/Bio/EnsEMBL/VEP/Stats.pm @@ -478,8 +478,9 @@ sub finished_stats { } $self->{finished_stats} = { - charts => $self->generate_chart_data($stats), - run_stats => $self->generate_run_stats($stats), + charts => $self->generate_chart_data($stats), + run_stats => $self->generate_run_stats($stats), + data_version => $self->generate_data_version(), general_stats => $self->generate_general_stats($stats), } } @@ -648,18 +649,13 @@ sub generate_run_stats { ['Start time', $self->start_time], ['End time', $self->end_time], ['Run time', $self->run_time." seconds"], - ['Input file', $self->param('input_file')], - [ - 'Output file', - $self->param('output_file')#. - # (defined($config->{html}) ? ' '.a({href => $config->{output_file}.'.html'}, '[HTML]') : ''). - # ' '.a({href => $config->{output_file}}, '[text]') - ], + ['Input file', "
".$self->param('input_file')."
"], + ['Output file', "
".$self->param('output_file')."
"], ); my @cache_db_strings; if($info->{cache_dir}) { - push @cache_db_strings, "Cache: ".$info->{cache_dir}; + push @cache_db_strings, "Cache: ".$info->{cache_dir}.""; } if($self->param('database') or ($self->param('cache') && !$self->param('offline'))) { push @cache_db_strings, sprintf('%s on %s', $info->{db_name}, $info->{db_host}); @@ -669,8 +665,27 @@ sub generate_run_stats { } unshift @return, ['Annotation sources', join("; ", @cache_db_strings)]; - unshift @return, ['VEP version (API)', sprintf(' %i (%i)', $info->{vep_version}, $info->{api_version})]; + unshift @return, ['VEP version (API)', sprintf(' %s (%s)', $info->{vep_version}, $info->{api_version})]; + + return \@return; +} + + +=head2 generate_data_version + + Example : $run_stats = $stats->generate_data_version(); + Description: Generates data version information. + Returntype : arrayref + Exceptions : none + Caller : finished_stats() + Status : Stable +=cut + +sub generate_data_version { + my $self = shift; + my %version_data = %{ $self->{info}->{version_data} }; + my @return = map { [ $_, $version_data{$_} ] } sort keys %version_data; return \@return; } @@ -786,7 +801,10 @@ sub dump_text { print $fh "[VEP run statistics]\n"; print $fh join("\t", map {s/\<.+?\>//g; $_} @{$_})."\n" for @{$finished_stats->{run_stats}}; - + + print $fh "[Data version]\n"; + print $fh join("\t", map {s/\<.+?\>//g; $_} @{$_})."\n" for @{$finished_stats->{data_version}}; + print $fh "\n[General statistics]\n"; print $fh join("\t", map {s/\<.+?\>//g; $_} grep {defined($_)} @{$_})."\n" for @{$finished_stats->{general_stats}}; @@ -828,6 +846,7 @@ sub dump_html { join('', map {sprintf('
  • %s
  • ', $_->[0], $_->[1])} ( ['masthead', 'Top of page'], ['run_stats', 'VEP run statistics'], + ['data_version', 'Data version'], ['gen_stats', 'General statistics'], map { [$_->{id}, $_->{title}] @@ -844,7 +863,13 @@ sub dump_html { ''. join('', map {''.join('', map {''} @$_).''} @{$finished_stats->{run_stats}}). '
    '.$_.'
    '; - + + print $fh + '

    Data version

    '. + ''. + join('', map {''.join('', map {''} @$_).''} @{$finished_stats->{data_version}}). + '
    '.$_.'
    '; + # vars in/out stats print $fh '

    General statistics

    '. @@ -1007,10 +1032,22 @@ sub stats_html_head { .stats_table { margin: 5px; + table-layout: fixed; + width: 100%; } - + + pre { + white-space: normal; + word-break: keep-all; + } + td { padding: 5px; + word-break: break-word; + } + + td:nth-child(2) { + width: 80%; } th.gradient { diff --git a/t/OutputFactory.t b/t/OutputFactory.t index 6397556ed..604d17826 100644 --- a/t/OutputFactory.t +++ b/t/OutputFactory.t @@ -2035,8 +2035,8 @@ $ib = get_annotated_buffer({ }); $of->{individual_zyg} = ['dave,barry']; -my $result = $of->VariationFeature_to_output_hash($ib->buffer->[0]); -my $genotype = join ',', sort(@{$result->{ZYG}}); +$result = $of->VariationFeature_to_output_hash($ib->buffer->[0]); +$genotype = join ',', sort(@{$result->{ZYG}}); is($genotype, 'barry:HOM,dave:HET', 'VariationFeature_to_output_hash - individual_zyg correct sample name'); delete($of->{individual_zyg}); diff --git a/t/OutputFactory_VCF.t b/t/OutputFactory_VCF.t index 02acb4dce..1f22b9d44 100644 --- a/t/OutputFactory_VCF.t +++ b/t/OutputFactory_VCF.t @@ -52,7 +52,7 @@ cmp_deeply( $of->headers, [ '##fileformat=VCFv4.1', - '##VEP="v1" time="test"', + '##VEP="v1" API="v1" time="test"', '##INFO=', '##INFO=', re('\#\#VEP-command-line=\'vep'),