addInfo: Adds new columns to the chromInfo and gene.index

View source: R/addInfo.R

addInfoR Documentation

Adds new columns to the chromInfo and gene.index

Description

The function adds information at the bin and gene level by running addBinInfo, and addGeneInfo

Usage

addInfo(cnr, df, gdf = NULL, ...)

Arguments

cnr

a cnr bundle

df

a data.frame with the data to incorporate into chromInfo. Particularly useful for adding p-values, genetic effects, etc to the bins

gdf

a data.frame with the data to incorporate into gene.index. Particularly useful for adding p-values, genetic effects, etc to the genes

...

other parameters passed to addGeneInfo, subsequently to merge

Value

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

Examples


data(cnr)

fakeBinPval <- data.frame(pval = runif(5000))

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

head(cnr$chromInfo)
head(cnr$gene.index)

## add info only to bins

fakeBinPval2 <- data.frame(pval = runif(5000))
cnr <- addInfo(cnr, df = fakeBinPval2)

head(cnr$chromInfo)
head(cnr$gene.index)


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