Simulations can be merged using the Merger class <pycoalescence.merger.Merger>
. Here, multiple simulations are combined into a single database, with each simulation being associated with a particular "guild". These guilds could represent different environmental niches, body sizes or other differentiating factors.
Add simulations using add_simulation() <pycoalescence.merger.Merger.add_simulation>
and then use write() <pycoalescence.merger.Merger.write>
.
Previously calculated metrics are all stored in *_GUILDS tables. Species identities are preserved (without allowing for a species to exist in more than one guild), meaning all metrics can be re-calculated using apply() <pycoalescence.coalescence_tree.CoalescenceTree.apply>
and functions such as calculate_richness() <pycoalescence.coalescence_tree.CoalescenceTree.calculate_richness>
. Alternatively, use add_simulations() <pycoalescence.merger.Merger.add_simulations>
merger = Merger("output.db")
merger.add_simulation("input1.db")
merger.add_simulation("input2.db")
merger.write()