Skip to contents

Computes leave-one-out diagnostics for each feature by dropping each sample one at a time from each ancestry dataset. Shows how much each sample influences the interaction effect estimate.

Usage

loo_interaction_effect(X, Y, MX, MY, g_col, a_col, feature)

Arguments

X

A numeric matrix or data.frame of expression values for ancestry A.

Y

A numeric matrix or data.frame of expression values for ancestry B.

MX

A data.frame of metadata for X. Must include a column with condition/group labels.

MY

A data.frame of metadata for Y. Must include a column with condition/group labels.

g_col

String. Name of the column in `MX` and `MY` that defines the condition/group (must be a factor with exactly 2 levels).

a_col

String. Name of the column in `MX` and `MY` that defines ancestry.

feature

Character or numeric vector. Names or indices of features (columns) to test.

Value

A tidy data.frame with columns:

feature

Feature name or index.

sample

Sample name that was left out.

T_loo

Interaction effect with that sample left out.

T_obs

Original full-sample interaction effect.

ancestry

Ancestry of the sample ("eur" or "afr").