# Salmobase homepage assets

This directory contains the deployment-specific phylogeny and species
illustrations used by the Salmobase front page. These files are not generated 
by the Snakemake workflow.

## Contents

```text
homepage/
  README.md
  species-tree.nwk
  species/
    atlantic-salmon.png
    atlantic-salmon.webp
    ...
```

- `species-tree.nwk`: the homepage display tree, with species IDs as tips and
  clade names on internal nodes.
- `species/*.png`: copies of the supplied AI-generated illustrations.
- `species/*.webp`: smaller display copies, currently 660 pixels wide with
  transparency preserved. The homepage displays each image at up to 160 pixels
  wide, with the larger source supporting high-resolution screens.

The illustrations may contain inaccuracies and are not intended for species
identification. Keep the AI-image notice enabled while these images are used.

## Configuration

Paths in the active `species.yml` are relative to the /datafiles path.

```yaml
homepage:
  tree_path: homepage/species-tree.nwk
  images_ai_generated: true
species:
  AtlanticSalmon:
    image_path: homepage/species/atlantic-salmon.webp
    # Existing species and assembly metadata follows.
```


## Editing the tree

The current topology is derived from the September 2026 orthology tree:

```text
orthology/2026-09/Ortho_pipeline/OrthoFinder/Species_Tree/SpeciesTree_rooted_node_labels.txt
```

The homepage copy contains only the ten displayed species. Unused branches,
original node IDs, support values and branch lengths have been removed. Keep
this display tree separate from the source orthology tree.

- Use the exact species keys from `species.yml` as tip names, such as
  `AtlanticSalmon`. Each species should occur once.
- Put display labels directly on internal nodes. For example,
  `(AtlanticSalmon,BrownTrout)Salmo;` labels their shared node **Salmo**.
- Leave internal nodes unnamed when no label should appear. Quote names
  containing spaces, for example `(AtlanticSalmon,BrownTrout)'Example clade';`.
- Preserve the topology when rearranging branches. The renderer orders sister
  clades using species configuration order and arranges branch lengths for
  readability. Displayed lengths do not represent evolutionary distances.
- Only species present in both this tree and the active configuration appear
  in the homepage overview. Species outside the tree are omitted.

Missing images use a neutral placeholder. A missing, unreadable, malformed or
duplicate-tip tree leaves the overview without species; check the web logs.

## Species illustrations

| Species ID | Image filename stem |
| --- | --- |
| AtlanticSalmon | atlantic-salmon |
| BrownTrout | brown-trout |
| RainbowTrout | rainbow-trout |
| CohoSalmon | coho-salmon |
| ArcticCharr | arctic-charr |
| DanubeSalmon | danube-salmon |
| EuropeanGrayling | european-grayling |
| NorthernPike | northern-pike |
| OlympicMudminnow | olympic-mudminnow |
| EasternMudminnow | eastern-mudminnow |

Each stem has a `.png` original and a `.webp` display copy in `species/`.
The image path in `species.yml` selects the actual file; filenames are not
inferred or hard-coded by the application. PNG, JPEG, WebP and AVIF are
supported. Prefer transparent backgrounds and consistent fish orientation.

To recreate the WebP copies with `cwebp`, run from this directory:

```sh
for image in species/*.png; do
  cwebp -q 88 -resize 660 0 "$image" -o "${image%.png}.webp"
done
```

