Skip to content

Intervention example: clarify we can use gene names of many letters #32

@rdiaz02

Description

@rdiaz02

For example, this works

### Modified from section 14.2 in vignette

df3x <- data.frame(Genotype = c("WT", "Bebe", "Aaa", "Bebe, Aaa", "P53, Aaa"),
                   Fitness = c("0*n_",
                               "1.5",
                               "1.002",
                               "1.303",
                               "1.904"))

afd3 <- allFitnessEffects(genotFitness = df3x,
                          frequencyDependentFitness = TRUE,
                          frequencyType = "abs")

interventions <- list(
    list(ID           = "intOverB",
         Trigger       = "(T >= 5)",
         WhatHappens   = "n_Bebe = n_Bebe * 0.88",
         Repetitions   = Inf,
         Periodicity   = 0.07
         )
)


interventions <- createInterventions(interventions, afd3)

ex1_with_ints <- oncoSimulIndiv(
                    afd3,
                    model = "McFLD",
                    mu = 1e-4,
                    sampleEvery = 0.01,
                    initSize = c(20000, 20000),
    initMutant = c("Aaa", "Bebe"),
    finalTime = 10,
    onlyCancer = FALSE,
    interventions = interventions)

plot(ex1_with_ints, show="genotypes", type = "line")

#### More complex interventions


interventions2 <- list(
    list(ID           = "intOverB",
         Trigger       = "(T >= 5)",
         WhatHappens   = "n_Bebe = n_Bebe * 0.88",
         Repetitions   = Inf,
         Periodicity   = 1
         ),
    ## The next cannot be used, as P53 always has fitness 0
    ## list(ID           = "P53",
    ##      Trigger       = "(T >= 10)",
    ##      WhatHappens   = "n_P53 = n_P53 * 0.1",
    ##      Repetitions   = Inf,
    ##      Periodicity   = 0.07
    ##      ),
    list(ID           = "I1a",
         Trigger       = "(T >= 15)",
         WhatHappens   = "n_Aaa_Bebe = n_Aaa_Bebe * 0.9",
         Repetitions   = Inf,
         Periodicity   = 1
         ),
    list(ID           = "ii1",
         Trigger       = "(T >= 1)",
         WhatHappens   = "n_Aaa_P53 = n_Aaa_P53 * 0.5",
         Repetitions   = Inf,
         Periodicity   = 1
         )
)

interventions2 <- createInterventions(interventions2, afd3)

ex2_with_ints <- oncoSimulIndiv(
    afd3,
    model = "McFLD",
    mu = 1e-4,
    sampleEvery = 0.01,
    initSize = c(20000, 20000),
    initMutant = c("Aaa", "Bebe"),
    finalTime = 20,
    onlyCancer = FALSE,
    interventions = interventions2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions