Skip to content

Main content

Phred Error Odds Tool

Convert a supplied Phred score to error probability and finite error odds, preserving the Q=0 undefined-odds flag.

Loading tool…

Description

Return Phred error probability and odds with an undefined-odds flag.

Sequence text, ambiguity codes and encoded quality scores describe different information. Literal alphabets and Phred transformations can be checked without identifying a molecule or proving calibrated sequencing accuracy; missingness and reporting encodings require explicit conventions.

Return Phred error probability and odds with an undefined-odds flag.

When to use this tool

Use Phred Error Odds when checking the stated sequence token, ambiguity, quality symbol or local trimming convention.

How to use the tool and how it works

  1. Enter quality. 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 errorProbability, errorOdds, oddsDefined. Inspect oddsDefined before interpreting the associated values.

Return Phred error probability and odds with an undefined-odds flag. Require quality >= 0; probability = 10^(-quality/10), odds = p/(1-p) using a stable expression near p=1, or zero placeholder at quality zero.1

SAM/BAM defines separate flag, quality and CIGAR conventions. This local operation does not validate a complete alignment record.2

Input fieldMeaning and unitsAccepted input
qualityNonnegative real Phred score, not restricted to a character encoding or whole number.Required. Finite number; minimum 0.
Output fieldInterpretationReturned shape
errorProbabilityError ProbabilityRequired. Finite number.
errorOddsp/(1-p) for Q>0, zero placeholder for Q=0; check oddsDefined.Required. Finite number.
oddsDefinedOdds DefinedRequired. Boolean.
json
{
  "input": {
    "quality": 20
  },
  "output": {
    "errorProbability": 0.01,
    "errorOdds": 0.010101010101010102,
    "oddsDefined": true
  }
}

Limitations and assumptions

  • At Q=0 the probability is one and odds are undefined; large Q may underflow to zero, without establishing calibrated sequencing accuracy.
  • 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. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a complete format-aware sequence/quality workflow and the appropriate reference/genetic code; assess biological identity and quality calibration independently.

References

  1. Calculation and input contract: bioinformatics/phred-error-odds — tool.io

  2. SAM/BAM format specification, version 1.6 — SAM/BAM Format Specification Working Group

Similar or alternative tools