A streamlined function to project a trait onto a sparse basis project_sparse

project_sparse(beta, seb, pids)

Arguments

beta

a vector of beta estimates

seb

a vector of standard error of the beta estimates

pids

a vector of primary identifiers for SNPs with the same order as beta and seb

Value

a data.table with the following columns#'

  • PC - principal component label

  • var.proj - Variance of the projection score.

  • delta - The difference between projection score and pseudo control score.

  • p.overall - The p value over all components for the projection score.

  • z - z score for projection score

  • p - p value for projection score.

Notes

This function assumes that the following objects are defined in the current environment

  • rot.pca - Matrix of rotations, usually obtained from PCA via prcomp.

  • beta.centers - Vector of basis SNP beta centres, labelled by pid.

  • shrinkage - Vector of basis SNP shrinkage values, labelled by pid.

  • LD - Matrix of covariance between basis SNPs

This function assumes that the order snps in arguments is the same. Whilst missing SNPs are allowed this will degrade the projection a warining is issued when more than 5