⌛ 2.5 hours
Rosewoods are the world’s most seized wildlife product by value, about 35% of all wildlife seizures in 2005–2014, roughly double elephant ivory at 18% (UNODC World Wildlife Crime Report 2016). They are notoriously called the bloodwood, because the conflicts between the local poachers, often driven from extreme poverty, and the forest rangers cause bloodsheds.
We want to save this species and alleviate the poverty at the same time. We are teaching local people how to source seeds, grow them, and generate income. NGOs and governments buy these trees for restoration projects.

These all sound fantastic. However, it is known that traditionally forest conservation programmes ignore the standing genetic diversity and create genetic bottlenecks in the germplasms, for example, by sourcing seeds that are genetically closely related.
<aside> 💡 In this activity, we will analyse microsatellite data from a previous study by Hartvig et al. (2017) Ecol Evol to achieve these objectives:
<aside> 💌
With thanks to Prof Ida Hartvig (Copenhagen) and collaborators on the rosewood project, whose data make this practical possible.
</aside>
There are seven stations, numbered 0 to 6. Use the times in the table to keep on track. Tasks marked + optional can be skipped if you are short of time.
| Station | Minutes | What you do | You leave with |
|---|---|---|---|
| 0 Set up | 0–10 | Packages, working directory, seed, outputs folder | A session that runs, and a record of what you ran |
| 1 Know your data | 10–30 | Load, count, genotype curve, locus table, missing data | A rosewood object you trust |
| 2 HWE | 30–50 | Global test, per-population tests, heatmap | Evidence that structure exists |
| 3 Linkage | 50–65 | Index of association, globally and within one population | A judgement on whether 9 loci are 9 independent markers |
| 4 Diversity | 65–90 | Allele counts, rarefied richness, Ho/He/FIS with bootstrap CIs | A diversity table for all 26 populations |
| 5 Structure | 90–125 | Pairwise FST, isolation by distance, then DAPC clusters mapped | A map of cluster membership |
| 6 Recommendation | 125–150 | Decide and argue it | Something you can defend |
⏱️ 0–10 min
<aside> 📥
Download
</aside>
Download and unzip the files. rosewood.csv contains the genotypes. rosewood_coords.csv contains the longitude and latitude of each population. rosewood_water.csv contains the main rivers and lakes, for the map in Station 5. Make a folder called rosewood and put all three files in it. Then, in RStudio, go to File → New Project → Existing Directory and choose that folder.
# ---- 1. Where am I? Everything below reads and writes relative to here ----
getwd() # should end in /rosewood
list.files() # should list the three .csv files
# ---- 2. Packages: install once, then load them every session ----
install.packages(c("poppr", "pegas", "hierfstat", "adegenet", "ade4",
"lattice", "mapplots", "maps", "RColorBrewer"))
library(poppr)
library(adegenet)
library(pegas)
library(hierfstat)
library(ade4)
library(lattice)
library(maps)
library(mapplots)
library(RColorBrewer)
# ---- 3. Setting a seed ----
# Several steps today sample at random. set.seed() fixes those random numbers so
# your results match this page. You will see this same line again before each
# random step, so that any one task can be re-run on its own and still agree.
set.seed(2026)
<aside> ✅
EXPECT TO SEE
No red error messages, and list.files() shows all three CSV files. If a package will not load, ask for help now rather than later.
</aside>