pandas_genomics.sim.BAMS

class pandas_genomics.sim.BAMS(pen_table: Union[numpy.array, pandas_genomics.sim.biallelic_model_simulator.PenetranceTables] = array([[0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [1.0, 1.0, 2.0]]), penetrance_base: float = 0.25, penetrance_diff: Optional[float] = None, snp1: Optional[pandas_genomics.scalars.Variant] = None, snp2: Optional[pandas_genomics.scalars.Variant] = None, random_seed: int = 1855)[source]

Biallelic Model Simulator. Used to simulate two SNPs with phenotype data based on a penetrance table.

It can be initialized using the PenetranceTables enum or using from_model with values from the SNPEffectEncodings enum.

__init__(pen_table: Union[numpy.array, pandas_genomics.sim.biallelic_model_simulator.PenetranceTables] = array([[0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [1.0, 1.0, 2.0]]), penetrance_base: float = 0.25, penetrance_diff: Optional[float] = None, snp1: Optional[pandas_genomics.scalars.Variant] = None, snp2: Optional[pandas_genomics.scalars.Variant] = None, random_seed: int = 1855)[source]
Parameters
pen_table: 3x3 np array or PenetranceTables enum

Penetrance values. Will be scaled between 0 and 1 if needed.

penetrance_base: float, default 0.25

Baseline to use in the final penetrance table, must be in [0,1]

penetrance_diff: optional float, default None (use 1-2*penetrance_base)

Difference between minimum and maximimum probabilities in the penetrance table. penetrance_base + penetrance_diff must be in [0,1]

snp1: Optional[Variant]
snp2: Optional[Variant]
random_seed: int, default 1855

Methods

__init__([pen_table, penetrance_base, …])

Parameters

from_model([eff1, eff2, penetrance_base, …])

Create a BiallelicSimulation with a Penetrance Table based on a fully specified model y = β0 + β1(eff1) + β2(eff2) + β3(eff1*eff2)

generate_case_control([n_cases, n_controls, …])

Simulate genotypes with the specified number of ‘case’ and ‘control’ phenotypes

generate_quantitative([n_samples, maf1, …])

Simulate genotypes with a quantitative outcome (mean = probability based on genotypes, sd = 1)

set_random_seed(new_seed)

Reset the random number generator with the specified seed.

Attributes

random_seed