This function will take a list of results of permutation tests that included many region sets and return a list of data.frames where each data.frame contains the null distribution for a single region set. The function can also convert in the reverse order from a list of null distributions to a list of COCOA results.

convertToFromNullDist(rsScoresList)

Arguments

rsScoresList

each item in the list is a data.frame, one item for each permutation with the results of that permutation. Each row in the data.frame is a region set. All data.frames should be the same size and each data.frame's rows should be in the same order

Value

a list of data.frames. If given a list where each item is a data.frame with results from one COCOA permutation, this function will return a list of data.frames where each data.frame contains the null distributions for a single region set. The output data.frames will have the same columns as the input data.frames. If given a list where each item is a data.frame with the null distribution/s for a single region set, this function will return a list where each item is a data.frame with one row for each region set (e.g. a data.frame with results for a single COCOA permutation).

Examples

# six region sets (rows), 2 signals (columns) fakePermScores <- data.frame(abs(rnorm(6)), abs(rnorm(6))) fakePermScores2 <- data.frame(abs(rnorm(6)), abs(rnorm(6))) # 2 fake COCOA results (i.e. nPerm=2) permRSScores <- list(fakePermScores, fakePermScores2) convertToFromNullDist(permRSScores)
#> [[1]] #> abs.rnorm.6.. abs.rnorm.6...1 #> 1 1.400044 1.8218177 #> 2 2.065025 0.5429963 #> #> [[2]] #> abs.rnorm.6.. abs.rnorm.6...1 #> 1 0.2553171 0.2473253 #> 2 1.6309894 0.9140748 #> #> [[3]] #> abs.rnorm.6.. abs.rnorm.6...1 #> 1 2.4372636 0.2441996 #> 2 0.5124269 0.4681544 #> #> [[4]] #> abs.rnorm.6.. abs.rnorm.6...1 #> 1 0.005571287 0.2827054 #> 2 1.863011492 0.3629513 #> #> [[5]] #> abs.rnorm.6.. abs.rnorm.6...1 #> 1 0.6215527 0.5536994 #> 2 0.5220125 1.3045435 #> #> [[6]] #> abs.rnorm.6.. abs.rnorm.6...1 #> 1 1.14841161 0.6289820 #> 2 0.05260191 0.7377763 #>