Skip to contents

Implements the Rockne2020 validation projection: $$X_{\rm secondary} \cdot V^*_{\rm primary}$$ which places secondary samples on the same coordinate axes as the primary, without re-fitting the decomposition.

Usage

project_into(
  std_primary,
  std_secondary,
  layer_primary = 1L,
  layer_secondary = 1L
)

Arguments

std_primary

StateTransitionData with metadata()$stage1 present — supplies the \(V^*\) loadings.

std_secondary

StateTransitionData to project. Must share the same feature space (genes) as the primary.

layer_primary

integer — which layer of the primary object provides the \(V^*\) loadings (default 1).

layer_secondary

integer — which single layer of the secondary object to project (default 1). project_into() always projects exactly one layer per call — a projected layer was never itself decomposed, so it carries no signal-strength information of its own to combine across layers. If the secondary cohort has its own multi-layer structure (e.g. its own disease/control split), call project_into() once per layer, varying layer_secondary.

Value

std_secondary with metadata()$stage1 written.

Details

The returned object is std_secondary augmented with metadata()$stage1 containing projected coordinates. The primary object is not modified.