Skip to content

Commit

Permalink
hack fix for refseq transcripts missing gene symbol data
Browse files Browse the repository at this point in the history
  • Loading branch information
William McLaren committed Mar 31, 2015
1 parent df29344 commit e06a7d8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions modules/Bio/EnsEMBL/Variation/Utils/VEP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3445,6 +3445,7 @@ sub fetch_transcripts {

## hack to copy HGNC IDs
my %hgnc_ids = ();
my %refseq_stuff = ();

# add loaded transcripts to main cache
if(defined($tmp_cache->{$chr})) {
Expand Down Expand Up @@ -3500,14 +3501,23 @@ sub fetch_transcripts {
## hack to copy HGNC IDs
$hgnc_ids{$tr->{_gene_symbol}} = $tr->{_gene_hgnc_id} if defined($tr->{_gene_hgnc_id});

## hack to copy RefSeq gene stuff
if(defined($config->{refseq}) || defined($config->{merged})) {
$refseq_stuff{$tr->{_gene}->stable_id}->{$_} ||= $tr->{$_} for qw(_gene_symbol _gene_symbol_source _gene_hgnc_id);
}

$seen_trs{$dbID} = 1;

push @{$tr_cache->{$chr}}, $tr;
}

## hack to copy HGNC IDs
for(@{$tr_cache->{$chr}}) {
$_->{_gene_hgnc_id} = $hgnc_ids{$_->{_gene_symbol}} if defined($_->{_gene_symbol}) && defined($hgnc_ids{$_->{_gene_symbol}});
## hack to copy HGNC IDs and RefSeq stuff
foreach my $tr(@{$tr_cache->{$chr}}) {
$tr->{_gene_hgnc_id} = $hgnc_ids{$tr->{_gene_symbol}} if defined($tr->{_gene_symbol}) && defined($hgnc_ids{$tr->{_gene_symbol}});

if(defined($config->{refseq}) || defined($config->{merged})) {
$tr->{$_} ||= $refseq_stuff{$tr->{_gene}->stable_id}->{$_} for qw(_gene_symbol _gene_symbol_source _gene_hgnc_id);
}
}
}

Expand Down

0 comments on commit e06a7d8

Please sign in to comment.