ictr / mendel_penetrance

0 stars 1 forks source link

Notes on algorithm #3

Open BoPeng opened 1 year ago

BoPeng commented 1 year ago

Algorithm

Overall algorithm:

$\lambda(t) = \lambda_0(t) \exp g(t)$

where $\lambda(t)$ is the breast cancer incidences in carriers, $\lambda_0(t)$ is the background incidence for England and Wales (1973–77) and $\exp[g(t)]$ is the age-specific RR of breast cancer in carriers as compared to population rates.

Code

  1. missing data is represented by 999
  2. missing age of bc, oc, other (agebc=999 etc) are imputed with min(agelfu, agedeath).
  3. The use of agelfu and agedeath is exchangeable in the sense that ages can be put in either columns without changing the results.
  4. trait agebc2 and ageother2 are not used in this model.
  5. age is the min of agebc, ageoc, ageother, or agelfu and agedeath if no cancer.
  6. idis (disease status) is true only if agebc is the first cancer. We will need to change this if we consider any cancer as disease status
  7. PAR is the global RR, which is passed to APEN at each step (with NPAR=1).
  8. $\text{rrbr} =\exp[g(t)]$ is an array of size 80, set by PAR. It is 1 for age < 20, and exp(PAR) otherwise.
  9. $p_1 =(1-0.0004)^2$ is non-carrier frequency, $p_2 = 1 - p1$ is the carrier frequency. we will need to replace it with our own allele frequency
  10. $\text{ffncbr}(t)$ is the non-carrier breast cancer survival probability at age $t$, $\text{ffbr}_i$ is the carrier breast cancer survival probability at age $t$.
  11. $\lambda_0(t)$ is the background incidence

$$\lambda_0(t) = \frac{\text{popbr}(t)}{100000} \frac{p_1 \text{ffncbr}(t) + p_2 \text{ffbr}(t)}{p_1 \text{ffncbr}(t) + p_2 \text{rrbr}(t) \text{ffbr}(t)}$$ $\lambda_1(t) = \lambda_0(t) \text{rrbr}(t)$ is the breast cancer incidences in carriers,

  1. cumncbr is the cummulative non-carrier breast cancer incidence, cumbrrisk is the cumulative carrier breast cancer incidence

$\text{cumncbr} = \sum \lambda_0(t)$ $\text{ffncbr}(t+1) = \exp (-\text{cumncbr}_i)$

$\text{cumbrrisk} = \sum \lambda_1(t)$ $\text{ffbr}(t+1) = \exp(-\text{cumbrrisk}_i)$

  1. isex is 1 for male, and 2 for female.

  2. for each GENOTYPE,

    1. is=1 for wildtype 1/1, and is=2 for 1/2 or 2/2 (which we do not have)
    2. for male, $\text{pen}(t)=1$
    3. for wildtype female,
      1. unaffected $\text{pen}(i) = \text{ffncbr}(t)$
      2. affected $\text{pen}(i) = \text{ffncbr}(t) * \lambda_0(t)$
        1. for mutant female
      3. unaffected $\text{pen}(t) = \text{ffbr}(t)$
      4. affected $\text{pen}(t) = \text{ffbr}(t) * \lambda(t)$
  3. output, log likelihood, and PAR(1).

write(*,20) iter,nstep,loglik,(par(i),i=1,npar)