Skip to content

Params

AssayParams

Bases: BaseModel

Parameters for assay generation.

Parameters:

Name Type Description Default
plate_size int

plate size

4
mean_control float

mean control reading

0.0
mean_normal float

mean normal specimen reading

2.0
mean_mutant float

mean mutant specimen reading

5.0
reading_noise float

standard deviation of plate reading noise

0.5
image_noise int

plate image noise (grayscale 0-255)

32
Source code in src/snailz/params.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class AssayParams(BaseModel):
    """Parameters for assay generation."""

    plate_size: int = Field(default=4, gt=0, description="plate size")
    mean_control: float = Field(default=0.0, ge=0.0, description="mean control reading")
    mean_normal: float = Field(
        default=2.0, ge=0.0, description="mean normal specimen reading"
    )
    mean_mutant: float = Field(
        default=5.0, ge=0.0, description="mean mutant specimen reading"
    )
    reading_noise: float = Field(
        default=0.5, ge=0.0, description="standard deviation of plate reading noise"
    )
    image_noise: int = Field(
        default=32,
        ge=0,
        le=255,
        description="plate image noise (grayscale 0-255)",
    )

SpecimenParams

Bases: BaseModel

Parameters for specimen generation.

Parameters:

Name Type Description Default
mass_mean float

Mean mass

10.0
mass_sd float

Relative standard deviation in mass

1.0
genome_length int

Length of genomes

20
mut_mass_scale float

Scaling for mutant snail mass

2.0
mut_frac float

Fraction of significant mutants

0.2
mut_prob float

Probability of point mutation

0.05
Source code in src/snailz/params.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class SpecimenParams(BaseModel):
    """Parameters for specimen generation."""

    mass_mean: float = Field(default=10.0, gt=0, description="Mean mass")
    mass_sd: float = Field(
        default=1.0, gt=0, description="Relative standard deviation in mass"
    )
    genome_length: int = Field(default=20, gt=0, description="Length of genomes")
    mut_mass_scale: float = Field(
        default=2.0, description="Scaling for mutant snail mass"
    )
    mut_frac: float = Field(
        default=0.2, ge=0.0, le=1.0, description="Fraction of significant mutants"
    )
    mut_prob: float = Field(
        default=0.05, ge=0.0, le=1.0, description="Probability of point mutation"
    )

    model_config = {"extra": "forbid"}

ScenarioParams

Bases: BaseModel

Parameters for entire scenario.

Parameters:

Name Type Description Default
rng_seed int

random number generation seed

required
grid_size int

sample grid size

15
num_sites int

number of sample sites

3
num_specimens int

total number of specimens

10
num_machines int

number of lab machines

5
num_persons int

number of lab staff

5
locale str

name generation locale

'et_EE'
assays_per_specimen int

assays per specimen

2
specimen_params SpecimenParams

specimen generation parameters

required
assay_params AssayParams

assay generation parameters

required
Source code in src/snailz/params.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class ScenarioParams(BaseModel):
    """Parameters for entire scenario."""

    rng_seed: int = Field(required=True, description="random number generation seed")
    grid_size: int = Field(default=15, gt=0, description="sample grid size")
    num_sites: int = Field(default=3, gt=0, description="number of sample sites")
    num_specimens: int = Field(
        default=10, gt=0, description="total number of specimens"
    )
    num_machines: int = Field(default=5, gt=0, description="number of lab machines")
    num_persons: int = Field(default=5, gt=0, description="number of lab staff")
    locale: str = Field(default=DEFAULT_LOCALE, description="name generation locale")
    assays_per_specimen: int = Field(default=2, gt=0, description="assays per specimen")
    specimen_params: SpecimenParams = Field(
        description="specimen generation parameters"
    )
    assay_params: AssayParams = Field(description="assay generation parameters")