rsRankingIndex: Get indices for top scored region sets

Description Usage Arguments Value Examples

View source: R/COCOA.R

Description

For each PC, get index of original region sets but ordered by rsScores ranking for each PC. The original index refers to that region set's position in the ‘GRList' param given to 'runCOCOA' which is also that region set’s row index in the COCOA output. The first number in a given column of this function's output will be the original index of the region set ranked first for that PC. Second row for a column will be the original index of the region set that ranked second for that PC, etc. You can use this function to make it easier when you want to select the top region sets for further analysis or just for sorting the results. Region set scores are sorted in decreasing order so if you have p values they should be log transformed: -log(pval, 10)

Usage

1
rsRankingIndex(rsScores, PCsToAnnotate)

Arguments

rsScores

a data.frame with scores for each region set from the main COCOA function. Each row is a region set. Columns are PCs and info on region set overlap with DNA methylation data. Should be in the same order as GRList (the list of region sets used to create it.)

PCsToAnnotate

a character vector. PCs in rsScores for which you want the indices of the original region sets (must be column names of rsScores) eg c("PC1", "PC2")

Value

A data.frame with columns PCsToAnnotate. Each column has been sorted by score for region sets for that PC (decreasing order). Original indices for region sets that were used to create rsScores are given.

Examples

1
2
3
4
5
6
7
data("rsScores")
rsRankInd = rsRankingIndex(rsScores=rsScores, 
                           PCsToAnnotate=c("PC1", "PC2"))
# region sets sorted by score for PC1
rsScores[rsRankInd$PC1, ]
# region sets sorted by score for PC2
rsScores[rsRankInd$PC2, ]

databio/PCRSA documentation built on Dec. 7, 2018, 8:57 a.m.