From e570f5cc854d9b905a00488a456ff80d8245601f Mon Sep 17 00:00:00 2001 From: aparton Date: Tue, 27 Nov 2018 09:57:48 +0000 Subject: [PATCH] Updated xref dumping code --- .../VEP/AnnotationSource/Database/Transcript.pm | 2 +- modules/Bio/EnsEMBL/VEP/AnnotationType/Transcript.pm | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/Bio/EnsEMBL/VEP/AnnotationSource/Database/Transcript.pm b/modules/Bio/EnsEMBL/VEP/AnnotationSource/Database/Transcript.pm index fb7430ad9..e04debcfc 100755 --- a/modules/Bio/EnsEMBL/VEP/AnnotationSource/Database/Transcript.pm +++ b/modules/Bio/EnsEMBL/VEP/AnnotationSource/Database/Transcript.pm @@ -542,7 +542,7 @@ sub prefetch_gene_ids { { my $xref_obj = $tr->{_gene}->display_xref; $tr->get_Gene()->stable_id($entries[0]->{primary_id}); - $tr->{_gene_symbol} = $xref_obj ? $xref_obj->display_id : $entries[0]->{primary_id}; + $tr->{_gene_symbol} = $xref_obj ? $xref_obj->display_id : $entries[0]->{display_id}; $tr->{_gene_symbol_source} = $entries[0]->{dbname}; $tr->{_gene_symbol_id} = $entries[0]->{primary_id}; $tr->{_gene_hgnc_id} = $entries[0]->{primary_id} if $entries[0]->{dbname} eq 'HGNC'; diff --git a/modules/Bio/EnsEMBL/VEP/AnnotationType/Transcript.pm b/modules/Bio/EnsEMBL/VEP/AnnotationType/Transcript.pm index e8ecc43d8..d843b7d76 100644 --- a/modules/Bio/EnsEMBL/VEP/AnnotationType/Transcript.pm +++ b/modules/Bio/EnsEMBL/VEP/AnnotationType/Transcript.pm @@ -211,14 +211,18 @@ sub filter_transcript { # or 4540 for MT transcripts ( $self->{source_type} eq 'refseq' && - ($t->stable_id || '') !~ /^[A-Z]{2}\_\d+|^\d{4}$/ - ) || + !(($t->stable_id || '') =~ /^[A-Z]{2}\_\d+|^\d{4}$/ || + (defined($t->display_xref) && ($t->display_xref->{display_id} || '') =~ /^[A-Z]{2}\_\d+|^\d{4}$/)) + ) + + || # and the same from the merged cache ( $self->{source_type} eq 'merged' && ($t->{_source_cache} || '') eq 'RefSeq' && - ($t->stable_id || '') !~ /^[A-Z]{2}\_\d+|^\d{4}$/ + !(($t->stable_id || '') =~ /^[A-Z]{2}\_\d+|^\d{4}$/ || + (defined($t->display_xref) && ($t->display_xref->{display_id} || '') =~ /^[A-Z]{2}\_\d+|^\d{4}$/)) ) ) ) {