3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
20 package XrefMapper::drosophila;
28 use
XrefMapper::BasicMapper qw(%stable_id_to_internal_id %object_xref_mappings %xref_to_source %xref_accessions %source_to_external_db);
30 my %genes_to_transcripts;
31 my %transcript_to_translation;
32 my %translation_to_transcript;
33 my %transcript_length;
35 sub gene_description_filter_regexps {
43 my $default_method =
'ExonerateGappedBest1';
44 my %override_method_for_source = (
45 ExonerateGappedBest5 => [
'RefSeq_mRNA',
'RefSeq_mRNA_predicted',
'RefSeq_ncRNA',
'RefSeq_ncRNA_predicted' ],
48 return $default_method, \%override_method_for_source;
53 # Special logic for drosophila display_xrefs:
55 # gene: flybase_name if present, else gadfly_gene_cgid
57 # transcript: flybase_name if present, else gadfly_transcript_cgid
59 my ($self, $val) = @_;
62 $self->{
'_xref_offset'} = $val;
64 return $self->{
'_xref_offset'};
67 sub gene_description_sources {
74 sub transcript_display_xref_sources {
77 my @list = qw(FlyBaseName_transcript
78 FlyBaseCGID_transcript);
82 return [\@list,\%ignore];
86 sub gene_display_xref_sources {
89 my @list = qw(FlyBaseName_gene
96 return [\@list,\%ignore];
101 sub build_genes_to_transcripts {
105 my $sql =
"SELECT gene_id, transcript_id, seq_region_start, seq_region_end FROM transcript";
106 my $sth = $self->core->dbc->prepare($sql);
109 my ($gene_id, $transcript_id, $start, $end);
110 $sth->bind_columns(\$gene_id, \$transcript_id, \$start, \$end);
112 # Note %genes_to_transcripts is global
113 while ($sth->fetch()) {
114 push @{$genes_to_transcripts{$gene_id}}, $transcript_id;
115 $transcript_length{$transcript_id} = $end- $start;
120 sub load_translation_to_transcript{
123 my $sth = $self->core->dbc->prepare(
"SELECT translation_id, transcript_id FROM translation");
126 my ($translation_id, $transcript_id);
127 $sth->bind_columns(\$translation_id, \$transcript_id);
129 while ($sth->fetch()) {
130 $translation_to_transcript{$translation_id} = $transcript_id;
131 $transcript_to_translation{$transcript_id} = $translation_id
if ($translation_id);
135 # Want to use FlyBase transcript names, rather than deriving them from genes.
136 sub transcript_names_from_gene {