score_squared_cosine: Compute the squared cosine scores

View source: R/functions.R

score_squared_cosineR Documentation

Compute the squared cosine scores

Description

Compute the relative importance of components for each trait (or variant) as defined in Tanigawa et al Nat Comm 2019.

Usage

score_squared_cosine(
  svd_obj,
  right_singular_vectors = FALSE,
  component_prefix = "Component"
)

Arguments

svd_obj

A named list containing three matrices with u, d, and v as their names as in the output from base::svd() function. One can pass the results of base::svd(t(fit$C)) or tsvd_of_C_with_names(fit). Please note that this function assumes svd_obj$u and svd_obj$v corresponds to phenotypes and variants, respectively.

right_singular_vectors

An indicator variable to specify if we compute the score for right singular vector or not. If true, we compute the variant squared cosine score. If false, we compute phenotype squared cosine score.

component_prefix

A string used as a prefix for the column names corresponding to the latent variables


junyangq/multiSnpnet documentation built on Oct. 19, 2023, 8:22 p.m.