cis_trans: Annotate cis/trans SNPs

View source: R/data_loading.r

cis_transR Documentation

Annotate cis/trans SNPs

Description

Attempts to annotate SNPs as cis or trans depending on their location to the gene coding region. This is achieved using the 'biomaRt' R package.

Usage

cis_trans(
  dat,
  cis_region = 5e+05,
  chr_col = "chr.exposure",
  pos_col = "position.exposure",
  snp_col = NULL,
  values_col = "exposure",
  filter = "ensembl_gene_id",
  missing = "include",
  build = "grch37"
)

Arguments

dat

Data.frame of data

cis_region

Cis region definition (Optional, in kb)

chr_col

Column name for chromosome (Optional)

pos_col

Column name for position (Optional)

snp_col

Column name for SNP rsIDs (Optional)

values_col

Column name for gene names or ENSG IDs (Optional) NB: Choice must match the 'filter' value

filter

How to search for genes in biomaRt, either:

  1. "ensembl_gene_id" for ENSG IDs, or

  2. "hgnc_symbol" for gene names

(Optional)

missing

"Include" or "drop" SNPs which could not be matched (Optional)

build

Genomic build (Optional)

Value

Data.frame with appended column for cis/trans status


jwr-git/mrpipeline documentation built on Oct. 2, 2022, 3:41 p.m.