Skip to content

Commit

Permalink
pedigree sim docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesbecher committed Oct 4, 2024
1 parent 2c1b195 commit c670ac2
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions msprime/pedigrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,28 +459,27 @@ def sim_pedigree(
direction="forward",
):
"""
Simulates a pedigree
Arguments:
population_size (int or function): The population size at each generation.
If a function, it should take a single argument, the generation number,
and return the population size at that generation.
num_samples (int): The number of individuals at generation 0
If None, the population size at generation 0 is used.
sequence_length (float): The length of the sequence to simulate.
If None, the sequence length is set to -1.
random_seed (int): The random seed to use for the simulation.
end_time (int): The number of generations to simulate.
direction (str): The direction of time to simulate. Either "forward" or
"backward".
Returns:
A TableCollection containing the simulated pedigree.
Examples:
>>> sim_pedigree(population_size=10, end_time=5, direction="forward")
>>> N_function = lambda t: [10,20,100,1000,2][t]
>>> sim_pedigree(population_size=N_function, end_time=4, direction="backward")
Simulate a pedigree with the specified parameters.
:param int|function population_size: The population size at each
generation. This can be a single value, or a function that takes
the generation number as input and returns the population size.
If a function is provided, the function is called with the
generation number 0 to determine the number of samples.
:param int|None num_samples: The number of samples (at generation 0).
If None, the number of samples is equal to the population size at
generation 0.
:param float|None sequence_length: The sequence length of the resulting
TableCollection.
:param int|None random_seed: The random seed to use. If None, the random
seed is not set.
:param int end_time: The end time of the pedigree (in generations back
in time).
:param str direction: The direction of time in the pedigree. Either
'forward' or 'backward'.
:return: The TableCollection containing the pedigree data.
:rtype: tskit.TableCollection
"""

# Internal utility for generating pedigree data. This function is not
Expand Down

0 comments on commit c670ac2

Please sign in to comment.