get_unknown_rsids_from_locus: Method to obtain rsids for records in a gwas where they are...

Description Usage Arguments Value Examples

View source: R/rsid_search.R

Description

The method looks at all the rows for which rsid is NA and gets their rsid by calling merge_rsids_into_gwas and merging the resulting rsids into the gwas

Usage

1
2
3
4
5
get_unknown_rsids_from_locus(
  gwas,
  assembly = valid_references,
  validate = TRUE
)

Arguments

gwas

a dataframe containing the gwas with CHR POS NEA and EA

assembly

one of "hg18", "hg19" (default), "hg38".

validate

a boolean indicating whether to validate the resulting gwas (TRUE by default) use FALSE for debugging.

Value

subset of input gwas with available rsids replacing rsids where they were originally missing. Does not include all the columns in the original gwas, only CHR, POS, NEA, EA, rsid

Examples

1
2
3
4
5
6
any(is.na(demo_data$rsid)) # TRUE
partial_gwas = get_unknown_rsids_from_locus(demo_data)
any(is.na(partial_gwas$rsid)) # FALSE
nrow(partial_gwas) == nrow(demo_data) # false

plyr::empty(get_unknown_rsids_from_locus(subset(demo_data,!is.na(rsid)))) #TRUE

richardslab/MRutils documentation built on Dec. 22, 2021, 4 p.m.