mapGenes: Function to map gene ids to entrez IDs, gene symbols and...

Description Usage Arguments Value Examples

View source: R/mapGenes.R

Description

This function removes genes that have missing geneIDs, geneEsts or pvals, returns the gene symbols, entrez IDs and ensemble IDs for the geneIDs supplied, and removes genes with the same ID by keeping the genes with lower P values (default) or higher abs(estimates)

Usage

1
2
mapGenes(geneIds, geneEsts, pvals = NULL, byP = TRUE,
  forRankAndPlot = FALSE)

Arguments

geneIds

a character vector containing the gene symbols, ensemble IDs, or entrez IDs for the genes to be analyzed

geneEsts

a numeric vector containing estimates for the difference in expression between the two phenotyes. Note that positive values of this estimate (tstat, logFC, etc) must correspond to higher gene expression in the phenotype one would like to reverse

pvals

P values from a t-test assessing the diferential expression of the genes between the two phenotypes

byP

a boolean value specifying whether genes will be kept according to smallest P values (default) or highest abs(estimate)

forRankAndPlot

a boolean value specifying whether the data should be cleaned in a manner that will guarantee it works in the rankDrugsGwc function and volcano plot functions (removes genes that can't be mapped to ensemble IDs)

Value

a data.frame containing unique gene IDs and their corresponding estimates and p values

Examples

1
2
3
4
5
data("geneDataGwc")
##keep genes with the smaller p value of genes with the same id
geneDataClean = mapGenes(geneIds = geneDataGwc$symbol, geneEsts = geneDataGwc$logFC, pvals = geneDataGwc$P.Value)
##keep genes with larger abs(logFC) of genes with the same id. Could also supply entrez ids
geneDataClean = mapGenes(geneIds = geneDataGwc$symbol, geneEsts = geneDataGwc$logFC, pvals = geneDataGwc$P.Value, byP = FALSE)

bhklab/CMapBox documentation built on Nov. 6, 2019, 8:07 p.m.