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.
26 package SeqStoreConverter::FuguRubripes;
33 sub create_coord_systems {
36 $self->debug(
"FuguRubripes Specific: creating scaffold coord system");
39 # Load the coord system table.
40 # Fugu has only one coord system : scaffold
42 my $default_assembly = $self->get_default_assembly();
43 my $target = $self->target();
45 my $sth = $self->dbh()->prepare
46 (
"INSERT INTO $target.coord_system (name, version, attrib, rank)" .
48 $sth->execute(
'scaffold', $default_assembly,
49 'default_version,sequence_level', 1);
56 sub create_seq_regions {
59 $self->debug(
"FuguRubripes Specific: creating scaffolds");
61 $self->contig_to_seq_region(
'scaffold');
68 $self->debug(
"FuguRubripes Specific: no assembly data needed");
69 #fugu has no assembly table
76 my $target = $self->target();
77 my $source = $self->source();
78 my $dbh = $self->dbh();
81 # This is simple in fugu since all genes are actually in contig (now
82 # renamed scaffold) coords. We don't need joins to the assembly table
83 # and we don't have to worry about stickies
86 $self->debug(
"FuguRubripes Specific: Building gene table " .
87 "(no chromosomal conversion)");
90 # Transfer the gene table
94 (
"INSERT INTO $target.gene " .
95 "SELECT g.gene_id, g.type, g.analysis_id, e.contig_id, " .
96 " MIN(e.contig_start), MAX(e.contig_end), e.contig_strand, " .
97 " g.display_xref_id " .
98 "FROM $source.transcript t, $source.exon_transcript et, " .
99 " $source.exon e, $source.gene g " .
100 "WHERE t.transcript_id = et.transcript_id " .
101 "AND et.exon_id = e.exon_id " .
102 "AND g.gene_id = t.gene_id " .
103 "GROUP BY g.gene_id");
105 $self->debug(
"FuguRubripes Specific: Building transcript table " .
106 "(no chromosomal conversion)");
109 # Transfer transcript table
113 (
"INSERT INTO $target.transcript " .
114 "SELECT t.transcript_id, t.gene_id, e.contig_id, " .
115 " MIN(e.contig_start), MAX(e.contig_end), e.contig_strand, " .
116 " t.display_xref_id " .
117 "FROM $source.transcript t, $source.exon_transcript et, " .
119 "WHERE t.transcript_id = et.transcript_id " .
120 "AND et.exon_id = e.exon_id " .
121 "GROUP BY t.transcript_id");
123 $self->debug(
"FuguRubripes Specific: Building exon table " .
124 "(no chromosomal conversion)");
128 # Transfer exon table
131 $self->debug(
"FuguRubripes Specific: Building transcript table " .
132 "(no chromosomal conversion)");
135 (
"INSERT INTO $target.exon " .
136 "SELECT e.exon_id, e.contig_id, " .
137 " e.contig_start, e.contig_end, e.contig_strand, " .
138 " e.phase, e.end_phase " .
139 "FROM $source.exon e");
143 # Transfer translation table
146 $self->debug(
"Building translation table");
149 (
"INSERT INTO $target.translation " .
150 "SELECT tl.translation_id, ts.transcript_id, tl.seq_start, " .
151 " tl.start_exon_id, tl.seq_end, tl.end_exon_id " .
152 "FROM $source.transcript ts, $source.translation tl " .
153 "WHERE ts.translation_id = tl.translation_id");