The pyp_demog Module

pyp_demog contains a set of procedures for demographic calculations on the population describe in a pedigree.

Module Contents

age_distribution(pedobj, sex=1) [#]

age_distribution() computes histograms of the age distribution of males and females in the population. You can also stratify by sex to get individual histograms.

myped
An instance of a PyPedal NewPedigree object.
sex
A flag which determines whether or not to stratify by sex.

founders_by_year(pedobj) ⇒ dictionary [#]

founders_by_year() returns a dictionary containing the number of founders in each birthyear.

pedobj
A PyPedal pedigree object.
Returns:
dict A dictionary containing entries for each sex/gender code defined in the global SEX_CODE_MAP.

set_age_units(units='year') ⇒ None [#]

set_age_units() defines a global variable, BASE_DEMOGRAPHIC_UNIT.

units
The base unit for age computations ('year'|'month'|'day').
Returns:
None

set_base_year(year=1900) ⇒ None [#]

set_base_year() defines a global variable, BASE_DEMOGRAPHIC_YEAR.

year
The year to be used as a base for computing ages.
Returns:
None

sex_ratio(pedobj) ⇒ dictionary [#]

sex_ratio() returns a dictionary containing the proportion of males and females in the population.

myped
An instance of a PyPedal NewPedigree object.
Returns:
dict A dictionary containing entries for each sex/gender code defined in the global SEX_CODE_MAP.