Skip to content

From spreadsheet to tree

Methods

Every number on this site is computed by the pipeline in pipeline/ghostphylo/, rerun by GitHub Actions whenever the data change.

Data

The source is indonesian-ghosts.csv: 166 taxa, 14 of them outgroups from Malaysia, the Philippines, Thailand, Cambodia, and South Asia. Of the taxa, 18 keep the codings of the original matrix, 43 had missing traits filled by folklore synthesis, and 105 are new entries coded entirely by synthesis. These are marked ◆ throughout.

Characters

Eighteen traits come straight from the dataset (0 absent, 1 present, 2 variable; for sex, 1 female and 2 male or unspecified). The body plan and the diet are each added as one unordered multistate character, so a body plan counts once rather than as many one-hot columns. Clade is left out because it is the grouping the tree tests. The 166 taxa reduce to 95 distinct rows; taxa that share a row cannot be separated by any tree.

Characters and their states
#CharacterStates
1 Human-like 0 Non-human, animal, or object; 1 Humanoid, witch, or human spirit; 2 Variable
2 Sex 0 Male; 1 Female; 2 Male, unspecified, or variable
3 Death or birth origin 0 Not death or birth related; 1 Death, childbirth, or infant origin; 2 Variable
4 Incorporeal 0 Embodied creature or witch; 1 Ghost, spirit, or undead; 2 Variable
5 Flight 0 Grounded; 1 Flies or floats; 2 Variable
6 Burial 0 None or weak; 1 Grave, shroud, or cemetery; 2 Variable
7 Children 0 None; 1 Child spirit, child theft, or infant targeting; 2 Variable
8 Blood and organs 0 None; 1 Targets blood, flesh, or organs; 2 Variable
9 Theft and mischief 0 None; 1 Theft, pranks, or mischief central; 2 Variable
10 Hair or fur 0 None; 1 Hairy, furry, or ape-like; 2 Variable
11 Animal form 0 None; 1 Animal form or shapeshifting central; 2 Variable
12 Detached head 0 None; 1 Detached or flying head; 2 Variable
13 Fire or light 0 None; 1 Fireball, flaming, or luminous; 2 Variable
14 Water 0 None; 1 Sea, river, or water; 2 Variable
15 Forest 0 None; 1 Forest, jungle, or mountain; 2 Variable
16 Settlement 0 Wild or liminal; 1 Village, house, hospital, or road; 2 Variable
17 Black magic 0 No strong sorcery motif; 1 Black magic or witchcraft central; 2 Variable
18 Widespread 0 Localized; 1 Widespread across Southeast Asia; 2 Variable
19 Body plan 0 Spectral female; 1 Detached flying head; 2 Detached upper torso; 3 Hairy biped; 4 Shrouded corpse; 5 Fireball; 6 Giant or ogre; 7 Winged hominid; 8 Tiger-human; 9 Elongated humanoid; A Haunted object or procession; B Serpent or naga; C Masked deity; D Human witch; E Animal or animal hybrid; F Humanoid spirit; G Aquatic spirit; H Child-like familiar; I Hungry ghost
20 Diet 0 Blood; 1 Flesh; 2 Life force or offerings; 3 Non-consumptive; 4 Omnivore

Inference

IQ-TREE 2.3.6 with ModelFinder (-m MFP) on the morphological data type selected MK+FQ+ASC+R2 by BIC (2,890.2). Support comes from 1000 ultrafast bootstrap replicates (UFBoot2, -bnni); the seed is 20261020, so reruns are reproducible. The log-likelihood of the best tree is -1,081.11.

The tree is rooted on the largest clade made only of outgroups. They do not form one clade: several outgroups nest among Indonesian relatives, as the Malay and Philippine flying heads did in the earlier 61-taxon tree. Of 119 internal nodes, 4 have ultrafast bootstrap of 95 or more and 92 fall below 50, so treat the deep branching as unresolved.

Plates

Each ghost's plate is drawn by pipeline/ghostphylo/svgs.py from its record: the body plan sets the figure, the clade sets the ring color, and coded traits add scenery, such as a banyan for forest spirits, nisan gravestones and frangipani for burial, a lit joglo roof for village haunts, kepeng coins for theft, and an incense burner for black magic. A hand-drawn file in assets/ghosts/ replaces the generated plate for that ghost.

Pipeline

uv run --project pipeline ghostphylo all   # parse, encode, IQ-TREE, export, plates
cd web && bun run build                    # this site

The GitHub workflow installs IQ-TREE, runs the same commands, uploads the analysis files as a build artifact, and deploys the site to GitHub Pages.

Downloads

Caveats

Folklore is not inherited like genes; shared traits may come from shared film portrayals, trade routes, or religion as much as from common descent. Read the tree as a map of resemblance among tellings, not a history of the spirits themselves. Verify any entry against primary ethnographic sources before citing it.