Function documentation#
- fwdpy11.infinite_sites(rng, pop, mu)#
- Parameters:
- rng ( - fwdpy11.GSLrng) – Random number generator
- pop ( - fwdpy11.DiploidPopulation) – A population
- mu (float) – The mutation rate, per haploid genome per generation 
 
- Returns:
- Number of mutations added 
- Return type:
 
- fwdpy11.simplify_tables(tables, samples)#
- Simplify a TableCollection. - Parameters:
- pop ( - fwdpy11.TableCollection) – A table collection.
- samples – list of samples 
 
- Returns:
- A simplified TableCollection and an array containing remapped sample ids. 
- Return type:
 - Added in version 0.3.0. 
- fwdpy11.evolvets(rng, pop, params, simplification_interval, recorder=None, *, post_simplification_recorder=None, suppress_table_indexing=None, record_gvalue_matrix=None, stopping_criterion=None, track_mutation_counts=None, remove_extinct_variants=None, preserve_first_generation=None)#
- Evolve a population with tree sequence recording - Parameters:
- rng ( - fwdpy11.GSLrng) – random number generator
- pop ( - fwdpy11.DiploidPopulation) – A population
- params ( - fwdpy11.ModelParams) – simulation parameters
- simplification_interval (int) – Number of generations between simplifications. 
- recorder (Callable) – (None) A temporal sampler/data recorder. 
- post_simplification_recorder (Callable) – (None) A temporal sampler 
- suppress_table_indexing (Optional[bool]) – (None) Prevents edge table indexing until end of simulation. The default value (None) will be interpreted as True 
- record_gvalue_matrix (Optional[bool]) – (False) Whether to record genetic values into - fwdpy11.DiploidPopulation.genetic_values. A value of None will be treated as False.
- preserve_first_generation (Optional[bool]) – (None) Whether to record generation 0 as ancient samples. Must be True for tree sequence “recapitation”. See Finishing a simulation with msprime. A value of None will be treated as False. 
 
 - The recording of genetic values into - fwdpy11.DiploidPopulation.genetic_valuesis suppressed by default. First, it is redundant with- fwdpy11.DiploidMetadata.gfor the common case of mutational effects on a single trait. Second, we save some memory by not tracking these matrices. However, it is useful to track these data for some cases when simulating multivariate mutational effects (pleiotropy).- Note - If recorder is None, then - fwdpy11.NoAncientSampleswill be used.- If post_simplification_recorder is None, then - fwdpy11.RecordNothingwill be used.- Changed in version 0.5.2: Added post_simplification_recorder. - Changed in version 0.7.1: Added preserve_first_generation. - Changed in version 0.8.0: Update to refactored ModelParams. Added - check_demographic_event_timings.
- fwdpy11.data_matrix_from_tables(tables, samples, *, record_neutral=True, record_selected=True, include_fixations=False, begin=0.0, end=None)#
- Create a - fwdpy11.DataMatrixfrom a table collection.- Parameters:
- tables (fwdpy11.TableCollection) – A TableCollection 
- samples (list or - numpy.ndarray) – A list of sample nodes
- record_neutral (bool) – (True) If True, generate data for neutral variants 
- record_selected (bool) – (True) If True, generate data for selected variants 
- include_selected (bool) – (False) Whether to include variants fixed in the sample 
- begin – (0.0) Start of range, inclusive 
- end – (max float) End of range, exclusive 
 
- Return type:
 - Added in version 0.3.0. - Changed in version 0.4.1: Add begin, end options as floats - Changed in version 0.5.0: No longer requires - fwdpy11.MutationVectorargument