rsRankingIndex {COCOA} | R Documentation

## Get indices for top scored region sets

### 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

    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. Region sets with a score of NA are counted as having the lowest scores and indices for these region sets will be at the bottom of the returned data.frame (na.last=TRUE in sorting)

### Examples

    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, ]

[Package COCOA version 1.2.0 Index]