06 Assignment: individuals of unknown origin
Status: tested (2026-11-23), sections 1-8. Run with migrate-n 7.0.111-7.0.112 (constant parameters in section 6 need the fixes after 7.0.112). HPC regression passed with 7.0.125 and 6.1.102 (Taita cross-validation and all-unlabelled runs; the simulation studies were not rerun).
Some individuals in a data set may have no known population: a bird caught between forests, a sample with a lost label, a possible migrant. Migrate can estimate where such individuals come from while it estimates the population sizes and migration rates. This recipe shows how to mark them, how to read the assignment table, how well assignment works in simulated data, and applies it to the Taita thrush, a bird living in three forest fragments in Kenya. Read 00-basics and 01-migration first.
Contents
- How assignment works
- Assignment in the infile and the parmfile
- The assignment table
- Simulated data: how often is the assignment right?
- A real data set: the Taita thrush
- Why are the Taita probabilities soft? Mutation models, allele frequencies and simulations
- All birds unlabelled
- What next
1. How assignment works
An individual without a population is a tip of the genealogy whose population is not fixed. Migrate treats that population as one more unknown of the model: besides the genealogy and the parameters, the MCMC proposes moving the individual (all its gene copies, at every locus) to another population, and accepts or rejects the move like any other change. The genealogy is rebuilt around the moved individual, so its new population must fit the data and the migration events that connect it to the rest of the sample.
The posterior probability that the individual belongs to population j is the fraction of the recorded steps in which it was in j. Migrate counts this per locus; the “All” line combines the loci by multiplying the per-locus probabilities and normalizing, as if each locus were independent evidence with an equal prior chance for every population.
Assignment needs no allele-frequency model and no Hardy-Weinberg equilibrium: the populations are described by their Theta and migration rates, and the individual is assigned to the population whose genealogy it fits best. It also allows for migration: an individual from a population that exchanges many migrants with another is hard to place, and the probabilities say so.
2. Assignment in the infile and the parmfile
In the infile, an individual of unknown origin has a ? as the first
character of its name. It must still be listed under some population; that
population is only the starting point of the chain. In a sequence infile
(from section 4):
3 5 06-assignment M50 rep00
(s500) (s500) (s500) (s500) (s500)
10 Arran
Arr00 GCTGAGGAGTCACGAGAGG...
...
?Col08 GCTGAGGAGTCTCGAGAGG...
?Col09 GCTGAGGAGTCTCGAGAGG...
10 Bute
...
?Col08 and ?Col09 (true population Coll) are listed under Arran. With
one line per individual, all loci of ?Col08 move together. In a
microsatellite infile (section 5) the diploid genotype moves as one.
The parmfile:
| Parmfile line | Meaning |
|---|---|
assign=YES:UNIFORM | assign the ? individuals; a move proposes one of the other populations at random |
assign=YES:FREQ | the same; the move proposes populations in proportion to how often the individual was moved to them during the burn-in (with the matching Hastings correction) |
assign=YES:UNIFORM:{1,2} | only populations 1 and 2 are candidates (for example to exclude an unsampled ancestral population of a divergence model) |
assign=NO | default; ? individuals stay where they are listed |
updatefreq= assignment:0.2 | weight of the assignment move among the genealogy and parameter moves (0.2 is the default) |
With assignment the window move of 01-migration is switched off by default;
updatefreq= window:0.1 switches it on. In the simulations of section 4
(M = 50 and 250, UNIFORM) it gave the same assignments (per-sequence
probabilities within 0.11, median difference 0.002-0.02) and took 1.6
times as long. Everything else is the same as in an ordinary
run; the parameters are estimated with the unknown individuals included,
each in the populations it visits.
3. The assignment table
The outfile ends with the table “Assignment of Individuals to populations” (section 4, M = 50, data set rep00, UNIFORM):
Individual Locus 1 2 3
---------- -------- ----- ----- -----
?Col08 1 0.259 0.203 0.538 [2239/110954 = 0.020180]
?Col08 2 0.058 0.145 0.796 [4968/111755 = 0.044454]
?Col08 3 0.099 0.106 0.795 [4202/110704 = 0.037957]
?Col08 4 0.268 0.222 0.510 [3873/110692 = 0.034989]
?Col08 5 0.161 0.097 0.742 [1967/110559 = 0.017791]
?Col08 All 0.000 0.001 0.999
One line per locus with the posterior probability of each population and, in brackets, the accepted and proposed assignment moves for that locus; then the “All” line over loci. No single locus is sure (0.51-0.80 for population 3, Coll), but all five point the same way, and together they give 0.999. The acceptance of the assignment move is low (2-8% in these runs); each individual must still be moved often enough, so check that the accepted count is in the hundreds.
4. Simulated data: how often is the assignment right?
study/make_study.py simulates three populations (Arran, Bute, Coll;
Theta 0.01 each) with equal migration rates M between all of them, 5 loci of
500 bp and 10 sequences per population. In every population the last two
sequences lose their label and are listed under the next population, so
that the chain starts from a wrong assignment. Three migration levels, ten
data sets each, both proposal modes:
python3 study/make_study.py study # from cookbooks/06-assignment
# run every study/M<m>/<mode>/repNN/parmfile, then
python3 scripts/score.py study
The runs took about 8 minutes each with 6 MPI processes. For the 60 unlabelled sequences of each migration level and mode (P(true): the “All” probability of the true population):
| M (4Nm) | Mode | Correct | Mean P(true) | P(true) > 0.95 | Correct among P > 0.95 |
|---|---|---|---|---|---|
| 10 (0.1) | FREQ | 100% | 1.00 | 100% | 60 of 60 |
| UNIFORM | 100% | 1.00 | 100% | 60 of 60 | |
| 50 (0.5) | FREQ | 100% | 0.97 | 83% | 50 of 50 |
| UNIFORM | 100% | 0.96 | 82% | 49 of 49 | |
| 250 (2.5) | FREQ | 73% | 0.69 | 28% | 17 of 17 |
| UNIFORM | 78% | 0.72 | 28% | 17 of 17 |
(4Nm = Theta x M, the number of immigrants per generation times four.) With little migration every unlabelled sequence returns to its population, with probabilities near 1. With 4Nm = 2.5 a quarter of them end up in the wrong population, but the probabilities report that uncertainty: the mean probability of the true population (0.69-0.72) is close to the fraction assigned correctly (0.73-0.78), and every assignment with a probability above 0.95 was right. FREQ and UNIFORM give the same results here; with three populations the choice of proposal hardly matters.
5. A real data set: the Taita thrush
The Taita thrush (Turdus helleri) lives only in the cloud-forest fragments of the Taita Hills in south-east Kenya: Chawia, Ngangao and Mbololo. Galbusera et al. (2000) genotyped 155 birds caught in 1996-1999 at seven microsatellite loci, found the three fragments genetically differentiated (Migrate estimated 0.2-4.3 migrants per generation), and found with assignment tests (STRUCTURE and IMMANC) no migrant of the current generation and two or three birds descending from migrants. Their genotypes are not public, but a later study (Cousseau et al. 2025) deposited genotypes from the same fragments on Dryad (doi:10.5061/dryad.bvq83bkkk, CC0), with birds from 1997-1998 and later periods. We use the 1997-1998 birds (for Chawia: before the 2008 translocation of birds from Mbololo), the period of the 2000 study: 21 from Chawia, 54 from Ngangao and 86 from Mbololo, at six loci.
scripts/taita_infile.py writes the infile from the Dryad workbook
(dryad/TT_genotypes.xlsx). The alleles are fragment lengths in base pairs,
so the infile has a #@M line with the repeat length of each locus (2 bp,
4 bp for the tetranucleotide MJG1); genotypes that could not be scored are
?:
3 6 . Taita thrush 1997-98 (Dryad bvq83bkkk)
#@M 2,2,4,2,2,2
21 Chawia
B32910 179.183 219.221 222.230 151.167 115.125 268.274
...
The parmfile (parmfiles/parmfile.taita) is the microsatellite parmfile of
00-basics (Brownian motion model, Theta prior 0-20) with three populations,
the full migration model and assign=YES:UNIFORM.
Which birds are not where they were caught? Every bird must be unlabelled once, but with all birds unlabelled no population would have a fixed member (section 7). We use 10-fold cross-validation: the birds are split into ten groups; in each run one group is unlabelled (and listed under a wrong fragment) and the other nine stay labelled:
for k in 0 1 2 3 4 5 6 7 8 9; do
mkdir -p cv/fold$k
python3 scripts/taita_infile.py cv/fold$k/taita.txt --folds 10 --fold $k
cp parmfiles/parmfile.taita cv/fold$k/parmfile
done
# run each fold, then
python3 scripts/score_taita.py cv
Each fold took 48-71 minutes with 7 MPI processes on a cluster.
| Fragment | Birds | Assigned home (P > 0.5) | Home with P > 0.95 | Mean P(home) |
|---|---|---|---|---|
| Chawia | 21 | 21 | 9 | 0.93 |
| Ngangao | 54 | 49 | 10 | 0.78 |
| Mbololo | 86 | 83 | 57 | 0.92 |
The ternary (de Finetti) diagram (scripts/plot_ternary.py cv OUT.svg)
shows every bird as a point: a bird at a corner belongs to that fragment
with probability 1; the closer a point lies to a corner, the higher that
fragment’s probability. Colour and shape mark the fragment where the bird
was caught; the dashed lines separate the regions in which one fragment has
a probability above 0.5. Most birds sit in or near the corner of their own
fragment. The Ngangao birds spread along the edges toward Chawia and
Mbololo, and a few Mbololo birds lie between Mbololo and the other two.
153 of the 161 birds are assigned to the fragment where they were caught. The eight others are split between two fragments; none is placed elsewhere with a probability above 0.6:
ring caught in Chawia Ngangao Mbololo
B34139 Mbololo 0.583 0.002 0.415
B34642 Mbololo 0.004 0.530 0.466
BB0386 Mbololo 0.537 0.343 0.119
B34112 Ngangao 0.509 0.435 0.057
B34120 Ngangao 0.560 0.434 0.006
BB0304 Ngangao 0.040 0.449 0.511
BB0329 Ngangao 0.537 0.458 0.004
BB0333 Ngangao 0.493 0.499 0.009
Ngangao is the least distinct fragment (mean probability 0.78; five of its 54 birds lean toward Chawia or Mbololo), Chawia and Mbololo the most. This agrees with Galbusera et al. (2000): no bird is clearly a migrant of the current generation, and a few birds have mixed ancestry. The individual birds cannot be matched to theirs (the 2000 study numbered its samples, Dryad lists ring numbers), so we cannot check whether these are the same birds.
6. Why are the Taita probabilities soft? Mutation models, allele frequencies and simulations
Only 76 of the 161 birds get a probability above 0.95 for their own fragment. Assignment from allele frequencies is much sharper (below). Is this the data, the mutation model, or the way Migrate assigns? We changed one thing at a time on the thrushes, and then simulated data under the thrush model, where the origin of every bird is known.
6.1 The thrushes: mutation models, fixed parameters, allele frequencies
Every run in this part is the same 10-fold cross-validation as in section 5.
Other mutation models. datatype=ALLELICDATA treats the alleles as
labels (a K-allele model: an allele mutates to any of the k alleles seen at
the locus or to an unseen one, with equal probability);
datatype=MICROSATELLITEDATA is the stepwise mutation model on the repeat
numbers. Both models need migrate-n 7.0.112 or later (in earlier versions
they did not work).
Fixed parameters. Each bird’s probability is an average over the
posterior of Theta and M. To see whether this averaging blurs the
assignment, we fixed Theta and M at the Joint medians of each fold
(custom-migration={ccc ccc ccc} with theta=Own:{...} and
migration=Own:{...}), and then at the same values with all M divided by
10:
datatype=BrownianData
theta=Own:{2.88667 4.48667 1.47333}
migration=Own:{ - 1.43667 0.79000 1.73000 - 1.19000 0.99000 1.67667 - }
custom-migration={ccc ccc ccc}
Allele frequencies. Two frequency methods assign the unlabelled birds of each fold from the allele frequencies of the labelled birds, with Hardy-Weinberg genotypes within a fragment and independent loci:
scripts/freq_assign_taita.py cv OUT: Rannala and Mountain (1997), a Dirichlet(1/k) prior on the frequencies (--lambda=1for Dirichlet(1)). It runs in a second.scripts/structure_taita.py cv OUT: STRUCTURE 2.3.4 (Pritchard et al. 2000; the command-line program, path with--structure) with the source populations given (USEPOPINFO=1, frequencies from the labelled birds only), no admixture, so that the unlabelled birds get posterior probabilities of membership; correlated allele frequencies (Falush et al. 2003: the fragments have drifted from a common ancestral pool), or uncorrelated with--uncorrelated. About a second per fold.
Both write the same table as Migrate, so score_taita.py reads them.
| Analysis | Home P > 0.95 (Ch / Ng / Mb) | Mean P(home) |
|---|---|---|
| Brownian motion (section 5) | 9 / 10 / 57 | 0.93 / 0.78 / 0.92 |
| Brownian, two more seeds | 8-9 / 9-10 / 57-58 | 0.92-0.94 / 0.78-0.79 / 0.90-0.91 |
| K-allele model | 9 / 6 / 61 | 0.93 / 0.77 / 0.92 |
| Stepwise mutation model | 8 / 9 / 58 | 0.93 / 0.77 / 0.92 |
| Brownian, Theta and M fixed | 10 / 11 / 58 | 0.94 / 0.77 / 0.91 |
| Brownian, fixed, M / 10 | 17 / 16 / 62 | 0.96 / 0.80 / 0.93 |
| K-allele, fixed, M / 10 | 16 / 14 / 64 | 0.96 / 0.79 / 0.94 |
| Allele frequencies (Rannala-Mountain) | 21 / 43 / 83 | 1.00 / 0.93 / 0.98 |
| STRUCTURE, uncorrelated | 20 / 36 / 82 | 0.99 / 0.90 / 0.98 |
| STRUCTURE, correlated | 18 / 37 / 78 | 0.99 / 0.92 / 0.96 |
(21 Chawia, 54 Ngangao, 86 Mbololo birds.) The run-to-run variation is small; the three mutation models give the same assignment, and so does fixing the parameters: averaging over Theta and M does not blur it. Ten times less gene flow sharpens it only a little. The frequency methods are much sharper. The in-between Ngangao birds of section 5 stay in between in every Migrate run.
The two approaches use the data differently. The frequency methods treat the fragments as pools of alleles: an allele common in Mbololo and rare in Ngangao is strong evidence for Mbololo. Migrate places the bird in a genealogy of all birds, with shared ancestry and migration between the fragments, and with a mutation model under which the same allele can arise more than once. Which of the two is right cannot be decided on the real birds, whose origin we do not know.
6.2 Simulated data under the thrush model
Two scripts simulate data with the population sizes and gene flow that Migrate estimated for the thrushes (Theta 1.6, 3.6 and 2.3 for Chawia, Ngangao and Mbololo; 4Nm 2.6-6.0 for every pair), with 21, 54 and 86 diploid birds and 2, 5 and 9 unlabelled birds per fragment in each of ten data sets:
scripts/sim_taita_msat.py: microsatellites under the stepwise mutation model (--loci 6or10), with the thrush Theta per locus; analysed withdatatype=MICROSATELLITEDATA.scripts/sim_taita_dna.py: DNA,--lociloci of 500 bp (Jukes-Cantor), the same relative population sizes scaled to a mean Theta of 0.005 per site. Each bird is two sequences with the same name; Migrate keeps the two copies of a bird together.--scale 3or--scale 10multiplies the gene flow.
scripts/calib_taita.py checks whether the probabilities are calibrated:
the birds are binned by their largest probability, and of the birds
assigned with probability around 0.9 about 90% should be right.
python3 scripts/sim_taita_msat.py msat6 --loci 6
python3 scripts/sim_taita_dna.py dna6-x10 --loci 6 --scale 10
# run every repNN/parmfile, then for each set, e.g. dna6-x10:
python3 scripts/freq_assign_taita.py dna6-x10 dna6-x10-freq # haplotypes as alleles
python3 scripts/structure_taita.py dna6-x10 dna6-x10-st
python3 scripts/structure_taita.py dna6-x10 dna6-x10-stu --uncorrelated
python3 scripts/calib_taita.py dna6-x10 dna6-x10-freq dna6-x10-st dna6-x10-stu
The Migrate runs took 1-1.3 hours per data set for microsatellites, 20-75 minutes for DNA with the thrush or three times the gene flow, and 1.6-3.7 hours for DNA with ten times the gene flow (7 or 11 MPI processes, one per locus plus the master).
Number of unlabelled birds (of 160) whose most probable population is the true one; in brackets the fraction correct among the birds with a probability above 0.95:
| Data | Migrate | Rannala-Mountain | STRUCTURE uncorr. | STRUCTURE corr. |
|---|---|---|---|---|
| Microsatellites, 6 loci | 137 (1.00) | 139 (0.96) | 140 (1.00) | 136 (0.98) |
| Microsatellites, 10 loci | 145 (1.00) | 150 (0.98) | 151 (1.00) | 149 (0.98) |
| DNA, 6 loci | 160 (1.00) | 158 (0.99) | 156 (1.00) | 156 (1.00) |
| DNA, 10 loci | 160 (1.00) | 160 (1.00) | 160 (1.00) | 159 (1.00) |
| DNA, 10 loci, 3 x gene flow | 160 (1.00) | 154 (0.98) | 152 (1.00) | 149 (1.00) |
| DNA, 6 loci, 10 x gene flow | 156 (1.00) | 112 (0.89) | 116 (1.00) | 114 (1.00) |
| DNA, 10 loci, 10 x gene flow | 157 (1.00) | 131 (0.91) | 122 (0.97) | 120 (1.00) |
Microsatellites. All four methods place about the same number of birds correctly, and Migrate is as soft as on the real birds: with six loci only 9 of 160 birds have a probability above 0.95. But Migrate is cautious rather than wrong: 91% of the birds it assigns with probability 0.5-0.8 are correct, and all above 0.8. The frequency methods are sharper and right when sure, but at intermediate probabilities only 50-64% of their birds are correct. (That Migrate is cautious on data simulated under its own model is not what an exact posterior would do; we do not know the reason yet.)
DNA. With the thrush gene flow every method is nearly perfect. With
more gene flow Migrate stays accurate and the frequency methods do not.
The calibration for ten loci and ten times the gene flow, from 30 data sets
(480 birds; 20 more data sets with --reps 30):
| Largest P | Migrate: birds | correct | Rannala-Mountain: birds | correct | STRUCTURE corr.: birds | correct |
|---|---|---|---|---|---|---|
| below 0.50 | 0 | 5 | 80% | 97 | 51% | |
| 0.50-0.80 | 28 | 75% | 70 | 47% | 294 | 80% |
| 0.80-0.95 | 52 | 96% | 77 | 77% | 79 | 100% |
| 0.95-0.99 | 79 | 100% | 67 | 81% | 8 | 100% |
| 0.99-1.00 | 321 | 100% | 261 | 93% | 2 | 100% |
| correct | 471 of 480 | 393 | 373 |
Migrate’s probabilities mean what they say. The Rannala-Mountain method is overconfident: 7% of its birds with a probability above 0.99 are in the wrong population. STRUCTURE with correlated frequencies is not overconfident, but it is unsure about most birds and no more accurate (uncorrelated STRUCTURE lies in between: 378 correct).
Why the frequency methods lose Chawia. Most of their errors are Chawia birds placed in Ngangao or Mbololo. With ten times the gene flow the haplotypes of a Chawia bird are only about 15% more common in Chawia than in the other fragments, and with only 19 labelled Chawia birds (38 gene copies) about one in ten of them is, by chance, absent from the Chawia sample. An absent allele gets a predictive probability about a hundred times lower than a present one, and that outweighs the small real difference; the larger Mbololo sample misses fewer. Migrate does not depend on exact matches: a haplotype missing from the Chawia sample is still close to Chawia haplotypes, and the fragments are described by Theta and M estimated from all birds. Reducing the Ngangao and Mbololo reference samples to 19 labelled birds as well helps the Chawia birds, but the frequency methods then do worse overall (Rannala-Mountain 94 instead of 112 correct with six loci).
What this means for the thrushes: the simulated microsatellites behave like the real ones, so the soft probabilities of section 5 are a property of six microsatellite loci, whose mutation models let the same allele length arise in different lineages, and not a sign that Migrate assigns worse. The sharper frequency probabilities are not necessarily better: on DNA with much gene flow they are too confident. Six DNA loci give better assignments than ten microsatellites with every method; for new studies, sequence data give Migrate, and the other methods, much more to work with.
6.3 SNPs from the same loci
Many studies now type SNPs instead of sequencing loci. To see what that
changes, scripts/dna_to_snp.py keeps only the variable sites of every
locus of the simulated DNA data sets: the same birds and genealogies, but
each locus becomes 16-69 linked SNPs (386-484 SNPs per data set), as
from a few short reads. Migrate analyses them with
datatype=NucleotidePolymorphismData. Theta is per site, and without the
invariant sites far fewer sites carry the same mutations, so Theta per site
is much larger: we widened the Theta prior to UNIFORMPRIOR: 0.0 0.5 0.05
(the DNA runs used 0-0.072). The frequency
methods take every SNP as a locus of its own (--snp).
python3 scripts/dna_to_snp.py dna-x10 snp-x10 # 10 loci, 10 x gene flow
# run every repNN/parmfile, then
python3 scripts/freq_assign_taita.py snp-x10 snp-x10-freq --snp
python3 scripts/structure_taita.py snp-x10 snp-x10-st --snp
python3 scripts/structure_taita.py snp-x10 snp-x10-stu --snp --uncorrelated
python3 scripts/structure_taita.py snp-x10 snp-x10-st4 --snp --thin 4
python3 scripts/calib_taita.py snp-x10 snp-x10-freq snp-x10-st snp-x10-stu snp-x10-st4
The SNP data are the first ten data sets of the DNA row with ten loci and ten times the gene flow, so the two rows compare the same birds. The Migrate runs took 17-33 hours per data set (11 MPI processes); STRUCTURE about 6 minutes for all ten.
| Data | Migrate | Rannala-Mountain | STRUCTURE uncorr. | STRUCTURE corr. |
|---|---|---|---|---|
| DNA, 10 loci, 10 x gene flow | 157 (1.00) | 131 (0.91) | 122 (0.97) | 120 (1.00) |
| SNPs of the same loci | 135 (1.00) | 100 (0.66) | 65 (0.41) | 58 (0.34) |
SNPs, 4 per locus (--thin 4) | 80 (1.00, one bird) | |||
SNPs, 1 per locus (--thin 1) | 67 (no bird) |
(Correct of 160; in brackets the fraction correct among the birds with a probability above 0.95.) The calibration:
| Largest P | Migrate: birds | correct | Rannala-Mountain: birds | correct | STRUCTURE corr.: birds | correct | STRUCTURE corr., 4 per locus: birds | correct |
|---|---|---|---|---|---|---|---|---|
| below 0.50 | 49 | 61% | 1 | 0% | 0 | 85 | 42% | |
| 0.50-0.80 | 65 | 92% | 16 | 50% | 16 | 44% | 72 | 60% |
| 0.80-0.95 | 35 | 97% | 14 | 50% | 57 | 37% | 2 | 0% |
| 0.95-0.99 | 10 | 100% | 19 | 53% | 26 | 15% | 1 | 100% |
| 0.99-1.00 | 1 | 100% | 110 | 68% | 61 | 43% | 0 |
Migrate loses some accuracy (135 instead of 157 correct) and stays cautious: it is right more often than its probabilities say, as with the microsatellites. The frequency methods collapse. Rannala-Mountain places 110 birds with a probability above 0.99, and only 68% of them are right; STRUCTURE is no better than chance (36-41% correct, while always guessing Mbololo would give 56%) and equally sure of itself.
The reason is linkage. The SNPs of a locus share one genealogy, but the
frequency methods multiply their probabilities as if every SNP were an
independent locus, so the same history is counted 16-69 times and the
probabilities are pushed to 0 or 1. With only 19 labelled Chawia birds,
chance differences in the SNP frequencies are counted that many times as
well. Keeping a few SNPs per locus (--thin K in structure_taita.py)
removes most of the linkage: with one or four SNPs per locus STRUCTURE’s
probabilities are calibrated again (birds at 0.4 are right about 40% of
the time, at 0.6 about 60%), and four SNPs per locus are more accurate
than one (80 and 67 correct), but far from Migrate. Migrate uses all
SNPs of a locus on one genealogy, so linked SNPs do not need thinning.
For SNP studies: if the SNPs come from a few loci (reads, RAD tags, amplicons), give Migrate the SNPs with their locus, and do not trust frequency-based assignment probabilities computed as if the SNPs were unlinked; thin them to one or a few SNPs per locus first.
7. All birds unlabelled
What if no bird keeps its label? taita_infile.py --all caught marks
every bird with ? and lists it under the fragment of capture;
--all random --seed 7 lists every bird under a random fragment. Both runs took
about an hour.
The result is uninformative: every bird gets a probability near 1/3 for each fragment (the largest probability of a bird is 0.36-0.55 for 80% of the birds, at most 0.89), and only 8-9 of 161 birds are assigned to the fragment where they were caught. The run that started from the fragments of capture lost them.
(The run with random starting fragments; the run that started from the fragments of capture looks the same.)
This is expected. With every bird unlabelled, the three population labels are interchangeable: the same three groups with the labels permuted have the same posterior probability (the priors are the same for all populations). A chain that mixes well visits all permutations, and the probability of each bird in each population tends to 1/3, whatever the groups are. The probabilities still differ from 1/3 because one hour of run did not mix completely, not because they say anything about the birds. Assignment in Migrate needs individuals of known origin that fix what each population is; the unlabelled individuals are then compared with those populations. To find groups without any known origin, use a clustering method (for example STRUCTURE) and then test the groups with Migrate.
8. What next
- 05-model-selection: once the origin of the doubtful individuals is settled, compare migration models (full, symmetric, one-way) for the three fragments with marginal likelihoods.
- 07-haplotyping: unphased diploid sequence data, the other case in which the MCMC changes the data side of the genealogy.
References
- Cousseau L, Sanczuk P, de Mits S, Vangestel C, Borghesio L, Githiru M, Lens L (2025) Taita thrush genetic and demographic data. Dryad, doi:10.5061/dryad.bvq83bkkk (CC0); article doi:10.1093/ornithapp/duaf010
- Falush D, Stephens M, Pritchard JK (2003) Inference of population structure using multilocus genotype data: linked loci and correlated allele frequencies. Genetics 164: 1567-1587. doi:10.1093/genetics/164.4.1567
- Galbusera P, Lens L, Schenck T, Waiyaki E, Matthysen E (2000) Genetic variability and gene flow in the globally, critically-endangered Taita thrush. Conservation Genetics 1: 45-55. doi:10.1023/A:1010184200648
- Pritchard JK, Stephens M, Donnelly P (2000) Inference of population structure using multilocus genotype data. Genetics 155: 945-959. doi:10.1093/genetics/155.2.945
- Rannala B, Mountain JL (1997) Detecting immigration by using multilocus genotypes. PNAS 94: 9197-9201. doi:10.1073/pnas.94.17.9197