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.
25 package SeqStoreConverter::ApisMellifera;
32 sub create_coord_systems {
35 $self->debug(
"ApisMellifera Specific: creating " .
36 "contig and scaffold coord systems");
38 my $target = $self->target();
39 my $dbh = $self->dbh();
41 my $ass_def = $self->get_default_assembly();
44 ([
"scaffold" , $ass_def,
"default_version", 1 ],
45 [
"contig", undef ,
"default_version,sequence_level", 2]);
47 my @assembly_mappings = (
"scaffold:$ass_def|contig");
50 $self->debug(
"Building coord_system table");
52 my $sth = $dbh->prepare(
"INSERT INTO $target.coord_system " .
53 "(name, version, attrib, rank) VALUES (?,?,?,?)");
57 foreach my $cs (@coords) {
59 $coord_system_ids{$cs->[0]} = $sth->{
'mysql_insertid'};
63 $self->debug(
"Adding assembly.mapping entries to meta table");
65 $sth = $dbh->prepare(
"INSERT INTO $target.meta(meta_key, meta_value) " .
66 "VALUES ('assembly.mapping', ?)");
68 foreach my $mapping (@assembly_mappings) {
69 $sth->execute($mapping);
79 sub create_seq_regions {
82 $self->debug(
"ApisMellifera Specific: creating contig and " .
83 "scaffold seq_regions");
85 $self->contig_to_seq_region(
'contig');
86 $self->chromosome_to_seq_region(
"scaffold");
93 $self->debug(
"ApisMellifera Specific: loading assembly data");
95 $self->assembly_contig_chromosome();