You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any entry with a death (also birth?) of 0 is removed from FDF specification and oncoSimulIndiv fails if other entries depend on this one.
Example:
## Originalfe1<- allFitnessEffects(
deathSpec=TRUE, # Enable explicit death rate specificationgenotFitness=data.frame(
Genotype= c("WT", "A", "B", "A, B"), # Use "A, B" for combined genotypesBirth= c(
"1 + 1 * f_A_B", # WT: Birth rate increases with SASP frequency"1 + 1 * f_A_B", # A: Birth rate increases with SASP frequency"1", # B: Constant birth rate"0.01"# A, B: Low proliferation (birth rate)
),
Death= c(
"0.1", # WT: Constant death rate"0.1", # A: Constant death rate"0.1", # B: Constant death rate"0"# A, B: No death for SASP cells
)
),
frequencyDependentBirth=TRUE, # Enable dynamic birth ratesfrequencyType="rel"# Use relative frequencies
)
sim<- oncoSimulIndiv(
model="Arb", # Use the Arb modelfe1, # Fitness effects with birth and death ratesinitSize=10000, # Initial population sizemu=1e-4, # Base mutation ratefinalTime=3000, # Simulation durationdetectionSize=1e6# Maximum population size
)
## A genotype on which other specifications depend is missing!! ## AB is missingfe1[c("fitnessLandscape", "fitnessLandscape_df", "full_FDF_spec")]
## We can try writing 0 as 0.0 or passing, as Death,## a numeric (not string) column. As expected,## tt does not solve it## The problem is that any row with a value of 0 is removed## probably in some processing step. This is often what## we want, but here other genotypes's specifications## depend on AB.
These three options solve it. The first two are the same except for using a column of strings or floats.
fe4<- allFitnessEffects(
deathSpec=TRUE, # Enable explicit death rate specificationgenotFitness=data.frame(
Genotype= c("WT", "A", "B", "A, B"), # Use "A, B" for combined genotypesBirth= c(
"1 + 1 * f_A_B", # WT: Birth rate increases with SASP frequency"1 + 1 * f_A_B", # A: Birth rate increases with SASP frequency"1", # B: Constant birth rate"0.01"# A, B: Low proliferation (birth rate)
),
Death= c(0.1, 0.1, 0.1, 1.000000001e-9)
),
frequencyDependentBirth=TRUE, # Enable dynamic birth ratesfrequencyType="rel"# Use relative frequencies
)
## AB genotype is backfe4[c("fitnessLandscape", "fitnessLandscape_df", "full_FDF_spec")]
fe5<- allFitnessEffects(
deathSpec=TRUE, # Enable explicit death rate specificationgenotFitness=data.frame(
Genotype= c("WT", "A", "B", "A, B"), # Use "A, B" for combined genotypesBirth= c(
"1 + 1 * f_A_B", # WT: Birth rate increases with SASP frequency"1 + 1 * f_A_B", # A: Birth rate increases with SASP frequency"1", # B: Constant birth rate"0.01"# A, B: Low proliferation (birth rate)
),
Death= c(
"0.1", # WT: Constant death rate"0.1", # A: Constant death rate"0.1", # B: Constant death rate"0.000000001000000001"# A, B: (almost) No death for SASP cells
)
),
frequencyDependentBirth=TRUE, # Enable dynamic birth ratesfrequencyType="rel"# Use relative frequencies
)
## AB genotype is backfe5[c("fitnessLandscape", "fitnessLandscape_df", "full_FDF_spec")]
fe6<- allFitnessEffects(
deathSpec=TRUE, # Enable explicit death rate specificationgenotFitness=data.frame(
Genotype= c("WT", "A", "B", "A, B"), # Use "A, B" for combined genotypesBirth= c(
"1 + 1 * f_A_B", # WT: Birth rate increases with SASP frequency"1 + 1 * f_A_B", # A: Birth rate increases with SASP frequency"1", # B: Constant birth rate"0.01"# A, B: Low proliferation (birth rate)
),
Death= c(
"0.1" , # WT: Constant death rate"0.1", # A: Constant death rate"0.1", # B: Constant death rate"0.0 + 0 * f_A"# A, B: No death for SASP cells
)
),
frequencyDependentDeath=TRUE, ## Force using fdf for deathfrequencyDependentBirth=TRUE, # Enable dynamic birth ratesfrequencyType="rel"# Use relative frequencies
)
## AB genotype is backfe6[c("fitnessLandscape", "fitnessLandscape_df", "full_FDF_spec")]
Now, fe4 and fe5 are equivalent and work via introducing a death that is not 0 (though very similar to 0). fe6 works by setting a death of 0 by using an expression that always returns 0, but will work via the frequency dependent fitness.
So fe6 works.
What should be fixed
Either or both of:
a) Give a warning that a value is 0
b) Do not remove the entry if other entries depend on it, or give a message saying how to circumvent it.
Additional notes to fix it and add tests
Testing code in OncoSimul/OncoSimulR/tests/testthat/test.Z-oncoSimulIndivDeath.R
(e.g., lines 210, 282, 312:
Summary:
Any entry with a death (also birth?) of 0 is removed from FDF specification and oncoSimulIndiv fails if other entries depend on this one.
Example:
These three options solve it. The first two are the same except for using a column of strings or floats.
Now, fe4 and fe5 are equivalent and work via introducing a death that is not 0 (though very similar to 0). fe6 works by setting a death of 0 by using an expression that always returns 0, but will work via the frequency dependent fitness.
So fe6 works.
What should be fixed
Either or both of:
a) Give a warning that a value is 0
b) Do not remove the entry if other entries depend on it, or give a message saying how to circumvent it.
Additional notes to fix it and add tests
Testing code in OncoSimul/OncoSimulR/tests/testthat/test.Z-oncoSimulIndivDeath.R
(e.g., lines 210, 282, 312:
OncoSimul/OncoSimulR/tests/testthat/test.Z-oncoSimulIndivDeath.R
Line 210 in b9b77ec
OncoSimul/OncoSimulR/tests/testthat/test.Z-oncoSimulIndivDeath.R
Line 282 in b9b77ec
OncoSimul/OncoSimulR/tests/testthat/test.Z-oncoSimulIndivDeath.R
Line 312 in b9b77ec
This problem was detected by Gonzalo García Girón, from class PRSTR 2024-25, on 2024-12-31.
The text was updated successfully, but these errors were encountered: