sub do_dump {
my ($self, $metadata, $outfile) = @_;
my $eg_version = $metadata->{genome}->[0]->{dbname};
$eg_version =~ s/[a-z]+_([0-9]+)_[0-9]+_[0-9]+/$1/;
my $td = '<td>';
my $tdx = '</td>';
my $tr = '<tr>';
my $trx = '</tr>';
open(my $tt2_file, '>', $outfile) ||
croak "Could not write to " . $outfile;
print $tt2_file <<"ENDHEAD";
<style type="text/css" title="currentStyle">
\@import "/static/css/grid.css";
</style>
<script type="text/javascript" charset="utf-8" src="/static/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
$(document).ready( function () {
$('#species_list').dataTable({
"sPaginationType": "full_numbers",
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
});
} );
</script>
<div id="static">
<h2>Ensembl Genomes Release $eg_version</h2>
<p>Ensembl Genomes species metadata are also available via FTP: <a href="ftp://ftp.ensemblgenomes.org/pub/current/species.txt">Tabular text</a> | <a href="ftp://ftp.ensemblgenomes.org/pub/current/species_metadata.json">JSON</a> | <a href="ftp://ftp.ensemblgenomes.org/pub/current/species_metadata.xml">XML</a></p>
<table cellpadding="0" cellspacing="0" border="1px dotted #eeeeee"
class="display" id="species_list">
<thead>
<tr>
<th>Species</th><th>Division</th><th>Taxonomy ID</th><th>Assembly</th><th>Genebuild</th><th>Variation</th><th>Pan compara</th><th>Genome alignments</th><th>Other alignments</th>
</tr>
</thead>
<tbody>
ENDHEAD
for my $md (@{$metadata->{genome}}) {
my $div_link = $self->{div_links}->{$md->{division}};
my $div_name = $self->{div_names}->{$md->{division}};
if (!defined $div_link) {
croak "No division defined for $md->{name}";
}
$div_link .= $md->{species};
print $tt2_file join("",
($tr,
$td,
"<a href='${div_link}'>",
$md->{name},
'</a>',
$tdx,
$td,
"<a href='",
$div_link,
"'>",
$div_name,
'</a>',
$td,
"<a href='http://www.uniprot.org/taxonomy/" .
$md->{taxonomy_id} .
"'>" . $md->{taxonomy_id} . "</a>",
$tdx,
$td,
$md->{assembly_name},
$tdx,
$td,
$md->{genebuild},
$tdx,
$td,
$self->yesno($self->count_variation($md)),
$tdx,
$td,
$self->yesno($md->{pan_species}),
$tdx,
$td,
$self->yesno($self->count_dna_compara($md)),
$tdx,
$td,
$self->yesno($self->count_alignments($md)),
$tdx,
$trx,
"\n"));
} ## end for my $md (@{$metadata...})
print $tt2_file <<'ENDFOOT';
</tbody>
<tfoot>
<tr>
<th>Species</th><th>Division</th><th>Taxonomy ID</th><th>Assembly</th><th>Genebuild</th><th>Variation</th><th>Pan compara</th><th>Genome alignments</th><th>Other alignments</th>
</tr>
</tfoot>
</table>
</div>
ENDFOOT
close $tt2_file;
return;
} ## end sub do_dump