oscar_colony.historical_stats.LineStatistics#

class oscar_colony.historical_stats.LineStatistics(line_name, mutations=<factory>, n_mutations=0, total_n_offspring=0, total_n_genotyped_offspring=0, total_n_offspring_per_genotype=<factory>, total_n_successful_matings=0, average_litter_size=0, stats_per_breeding_scheme=<factory>)[source]#
__init__(line_name, mutations=<factory>, n_mutations=0, total_n_offspring=0, total_n_genotyped_offspring=0, total_n_offspring_per_genotype=<factory>, total_n_successful_matings=0, average_litter_size=0, stats_per_breeding_scheme=<factory>)#

Methods

__init__(line_name[, mutations, ...])

create_n_per_genotype_df()

Create a DataFrame from total_n_offspring_per_genotype.

create_scheme_number_df()

Create a DataFrame from stats_per_breeding_scheme, summarising the number of offspring per genotype.

create_scheme_proportion_df([decimal_places])

Create a DataFrame from stats_per_breeding_scheme, summarising the proportion of offspring per genotype.

create_scheme_summary_df([decimal_places])

Create a DataFrame from stats_per_breeding_scheme containing summary stats.

Attributes

average_litter_size

n_mutations

total_n_genotyped_offspring

total_n_offspring

total_n_successful_matings

line_name

mutations

total_n_offspring_per_genotype

stats_per_breeding_scheme

create_n_per_genotype_df()[source]#

Create a DataFrame from total_n_offspring_per_genotype.

Columns are: ‘Genotype’ and ‘N offspring’.

Return type:

DataFrame

create_scheme_number_df()[source]#

Create a DataFrame from stats_per_breeding_scheme, summarising the number of offspring per genotype.

Columns are: ‘Scheme’, followed by one column per expected genotype e.g. ‘wt_het’ / ‘wt_hom’…

Return type:

DataFrame

create_scheme_proportion_df(decimal_places=None)[source]#

Create a DataFrame from stats_per_breeding_scheme, summarising the proportion of offspring per genotype.

Columns are: ‘Scheme’, followed by one column per expected genotype e.g. ‘wt_het’ / ‘wt_hom’…

Parameters:

decimal_places (int | None) – Number of decimal places to round float values to

Returns:

Proportion of genotype per breeding scheme

Return type:

DataFrame

create_scheme_summary_df(decimal_places=None)[source]#

Create a DataFrame from stats_per_breeding_scheme containing summary stats.

Columns are: “Scheme”, “N breeding pairs”, “Total successful matings”, “Average litter size”, “Average litters per pair”, “Total offspring”, “Total genotyped offspring”

Parameters:

decimal_places (int | None) – Number of decimal places to round float values to

Returns:

Summary stats for each breeding scheme

Return type:

DataFrame