pgs: Computes polygenic scores as a genotype matrix multiplied by...

View source: R/pgs.R

pgsR Documentation

Computes polygenic scores as a genotype matrix multiplied by a matrix of weights

Description

Note that this is a low-level command. For applying estimated betas to new bfiles, refer to https://github.com/tshmak/lassosum#apply-validated-betas-to-new-data

Usage

pgs(bfile, weights, ...)

.pgs(...)

## Default S3 method:
.pgs(
  weights,
  bfile,
  keep = NULL,
  extract = NULL,
  exclude = NULL,
  remove = NULL,
  chr = NULL,
  cluster = NULL,
  trace = 0,
  sparse = TRUE
)

Arguments

bfile

A plink bfile stem

weights

The weights for the SNPs (\beta)

keep

samples to keep (see parseselect)

extract

SNPs to extract (see parseselect)

exclude

SNPs to exclude (see parseselect)

remove

samples to remove (see parseselect)

chr

a vector of chromosomes

cluster

A cluster object from the parallel package. For parallel processing.

trace

Level of output

sparse

Assumes sparse weights matrix

Details

A function to calculate X\beta where X is the genotype matrix in the plink bfile.

Value

A matrix of Polygenic Scores

Note

  • Missing genotypes are interpreted as having the homozygous A2 alleles in the PLINK files (same as the --fill-missing-a2 option in PLINK).

  • The number of rows in weights should be the same as the number of SNPs in the bfile after extract/exclude/chr.


SeojinHwang/scadsum documentation built on June 30, 2023, 10:52 p.m.