# Validation of Automated Chromosome Recovery in the Reconstruction of Ancestral Gene Order
## 6 Simulations
### The Simulation Process  
The simulation process is formalized in Algorithm 3 utilizing the parameters estimated from Algorithm 2.  
```
input :\(Tr\), an fully labelled binary branching phylogeny \(G_{1\cdots H}\), annotated extant gene-order genomes related by \(Tr\)\(N(I\times J)\), matrix of integers representing gene family size in ancestral genomes estimated from Algorithm 2, where \(I\) is the number of ancestors in \(Tr\), \(J\) is the total number of gene families in each ancestor output :\(G_{1\cdots H}^{\prime}\), simulated gene-order genomes related by \(Tr\)
1 forancestor\(i\gets 1\)to \(I\)do
2 if\(i==1\)then
3 initialize ancestor \(1\) with genes in \(N(1\times J)\) randomly distributed in \(7\) chromosomes;
4 else
5 construct ancestor \(i\) by doubling or equal \(N((i-1)\times J)\) according to the whole genome duplication event related to ancestor \(i\);
6 doing translocations and inversions in ancestor \(i\);
7
8 end if
9 adjust the number of gene families in each ancestor by inserting/removing families at random positions;
10 foreachgenome\(g\) connected with ancestor \(i\)in \(Tr\)do
11 construct \(g\) by doubling, tripling or quadrupling ancestor \(i\) according to the whole genome duplication event that relates \(g\) to ancestor \(i\) in \(Tr\);
12 do
13\(g\) is a terminal node in \(Tr\)then
14 adjust \(g\) by inserting/removing genes or fission/fusion chromosomes so that gene and chromosome contents in \(g\) is consistent with its corresponding extant genome \(G_{h}\) in \(Tr\);
15 append \(g\) to \(G^{\prime}\);
16
17 end if
18
19 end for
20 return \(G^{\prime}\);
```  
**Algorithm 3**The simulation of gene repertoire in extant genomes  
As considered in the monocot example in this paper, the simulation starts with Ancestor \(1\), made up of abstract genes belonging to specified gene families \(j\) in numbers \(N(1,j)\) determined previously. These genes are ordered randomly on seven chromosomes of approximately equal size as in Line 3 of Algorithm 3.  
In Line 5, each of the remaining ancestors is generated by doubling or equaling its previous ancestor.  
In Line 6, each of these ancestral genomes is then subjected to inversions and translocations randomly in numbers previously calculated [5].  
In Line 8, in each ancestor, missing gene families are added randomly and extra families are removed according to \(\Delta=M(h,j)-r_{h}\times N(anc(h),j)\) in Equation (3). If \(\Delta\) is negative, remove genes from the gene family; otherwise, add genes into the family.  
In Line 10, to obtain the three simulated descendants of Ancestor 1, namely, _Acorus_, _Spirodela_ and Ancestor 2, the genome of Ancestor 1 is doubled, quadrupled and doubled, respectively.  
In Line 11, each extant descendant genome is then subjected to inversions and translocations in numbers previously calculated [5].  
In Line 13, in each gene family of each descendant, the number of genes generated by the whole genome doublings of its immediate ancestor is compared to the number of genes known to be in that family in that genome. Missing genes are simply added to the simulated genome, inserted at random on one of the chromosomes. Extra genes are just deleted from the gene family from random positions in the genome.  
The number of chromosomes in each descendant is then adjusted by fusions of the shortest chromosomes to form a new longer one.  
The simulation continues in the same manner for the descendants of Ancestor 2, and then Ancestors 3 and 4.  
We thus create a set of six simulated genomes with the same gene families distributed in the same way as in the given monocots. The only difference is that the gene orders are completely random with respect to the real data, although we have retained the quantitative structure of the gene families.