check_datasets: Perform some POEM specific checks on datasets

Description Usage Arguments Examples

View source: R/check_datasets.R

Description

Perform some POEM specific checks on datasets

Usage

1
check_datasets(dataset_list)

Arguments

dataset_list

list of datasets formatted according to the requirements of coloc.abf with the following differences pos, and chr are additionally required. snp is ignored as it is determined by pos. For top SNP datasets, R2 and MAF and gds_file and subset are optional, if supplied as arguments to the function. For full summary statistic datasets, MAF is required.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dataset_full <- list(pos = c(1, 2, 3, 4, 5), MAF = c(0.14, 0.15, 0.25, 0.2, 0.4), N=1000, type ="quant", pvalues = c(2 * 10^-8, 4 * 10^-8, 2 * 10^-4, 0.6, 0.03), chr= "Z")
dataset_top_SNP <- list(pos = 2, N= 10000, s =0.5, type="cc", pvalues = 10^-9, chr = "Z")
dataset_top_SNP_no_chr <- list(pos = 2, N= 10000, s =0.5, type="cc", pvalues = 10^-9)
dataset_top_SNP_different_chr <- list(pos = 2, N= 10000, s =0.5, type="cc", pvalues = 10^-9, chr = "Y")
dataset_full_zero_p <- list(pos = c(1, 2, 3, 4, 5), MAF = c(0.14, 0.15, 0.25, 0.2, 0.4), N=1000, type ="quant", pvalues = rep(0,5), chr= "Z")
# Should pass
check_datasets(list(dataset_full, dataset_top_SNP))
# Should fail
try(check_datasets(list(dataset_full, dataset_top_SNP, dataset_top_SNP_no_chr)))
try(check_datasets(list(dataset_full, dataset_top_SNP, dataset_top_SNP_different_chr)))
try(check_datasets(list(dataset_full, dataset_top_SNP, dataset_full_zero_p)))

AbbVie-ComputationalGenomics/POEMColoc documentation built on May 20, 2020, 12:32 a.m.