Skip to contents

Builds tidy tables from the nested list returned by [susie_post_outcome_configuration()] and prints them with ANSI color highlighting via [print.summary.susie_post_outcome_configuration()]. The summary itself is an S3 object: index `$susiex` and `$coloc_pairwise` to grab the data.frames for downstream use.

Usage

# S3 method for class 'susie_post_outcome_configuration'
summary(
  object,
  prob_thresh = 0.8,
  ambiguous_lower = 0.5,
  signal_only = TRUE,
  color = "auto",
  ...
)

Arguments

object

Output of [susie_post_outcome_configuration()].

prob_thresh

Threshold above which `marginal_prob` counts as a signal (default `0.8`).

ambiguous_lower

Lower edge of the "ambiguous" band for the SuSiEx color coding: marginals in `[ambiguous_lower, prob_thresh)` are colored yellow. Default `0.5`. Set to `prob_thresh` to disable the band.

signal_only

Logical. If `TRUE` (default), drop CS tuples where no trait is active and drop coloc rows whose dominant hypothesis is H0. Pass `FALSE` to keep everything.

color

One of `"auto"` (default; honors [crayon::has_color()]), `TRUE` (force colors on), or `FALSE` (force them off).

...

Ignored.

Value

A list of class `"summary.susie_post_outcome_configuration"` with components:

`$susiex`

`data.frame` (or `NULL` when no signals): one row per CS tuple. Columns: `tuple` (e.g. `"(1,1,1)"`), one numeric column per trait carrying that trait's `marginal_prob`, `top_pattern` (binary configuration string for the most-probable configuration), `top_prob` (its probability).

`$coloc_pairwise`

`data.frame` (or `NULL`): the original coloc table extended with `verdict` (named hypothesis label) and `top_pp` (the dominant PP value).

`$susiex_n_total`, `$susiex_n_kept`, `$coloc_n_total`, `$coloc_n_kept`

row counts before and after `signal_only` filtering, used by the print method to footer hidden rows.

`$prob_thresh`, `$ambiguous_lower`, `$signal_only`, `$color`

parameters echoed for the print method.

Details

Color encoding (when ANSI colors are available):

  • SuSiEx per-trait marginal probability: bold dark green when `>= prob_thresh` (active), yellow when in `[ambiguous_lower, prob_thresh)`, dim otherwise. The `active` logical from the raw result is encoded by color and is not shown as a separate column.

  • Coloc verdict: bold dark green for H4 (shared causal), magenta for H3 (distinct causals), blue for H1 or H2 (single-trait causal), dim for H0 (no signal). The dominant PP per row is bolded.

Robustness: this method is defensive against malformed input. Empty lists, NULL components, missing fields, length-mismatched per-trait vectors, trait names that collide with reserved columns (`tuple`, `top_pattern`, `top_prob`), and coloc data.frames that lack some optional columns (`hit1`, `hit2`) all degrade gracefully rather than erroring.

See also

[susie_post_outcome_configuration()], [print.summary.susie_post_outcome_configuration()]