GWAS object
GWAS.RdA GWAS object is a container for vectors of GWAS data, a correlation matrix, and meta-data regarding quality control procedures applied at the point of object creation / data import.
Usage
GWAS(
dat,
map = "default",
drop = FALSE,
fill = FALSE,
fill_rsid = FALSE,
missing_rsid = "fill_CHR:BP",
parallel_cores = parallel::detectCores(),
dbsnp_dir = genepi.utils::which_dbsnp_directory(),
filters = list(beta_invalid = "!is.infinite(beta) & abs(beta) < 20", eaf_invalid =
"eaf > 0 & eaf < 1", p_invalid = "!is.infinite(p)", se_invalid = "!is.infinite(se)",
alleles_invalid = "!is.na(ea) & !is.na(oa)", chr_missing = "!is.na(chr)", bp_missing
= "!is.na(bp)", beta_missing = "!is.na(beta)", se_missing = "!is.na(se)", p_missing =
"!is.na(p)", eaf_missing = "!is.na(eaf)"),
reference = NULL,
ref_map = NULL,
verbose = TRUE,
...
)Arguments
- dat
a valid string file path to be read by
data.table::freador adata.table::data.tableobject; the GWAS data source- map
a valid input to the
ColumnMapclass constructor (a predefined map string id, a named list or character vector, or a ColumMap object)- drop
a logical, whether to drop data source columns not in the column
map- fill
a logical, whether to add (NAs) missing columns present in the column
mapbut not present in the data source- fill_rsid
either FALSE or a valid argument for the chrpos_to_rsid
buildargument, e.g. "b37_dbsnp156"- missing_rsid
a string, how to handle missing rsids: one of "fill_CHR:BP", "fill_CHR:BP_OA_EA", "overwrite_CHR:BP", "overwrite_CHR:BP:OA:EA", "none", or "leave"
- parallel_cores
an integer, number of cores to used for RSID mapping, default is maximum machine cores
- dbsnp_dir
path to the dbsnp directory of fst files see chrpos_to_rsid
dbsnp_dirargument- filters
a list of named strings, each to be evaluated as an expression to filter the data during the quality control steps (above)
- reference
a valid string file path to be read by
data.table::freador adata.table::data.tableobject; the reference data- ref_map
a valid input to the
ColumnMapclass constructor (a predefined map id (a string), a named list or character vector, or a ColumMap object) defining at least columnsrsid(orchr,bp),ea,oaandeaf.- verbose
a logical, whether to print details
- ...
variable capture to be passed to the constructor, e.g. individual vectors for the slots, rather that
dat
Slots
rsidcharacter, variant ID - usually in rs12345 format, however this can be changed with the
missing_rsidargumentchrcharacter, chromosome identifier
bpinteger, base position
eacharacter, effect allele
oacharacter, other allele
eafnumeric, effect allele frequency
betanumeric, effect size
senumeric, effect size standard error
pnumeric, p-value
ninteger, total number of samples
ncaseinteger, number of cases
strandcharacter, the strand + or -
imputedlogical, whether imputed
infonumeric, the info score
qnumeric, the Q statistic for meta analysis results
q_pnumeric, the Q statistic P-value
i2numeric, the I2 statistic
proxy_rsidcharacter, proxy variant ID
proxy_chrcharacter, proxy chromosome identifier
proxy_bpinteger, proxy base position
proxy_eacharacter, proxy effect allele
proxy_oacharacter, proxy other allele
proxy_eafnumeric, proxy effect allele frequency
proxy_r2numeric, proxy r2 with rsid
traitcharacter, the GWAS trait
idcharacter, the GWAS identifier
sourcecharacter, data source; either the file path, or "data.table" if loaded directly
correlationmatrix, a correlation matrix of signed R values between variants
mapColumnMap, a mapping of class ColumnMapqclist, a named list of filters; name is the filter expression and value is an integer vector of rows that fail the filter