ensembl-hive  2.8.1
WormbaseCElegansUniProtParser.pm
Go to the documentation of this file.
1 =head1 LICENSE
2 
3 See the NOTICE file distributed with this work for additional information
4 regarding copyright ownership.
5 
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
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
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.
17 
18 =cut
19 use strict;
20 use warnings;
21 package XrefParser::WormbaseCElegansUniProtParser;
22 
23 # UniProt xrefs are sometimes - really - dependent xrefs of
24 # INSDC entries which we get from somewhere else
25 # Attempt to find the parent (has to already be present in the xref table)
26 # INSDC and UniProt entries have the same protein sequence, and
27 # UniProt lists INSDC as a parent. We get INSDC entries from somewhere else,
28 # so make UniProt entries dependent on INSDC entries.
29 # Note:
30 # INSDC entries have coordinates, and UniProt entries don't.
31 # So for perfect homologs, there can be many INSDC entries per UniProt.
32 
34 
35 sub upload_xref_object_graphs {
36  my ($self, $xrefs, $dbi) = @_;
37  my $source_id = $self->get_source_id_for_source_name('protein_id');
38  my $source_id_skip = $self->get_source_id_for_source_name('EMBL');
39  my @adapted_xrefs;
40  for my $xref ( @$xrefs) {
41  push @adapted_xrefs, $self->swap_dependency($source_id, $dbi, $xref, $source_id_skip);
42  }
43  return $self->SUPER::upload_xref_object_graphs(\@adapted_xrefs, $dbi);
44 }
45 1;
XrefParser::WormbaseCElegansBase
Definition: WormbaseCElegansBase.pm:2
XrefParser::UniProtParser
Definition: UniProtParser.pm:6