Skip to content

Commit

Permalink
Merge pull request #1338 from Ensembl/revert-1317-refactor_custom
Browse files Browse the repository at this point in the history
Revert "refactor: add non-ordered options to custom"
  • Loading branch information
diegomscoelho committed Jan 18, 2023
2 parents ddb3116 + be5217a commit 2274c61
Show file tree
Hide file tree
Showing 130 changed files with 235 additions and 229 deletions.
2 changes: 1 addition & 1 deletion INSTALL.pl
Expand Up @@ -3,7 +3,7 @@
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Expand Up @@ -187,7 +187,7 @@
identification within third-party archives.

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion convert_cache.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2022] EMBL-European Bioinformatics Institute
# Copyright [2016-2023] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion filter_vep
Expand Up @@ -3,7 +3,7 @@
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion haplo
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright [2016-2022] EMBL-European Bioinformatics Institute
# Copyright [2016-2023] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
6 changes: 5 additions & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -171,6 +171,10 @@ sub get_all_regions_by_InputBuffer {
my ($min, $max) = (1e10, 0);

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

# skip long and unsupported types of SV; doing this here to avoid stopping looping
next if $vf->{vep_skip};

my $chr = $vf->{chr} || $vf->slice->seq_region_name;
throw("ERROR: Cannot get chromosome from VariationFeature") unless $chr;

Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/Cache.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/Cache/RegFeat.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/Database.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/File.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/File/BED.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/File/BaseGXF.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/File/BigWig.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/File/GFF.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/File/GTF.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource/File/VCF.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
36 changes: 14 additions & 22 deletions modules/Bio/EnsEMBL/VEP/AnnotationSourceAdaptor.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -204,43 +204,35 @@ sub get_all_custom {
my @as;

foreach my $custom_string(@{$self->param('custom') || []}) {
my (@params) = split /\,/, $custom_string;
my ($file, $short_name, $format, $type, $report_coords, @fields) = split /\,/, $custom_string;

my %hash = ();
throw("ERROR: No format specified for custom annotation source $file\n") unless $format;

foreach my $param(@params) {
my ($key, $val) = split('=', $param);
die("ERROR: Failed to parse parameter $param; Please add $param=<VALUE_OF_PARAMETER>\n") unless defined($key) && defined($val);
$hash{$key} = $val;
}

throw("ERROR: No 'file=' was added for custom annotation source.\nLINE: --custom $custom_string\n") unless defined($hash{"file"});
throw("ERROR: No 'format=' specified for custom annotation source.\nLINE: --custom $custom_string\n") unless defined($hash{"format"});
throw("ERROR: Access to remote data files disabled\n") if $self->param('no_remote') && $hash{"file"} =~ /^(ht|f)tp:\/\/.+/;
throw("ERROR: Access to remote data files disabled\n") if $self->param('no_remote') && $file =~ /^(ht|f)tp:\/\/.+/;

my $opts = {
config => $self->config,
file => $hash{"file"},
short_name => $hash{"short_name"} || $hash{"file"},
format => $hash{"format"},
type => $hash{"type"} || "overlap",
report_coords => $hash{"coords"} || 0,
file => $file,
short_name => $short_name,
format => $format,
type => $type,
report_coords => $report_coords,
};

if(defined($hash{"format"}) && $hash{"format"} =~ /^G[TF]F$/i) {
if($format =~ /^G[TF]F$/i) {
$opts->{filter} = $self->param('transcript_filter');
$opts->{bam} = $self->param('bam');
}

$opts->{fields} = [split /%/, $hash{"fields"}] if $hash{"fields"};
$opts->{fields} = \@fields if @fields;

if (grep { /\#\#\#CHR\#\#\#/ } $hash{"file"}){
if (grep { /\#\#\#CHR\#\#\#/ } $file){

my @valid_chromosomes = keys %{$self->chr_lengths} > 0 ? sort keys %{$self->chr_lengths}: ((1..22), qw(X Y MT));

foreach my $chr (@valid_chromosomes){
print $chr."\n";
my $new_file = $hash{"file"};
my $new_file = $file;
my $new_opts = { %$opts };
$new_file =~ s/\#\#\#CHR\#\#\#/$chr/;
next unless ( -e $new_file || head($new_file) );
Expand All @@ -249,7 +241,7 @@ sub get_all_custom {
}

# Non-match ###CHR### pattern scenario
die "Error: No files with pattern " . $hash{"file"} . " were found\n" unless @as;
die "Error: No files with pattern $file were found\n" unless @as;

} else {
push @as, Bio::EnsEMBL::VEP::AnnotationSource::File->new($opts);
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationType/RegFeat.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationType/Transcript.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationType/Variation.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/BaseRunner.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/BaseVEP.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/CacheDir.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 8 additions & 8 deletions modules/Bio/EnsEMBL/VEP/Config.pm
@@ -1,6 +1,6 @@
=head1 LICENSE
Copyright [2016-2022] EMBL-European Bioinformatics Institute
Copyright [2016-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -95,7 +95,7 @@ our %DEFAULTS = (
failed => 0,
core_type => 'core',
polyphen_analysis => 'humvar',
pick_order => [qw(canonical appris tsl biotype ccds rank length ensembl refseq mane)],
pick_order => [qw(mane canonical appris tsl biotype ccds rank length ensembl refseq )],
terminal_width => 48,
vcf_info_field => 'CSQ',
ucsc_data_root => 'http://hgdownload.cse.ucsc.edu/goldenpath/',
Expand Down Expand Up @@ -303,14 +303,14 @@ our @OPTION_SETS = (
{
flags => ['gff'],
set => {
custom => 'file=%gff%,format=gff'
custom => '%gff%,,gff'
}
},

{
flags => ['gtf'],
set => {
custom => 'file=%gtf%,format=gtf'
custom => '%gtf%,,gtf'
}
},

Expand Down Expand Up @@ -380,8 +380,7 @@ our %REQUIRES = (
original => [qw(filters)],
phyloP => [qw(ucsc_assembly)],
phastCons => [qw(ucsc_assembly)],
custom_multi_allelic => [qw(custom)],
ga4gh_vrs => [qw(json)]
custom_multi_allelic => [qw(custom)]
);

# incompatible options
Expand All @@ -397,7 +396,8 @@ our %INCOMPATIBLE = (
tab => [qw(vcf json)],
individual => [qw(minimal)],
check_ref => [qw(lookup_ref)],
check_svs => [qw(offline)]
check_svs => [qw(offline)],
ga4gh_vrs => [qw(vcf)]
);

# deprecated/replaced flags
Expand Down Expand Up @@ -487,7 +487,7 @@ sub new {
$config->{cache} = 1;
}

my $config_command;
my $config_command = "";

my @skip_opts = qw(web_output host port stats_file user warning_file input_data);

Expand Down

0 comments on commit 2274c61

Please sign in to comment.