Skip to content

Preprocessing

Caroline Fortier edited this page Sep 6, 2026 · 1 revision

Preprocessing

PhyloGeoPlot includes utilities for preparing occurrence, metadata, and phylogenetic data before visualization.

Format GBIF occurrence data

python -m phylogeoplot.preprocessing.format_gbif_data \
    gbif_occurrences.csv \
    node_names.csv

Repository example:

python -m phylogeoplot.preprocessing.format_gbif_data \
    examples/sample_data/use_case_1/gbif_coffea_ex3.csv \
    examples/sample_data/use_case_1/node_names.csv

Add metadata

python -m phylogeoplot.preprocessing.add_metadata \
    gbif_occurrences_formatted.csv \
    trait_metadata.csv

This allows quantitative information to be represented in the linked visualization.

Build a phylogenetic tree

python -m phylogeoplot.preprocessing.build_phylogenetic_tree \
    sequences.fasta

The input FASTA file should contain aligned sequences.

The resulting tree can then be supplied to the visualization module as a Newick file.

Data preparation

Additional preparation functionality is implemented in:

phylogeoplot/preprocessing/prepare_data.py

The preprocessing stage transforms source datasets into the consistent identifiers and structures required for linked tree-map visualization.

Preprocessing package structure

phylogeoplot/
└── preprocessing/
    ├── add_metadata.py
    ├── build_phylogenetic_tree.py
    ├── format_gbif_data.py
    └── prepare_data.py

Next step

Once occurrence data and the phylogenetic tree have been prepared, continue with Visualization.

Clone this wiki locally