compute

PolyGenius data transformation engine

Description

compute provides a high-level interface for data transformations on PolyGeniusData objects. It organizes functions for:

  • compute$scores(): Calculate PRS scores from genotypes

  • compute$populationStructure(): Compute principal components for population stratification correction

  • compute$kinship(): Calculate relatedness matrix

  • compute$singleVariantAssociations(): Perform GWAS on PRS variants

  • compute$similarity$obs(): Compute observation-observation similarity matrices

  • compute$similarity$mod(): Compute model-model similarity matrices

  • compute$embedding$obs(): Compute low-dimensional embeddings for observations

  • compute$embedding$mod(): Compute low-dimensional embeddings for models

Provides a compact overview of the data transformation interface.

Usage

compute

print.computeEngine(x, ...)

Arguments

x

An object of class “computeEngine”, typically the exported compute environment.

Unused. Present for S3 compatibility.

Format

An environment with components:

  • scores(): wrapper for compute.scores()

  • populationStructure(): wrapper for compute.population.structure()

  • kinship(): wrapper for compute.kinship()

  • singleVariantAssociations(): wrapper for compute.single.variant.associations()

  • similarity: environment with obs() and mod() functions

  • embedding: environment with obs() and mod() functions

Details

A typical compute workflow:

  1. Calculate PRS scores:

    compute$scores(data, maf.threshold = 0.01)
    
  2. Compute population structure:

    compute$populationStructure(data,
                                npcs = 10,
                                reference.panel = "EUR")
    
  3. Calculate kinship matrix:

    compute$kinship(data)
    
  4. Compute similarity and embeddings:

    # Observation similarity
    sim.obs <- compute$similarity$obs(data, scores, method = "correlation")
    # Model similarity
    sim.mod <- compute$similarity$mod(data, mod, method = "snp.jaccard")
    # PCA embedding
    pca.emb <- compute$embedding$obs(data, scores, method = "pca", n.components = 10)
    # UMAP embedding
    umap.emb <- compute$embedding$obs(data, scores, method = "umap")
    
  5. Run single-variant associations:

    compute$singleVariantAssociations(data,
                                      phenotypes = c(case_status, age_onset),
                                      control.for = c(age, sex, PC1_10))
    

Value

The input object x, invisibly.