Learn R Programming

coloc (version 5.1.0)

check_dataset: check_dataset

Description

Check coloc dataset inputs for errors

Usage

check_dataset(d, suffix = "", req = c("snp"), warn.minp = 1e-06)

check.dataset(...)

Arguments

d

dataset to check

suffix

string to identify which dataset (1 or 2)

req

names of elements that must be present

warn.minp

print warning if no p value < warn.minp

...

arguments passed to check_dataset()

Value

NULL if no errors found

Details

Coloc is flexible, requiring perhaps only p values, or z scores, or effect estimates and standard errors, but with this flexibility, also comes difficulties describing exactly the combinations of items required.

pvalues

P-values for each SNP in dataset 1

N

Number of samples in dataset 1

MAF

minor allele frequency of the variants

beta

regression coefficient for each SNP from dataset 1

varbeta

variance of beta

type

the type of data in dataset 1 - either "quant" or "cc" to denote quantitative or case-control

s

for a case control dataset, the proportion of samples in dataset 1 that are cases

sdY

for a quantitative trait, the population standard deviation of the trait. if not given, it can be estimated from the vectors of varbeta and MAF

snp

a character vector of snp ids, optional. If present, it will be used to merge dataset1 and dataset2. Otherwise, the function assumes dataset1 and dataset2 contain results for the same SNPs in the same order.

Some of these items may be missing, but you must always give type.

Then scalars describing the samples used:

N

if type=="cc"

s

if type=="quant" and sdY known

sdY

If sdY is unknown, it will be approximated, and this will require

beta, varbeta, N, MAF

Then, if not already covered above, the summary statistics describing the results

preferably

beta, varbeta

alternatively

pvalues, MAF

check_dataset call stop() unless a series of expectations on dataset input format are met

This is a helper function for use by other coloc functions, but you can use it directly to check the format of a dataset to be supplied to coloc.abf(), coloc.signals(), finemap.abf(), or finemap.signals().