Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.23 KB

README_merger.rst

File metadata and controls

31 lines (22 loc) · 1.23 KB

Introduction

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.

Usage

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()