Skip to content

Commit

Permalink
Don't query stable_id_version for older Ensembl releases
Browse files Browse the repository at this point in the history
- Avoid retrieving stable_id_version for older Ensembl releases (issue #139).
  • Loading branch information
jorainer committed Aug 1, 2022
1 parent 92e06d4 commit 7990d10
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ensembldb
Type: Package
Title: Utilities to create and use Ensembl-based annotation databases
Version: 2.21.2
Version: 2.21.3
Authors@R: c(person(given = "Johannes", family = "Rainer",
email = "[email protected]",
role = c("aut", "cre"),
Expand Down
5 changes: 5 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Changes in version 2.21.3

- Add minimal required Ensembl API version for certain data fields
(stable_id_version). Issue https://github.com/jorainer/ensembldb/issues/139

Changes in version 2.21.1

- Since *is circular* flag for chromosomes extracted using the Ensembl Perl API
Expand Down
12 changes: 10 additions & 2 deletions inst/perl/get_gene_transcript_exon_tables.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/perl
#####################################
## version 0.3.9: * Don't query stable_id_version for Ensembl release < 75.
## version 0.3.8: * Add column tx_is_canonical to transcript table.
## version 0.3.7: * Add column tx_external_name to transcript table.
## version 0.3.6: * Add column canonical_transcript to gene table.
Expand Down Expand Up @@ -38,6 +39,7 @@
use List::MoreUtils qw/ uniq /;
my $script_version = "0.3.7";
my $min_tsl_version = 87; ## The minimal required Ensembl version providing support for the tsl method.
my $min_stable_id_version_version = 87; # minimal Ensembl version for ->stable_id_version

## connecting to the ENSEMBL data base
use Bio::EnsEMBL::Registry;
Expand Down Expand Up @@ -227,7 +229,10 @@
if(!defined($gene_external_name)){
$gene_external_name="";
}
my $gene_id_version = $gene->stable_id_version;
my $gene_id_version = "NULL";
if ($ensembl_version_num >= $min_stable_id_version_version) {
$gene_id_version = $gene->stable_id_version;
}
my $gene_biotype = $gene->biotype;
my $gene_seq_start = $gene->start;
my $gene_seq_end = $gene->end;
Expand Down Expand Up @@ -270,7 +275,10 @@
$tx_cds_end = "NULL";
}
my $tx_id = $transcript->stable_id;
my $tx_id_version = $transcript->stable_id_version;
my $tx_id_version = "NULL";
if ($ensembl_version_num >= $min_stable_id_version_version) {
$tx_id_version = $transcript->stable_id_version;
}
my $tx_biotype = $transcript->biotype;
my $tx_seq_start = $transcript->start;
my $tx_seq_end = $transcript->end;
Expand Down

0 comments on commit 7990d10

Please sign in to comment.