ensembl-hive  2.7.0
ApisMellifera.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 
20 use strict;
21 use warnings;
22 
24 
25 package SeqStoreConverter::ApisMellifera;
26 
27 use vars qw(@ISA);
28 
30 
31 
32 sub create_coord_systems {
33  my $self = shift;
34 
35  $self->debug("ApisMellifera Specific: creating " .
36  "contig and scaffold coord systems");
37 
38  my $target = $self->target();
39  my $dbh = $self->dbh();
40 
41  my $ass_def = $self->get_default_assembly();
42 
43  my @coords =
44  (["scaffold" , $ass_def, "default_version", 1 ],
45  ["contig", undef , "default_version,sequence_level", 2]);
46 
47  my @assembly_mappings = ("scaffold:$ass_def|contig");
48 
49 
50  $self->debug("Building coord_system table");
51 
52  my $sth = $dbh->prepare("INSERT INTO $target.coord_system " .
53  "(name, version, attrib, rank) VALUES (?,?,?,?)");
54 
55  my %coord_system_ids;
56 
57  foreach my $cs (@coords) {
58  $sth->execute(@$cs);
59  $coord_system_ids{$cs->[0]} = $sth->{'mysql_insertid'};
60  }
61  $sth->finish();
62 
63  $self->debug("Adding assembly.mapping entries to meta table");
64 
65  $sth = $dbh->prepare("INSERT INTO $target.meta(meta_key, meta_value) " .
66  "VALUES ('assembly.mapping', ?)");
67 
68  foreach my $mapping (@assembly_mappings) {
69  $sth->execute($mapping);
70  }
71 
72  $sth->finish();
73 
74  return;
75 }
76 
77 
78 
79 sub create_seq_regions {
80  my $self = shift;
81 
82  $self->debug( "ApisMellifera Specific: creating contig and " .
83  "scaffold seq_regions");
84 
85  $self->contig_to_seq_region('contig');
86  $self->chromosome_to_seq_region("scaffold");
87 }
88 
89 
90 sub create_assembly {
91  my $self = shift;
92 
93  $self->debug("ApisMellifera Specific: loading assembly data");
94 
95  $self->assembly_contig_chromosome();
96 }
97 
98 
99 1;
SeqStoreConverter::BasicConverter
Definition: BasicConverter.pm:3