|
2 | 2 | window.PhenoAge = window.PhenoAge || {};
|
3 | 3 |
|
4 | 4 | // Attach biomarkers to the namespace
|
| 5 | +// https://github.com/nopara73/LongevityWorldCup/issues/136 |
5 | 6 | window.PhenoAge.biomarkers = [
|
6 | 7 | { id: 'age', name: 'Age', coeff: 0.0804 }, // Age has no known lower cap
|
7 |
| - { id: 'albumin', name: 'Albumin', coeff: -0.0336, cap: 50 }, |
8 |
| - { id: 'creatinine', name: 'Creatinine', coeff: 0.0095, cap: 60 }, |
9 |
| - { id: 'glucose', name: 'Glucose', coeff: 0.1953, cap: 4 }, |
| 8 | + { id: 'albumin', name: 'Albumin', coeff: -0.0336 }, // No upper cap |
| 9 | + { id: 'creatinine', name: 'Creatinine', coeff: 0.0095, cap: 44 }, |
| 10 | + { id: 'glucose', name: 'Glucose', coeff: 0.1953, cap: 4.44 }, |
10 | 11 | { id: 'crp', name: 'C-reactive protein', coeff: 0.0954 }, // CRP has no known lower cap
|
11 |
| - { id: 'wbc', name: 'White blood cell count', coeff: 0.0554, cap: 4.5 }, |
12 |
| - { id: 'lymphocyte', name: 'Lymphocytes', coeff: -0.012, cap: 40 }, |
13 |
| - { id: 'mcv', name: 'Mean corpuscular volume', coeff: 0.0268, cap: 85 }, |
14 |
| - { id: 'rcdw', name: 'Red cell distribution width', coeff: 0.3306, cap: 11.5 }, |
15 |
| - { id: 'ap', name: 'Alkaline phosphatase', coeff: 0.0019, cap: 50 } |
| 12 | + { id: 'wbc', name: 'White blood cell count', coeff: 0.0554, cap: 3.5 }, |
| 13 | + { id: 'lymphocyte', name: 'Lymphocytes', coeff: -0.012, cap: 60 }, |
| 14 | + { id: 'mcv', name: 'Mean corpuscular volume', coeff: 0.0268 }, // No lower cap |
| 15 | + { id: 'rcdw', name: 'Red cell distribution width', coeff: 0.3306, cap: 11.4 }, |
| 16 | + { id: 'ap', name: 'Alkaline phosphatase', coeff: 0.0019 } // No lower cap |
16 | 17 | ];
|
17 | 18 |
|
18 | 19 | // Helper function to parse input values
|
@@ -46,7 +47,7 @@ window.PhenoAge.calculatePhenoAge = function (markerValues, coefficients) {
|
46 | 47 | // Cap marker values to reference ranges
|
47 | 48 | let cappedMarkerValues = [];
|
48 | 49 | for (let i = 0; i < markerValues.length; i++) {
|
49 |
| - if (i == 0 || i == 4) { |
| 50 | + if (i == 0 || i == 1 || i == 4 || i == 7 || i == 9) { |
50 | 51 | // Age marker is not capped
|
51 | 52 | // CRP is not capped
|
52 | 53 | cappedMarkerValues.push(markerValues[i]);
|
|
0 commit comments