A 2x2-contingency table of observed absolute frequencies shows the 4 possible constellations of events:

  Disease present (D+) Disease absent (D-)
Test result positive (T+) A (events D+ and T+) C (events D- and T+)
Test result negative (T-) B (events D+ and T-) D (events D- and T-)
  A + B (diseased subjects) C + D (healthy subjects)

Now, computation of pre-test probability (P(D), post-test-probability P(D+/T+), sensitivity (P(T+/D+) and specificity P(T-/D-) is easy:

P(D) (A + B) / (A + B + C + D)
P(D+/T+) A / (A + C)
Sensitivity P(T+/D+) A / (A + B)
Specificity P(T-/D-) D / (C + D)