prs_pipeline: User-friendly pipeline to retrieve variants and convert them...

View source: R/prs_pipeline.R

prs_pipelineR Documentation

User-friendly pipeline to retrieve variants and convert them into a polygenic risk score

Description

A pipeline creating a polygenic risk score from start to finish.

Usage

prs_pipeline(
  trait = NULL,
  trait_list = NULL,
  pQTL = NULL,
  is_cis = TRUE,
  chr_files = NULL,
  autosomes = TRUE,
  range = 0,
  grch37 = TRUE,
  keep_all = FALSE,
  binary_outcome = TRUE,
  ...
)

Arguments

trait

Expects a regular expression to find the trait of interest

trait_list

An object generated by init_gwas_db(). If NULL, init_gwas_db() will be run internally.

pQTL

An object generated by get_pQTLs(). Only one of trait or pQTL should be provided.

is_cis

If TRUE, only includes cis pQTLs in the output.

chr_files

Filenames (in order) for the chromosome-wise .vcf files

autosomes

If TRUE, only extracts variants from the autosomes.

range

Variants are extracted from the start position until start position + range (in bp).

grch37

If TRUE, the build is grch37; if FALSE, grch38 is used.

keep_all

If TRUE, keeps all variants in the search range, even those not in gwas_info.

binary_outcome

Set to TRUE for binary traits, and FALSE for continuous outcomes (including pQTLs).

...

Any other argument to pass to create_prs().

Value

A list containing several data.frames with all relevant information. The risk score is stored in element 'prs'.

Examples

# vte_prs <- prs_pipeline(trait='venous thromboembolism|deep vein thrombosis|pulmonary embolism',
# trait_list=trait_list,
# chr_files=vcf_files_myo2,
# autosomes=FALSE)

vincent10kd/polygenic documentation built on Feb. 25, 2024, 10:17 a.m.