ridgesum.pipeline: Run ridgesum with standard pipeline

View source: R/ridgesum.pipeline.R

ridgesum.pipelineR Documentation

Run ridgesum with standard pipeline

Description

The easy way to run ridgesum

Usage

ridgesum.pipeline(
  cor,
  chr = NULL,
  pos = NULL,
  snp = NULL,
  A1 = NULL,
  A2 = NULL,
  ref.bfile = NULL,
  test.bfile = NULL,
  LDblocks = NULL,
  lambda = exp(seq(log(0.001), log(0.1), length.out = 20)),
  s = c(0.2, 0.5, 0.9, 1),
  destandardize = F,
  trace = 1,
  exclude.ambiguous = TRUE,
  keep.ref = NULL,
  remove.ref = NULL,
  keep.test = NULL,
  remove.test = NULL,
  sample = NULL,
  cluster = NULL,
  max.ref.bfile.n = 20000,
  nomatch = FALSE,
  ...
)

Arguments

cor

A vector of SNP-wise correlations with phenotype derived from summary statistics

chr

Together with pos, chromosome and position for cor

pos

Together with chr, chromosome and position for cor

A1

Alternative allele (effect allele) for cor

A2

Reference allele for cor (One of A1 or A2 must be specified)

ref.bfile

bfile (PLINK binary format, without .bed) for reference panel

test.bfile

bfile for test dataset

LDblocks

Either (1) one of "EUR.hg19", "AFR.hg19", "ASN.hg19", "EUR.hg38", "AFR.hg38", "ASN.hg38", to use blocks defined by Berisa and Pickrell (2015) based on the 1000 Genome data, or (2) a vector to define LD blocks, or (3) a data.frame of regions in bed format

lambda

to pass on to ridgesum

s

A vector of s

destandardize

Should coefficients from ridgesum be destandardized using test dataset standard deviations before being returned?

trace

Controls the amount of output.

exclude.ambiguous

Should ambiguous SNPs (C/G, A/T) be excluded?

keep.ref

Participants to keep from the reference panel (see parseselect)

remove.ref

Participants to remove from the reference panel(see parseselect)

keep.test

Participants to keep from the testing dataset (see parseselect)

remove.test

Participants to remove from the testing dataset (see parseselect)

sample

Sample size of the random sample taken of ref.bfile

cluster

A cluster object from the parallel package for parallel computing

max.ref.bfile.n

The maximum sample size allowed in the reference panel

...

parameters to pass to ridgesum

Value

A ridgesum.pipeline object with the following elements

beta

A list of ridgesum coefficients: one list element for each s

test.extract

A logical vector for the SNPs in test.bfile that are used in estimation.

also.in.refpanel

A logical vector for the SNPs in test.bfile that are used in lassosum.

sumstats

A data.frame of summary statistics used in estimation.

sd

The standard deviation for the testing dataset

test.bfile

The testing dataset

keep.test

Sample to keep in the testing dataset

ref.bfile

The reference panel dataset

keep.ref

Sample to keep in the reference panel dataset

lambda, s, keep.test, destandardized

Information to pass on to validate.lassosum.pipeline or pseudovalidate.lassosum.pipeline

pgs

A matrix of polygenic scores

destandardized

Are the coefficients destandardized?

exclude.ambiguous

Were ambiguous SNPs excluded?

Note

Berisa, T. & Pickrell, J. K. Approximately independent linkage disequilibrium blocks in human populations. Bioinformatics 32, 283-285 (2015).

Examples

## Not run: 
 ### Read summary statistics file ###
 ss <- fread("./data/summarystats.txt")
 head(ss)
 
 ### Convert p-values to correlations, assuming a sample size of 60000 for the p-values ###
 cor <- p2cor(p = ss$P_val, n = 60000, sign=log(ss$OR_A1))
 
 ### Run ridgesum using standard pipeline ### 
 out <- ridgesum.pipeline(cor=cor, chr=ss$Chr, pos=ss$Position, 
                          A1=ss$A1, A2=ss$A2,
                          ref.bfile=ref.bfile, test.bfile=test.bfile, 
                          LDblocks = "EUR.hg19")

## End(Not run)

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