Commit d836fc70 authored by Andy Yates's avatar Andy Yates
Browse files

[ENSCORESW-475] fixing the dbentry return to prioritise genes, transcripts and...

[ENSCORESW-475] fixing the dbentry return to prioritise genes, transcripts and translations found on reference slices
parent a640851c
......@@ -837,12 +837,12 @@ sub fetch_all_by_external_name {
my @ids = $entryAdaptor->list_gene_ids_by_extids($external_name, $external_db_name, $override);
my %genes_by_dbIDs =
map { $_->dbID(), $_ } @{$self->fetch_all_by_dbID_list(\@ids)};
my %genes_by_dbIDs = map { $_->dbID(), $_ } @{$self->fetch_all_by_dbID_list(\@ids)};
my @result = map { $genes_by_dbIDs{$_} } @ids;
return \@result;
my @features = map { $genes_by_dbIDs{$_} } @ids;
my @reference = grep { $_->slice()->is_reference() } @features;
my @non_reference = grep { ! $_->slice()->is_reference() } @features;
return [ @reference, @non_reference ];
}
=head2 fetch_all_by_description
......
......@@ -519,7 +519,10 @@ sub fetch_all_by_external_name {
$entryAdaptor->list_transcript_ids_by_extids( $external_name,
$external_db_name, $override );
return $self->fetch_all_by_dbID_list( \@ids );
my @features = @{ $self->fetch_all_by_dbID_list( \@ids ) };
my @reference = grep { $_->slice()->is_reference() } @features;
my @non_reference = grep { ! $_->slice()->is_reference() } @features;
return [ @reference, @non_reference ];
}
=head2 fetch_all_by_GOTerm
......
......@@ -313,16 +313,23 @@ sub fetch_all_by_external_name {
my $transcript_adaptor = $self->db()->get_TranscriptAdaptor();
my @out;
my @reference;
my @non_reference;
foreach my $id (@ids) {
my $transcript = $transcript_adaptor->fetch_by_translation_id($id);
if ( defined($transcript) ) {
push @out, $self->fetch_by_Transcript($transcript);
my $translation = $self->fetch_by_Transcript($transcript);
if($transcript->slice()->is_reference()) {
push(@reference, $translation);
}
else {
push(@non_reference, $translation);
}
}
}
return \@out;
return [@reference, @non_reference];
}
=head2 fetch_all_by_GOTerm
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment