addGeneInfo: Adds Gene Information to the gene.index

View source: R/addInfo.R

addGeneInfoR Documentation

Adds Gene Information to the gene.index

Description

The function adds information to the gene.index.#'

Usage

addGeneInfo(
  cnr,
  df,
  gene.ids = "hgnc.symbol",
  sort = FALSE,
  all.index = TRUE,
  ...
)

Arguments

cnr

a cnr bundle

df

a data.frame with the data to incorporate. Particularly useful for gene annotations, filters e.g. OncoKB, or results from analyses e.g. p-values, genetic effects, etc to the genes

gene.ids

column for gene.ids, must be included in both

sort

wether to sort the ouput object, default is FALSE

all.index

logical, use all of gene.index. When FALSE, return only the intersect of gene.idex and df. default TRUE

...

additional parameters passed to merge

Value

Returns a CNR object with added columns from df to the gene.index. e.g. p-values for genome wide scans.

By default merge occurs using the intersect of column names of the gene.index and df. To change this, use by.x and by.y. See merge. Rownames are added after the merge from the column specified as gene.ids

Examples

data(cnr)

fakeGenePval <- data.frame(hgnc.symbol = cnr$gene.index$hgnc.symbol,
                       pval = runif(nrow(cnr$gene.index)))

cnr <- addGeneInfo(cnr, df = fakeGenePval)

head(cnr$gene.index)


SingerLab/gac documentation built on March 23, 2024, 5:15 a.m.