Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metabolite drug factor calculation to match AS and AR conversion model unittests. #134

Closed
tph-thuering opened this issue Aug 18, 2015 · 5 comments

Comments

@tph-thuering
Copy link
Contributor

See https://github.com/SwissTPH/openmalaria/blob/develop/model/PkPd/Drug/LSTMDrugConversion.cpp#L114

double calculateMetaboliteQuantity(struct Params_convFactor p, double qtyG, double qtyP, double qtyM, double expAbsorb, double expPLoss, double t) {
    return p.g * qtyG * expAbsorb
        + (p.h * qtyG - p.i * qtyP) * expPLoss
        + (p.j * qtyG - p.i * qtyP + qtyM) * exp(p.nkM * t);
}
double calculateMetaboliteDrugFactor( struct Params_convFactor p, double expAbsorb, double expPLoss, double t ) {
    const double qtyM = calculateMetaboliteQuantity(p, p.qtyG, p.qtyP, p.qtyM, expAbsorb, expPLoss, t);
    const double cM = qtyM * p.invVdM;              // concentrations; mg/l
    const double cnM = pow(cM, p.nM);               // (mg/l) ^ n
    //FIXME:
    // correctional factor tries to fix results for metabolite quantity calculation
    const double correction_factor = 0.990718;
    const double fCM = correction_factor * p.VM * cnM / (cnM + p.KnM);  // unitless
    return fCM;
}
@tph-thuering
Copy link
Contributor Author

@KatherineKay For later reference.

@tph-thuering tph-thuering modified the milestones: post-Schema-34, Schema 34 Sep 9, 2015
@dhardy
Copy link
Collaborator

dhardy commented Oct 27, 2015

Tobi, was this trying to account for differences to Katherine's code? If so it would be useful to be able to reproduce her results.

@dhardy dhardy self-assigned this May 31, 2016
@dhardy
Copy link
Collaborator

dhardy commented Jun 22, 2016

Issue is being worked on in this branch.

One issue with incorrect drug concentration has been fixed, but some other errors remain (mostly to do with drug factors).

@dhardy
Copy link
Collaborator

dhardy commented Jun 22, 2016

Most PK/PD tests have been checked, all updated to use plenty of precision. As noted in the last commit, the only significant source of errors is the drug factors in the AS-DHA conversion test.

@dhardy
Copy link
Collaborator

dhardy commented Jun 23, 2016

Drug factor differences have been identified as slight methodological differences, as documented here.

We decided the 5-10% difference (only 10% for survival rates under 1 in 10^9) is not that significant for our usage.

@dhardy dhardy closed this as completed Jun 23, 2016
dhardy added a commit that referenced this issue Jun 30, 2016
This includes fixes for #134, #155 and #169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants