Skip to content

Main content

Pharmacogene Allele Frequency Sum Residual Tool

Calculate pharmacogene allele frequency sum residual from explicit caller-supplied inputs.

Loading tool…

Description

For frequencies and expectedSum within zero through one and nonnegative tolerance return sum, residual=sum-expectedSum, and within=(abs(residual)<=tolerance).

Pharmacogenomic records distinguish allele labels, copy counts, reference-sequence versions, coordinate systems, and evidence about chromosome phase. A balanced count or matching token can check a record without establishing the underlying genotype. Supplied activity values and interpretation rules remain separate from a current gene-specific clinical guideline.

For frequencies and expectedSum within zero through one and nonnegative tolerance return sum, residual=sum-expectedSum, and within=(abs(residual)<=tolerance).

When to use this tool

Use Pharmacogene Allele Frequency Sum Residual when you need this specific allele-token, reference-coordinate, copy-budget, or source-support check.

How to use the tool and how it works

  1. Enter frequencies, expectedSum, tolerance. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read sum, residual, within. Inspect within before interpreting the associated values.

For frequencies and expectedSum within zero through one and nonnegative tolerance return sum, residual=sum-expectedSum, and within=(abs(residual)<=tolerance).1

Input fieldMeaning and unitsAccepted input
frequenciesFrequenciesRequired. Array of finite number; maximum items 256.
expectedSumExpected SumRequired. Finite number; minimum 0; maximum 1.
toleranceNonnegative absolute tolerance in the compared quantity's unit.Required. Finite number; minimum 0.
Output fieldInterpretationReturned shape
sumSumRequired. Finite number.
residualSum minus supplied expectedSum, without normalization.Required. Finite number.
withinWithinRequired. Boolean.
json
{
  "input": {
    "frequencies": [
      0.2,
      0.3,
      0.4
    ],
    "expectedSum": 1,
    "tolerance": 0.05
  },
  "output": {
    "sum": 0.9,
    "residual": -0.09999999999999998,
    "within": false
  }
}

Limitations and assumptions

  • Sum itself can exceed one. Frequencies are not normalized or checked for shared population, disjoint alleles, sampling uncertainty, or a complete allele catalog.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Signed zero is exported as zero.

Alternative or Complementary methods

Use a current gene-specific nomenclature and a validated interpretation process when allele identity, phase, function, or clinical decisions matter. Verify source versions and reference coordinates before combining records.

References

  1. Calculation and input contract: pharmacogenomics/pharmacogene-allele-frequency-sum-residual — tool.io

Similar or alternative tools