Getting leading-edge indices from a vector

getLeadingEdgeIndexFromVector(
  x,
  index,
  comparison = c("greater", "less"),
  reference = c("background", "geneset")
)

getLeadingEdgeIndexFromMatrix(
  x,
  index,
  comparison = c("greater", "less"),
  reference = c("background", "geneset")
)

Arguments

x

A numeric vector (getLeadingEdgeIndexFromVector) or a numeric matrix (getLeadingEdgeIndexFromMatrix).

index

An integer vector, indicating the indices of genes in a gene-set.

comparison

Character string, are values greater than or less than the reference value considered as leading-edge? This depends on the type of value requested by the user in wmwTest.

reference

Character string, which reference is used? If background, genes with expression higher than the median of the background are reported. Otherwise in the case of geneset, genes with expression higher than the median of the gene-set is reported. Default is background, which is consistent with the results of the Wilcoxon-Mann-Whitney tests.

Value

An integer vector, indicating the indices of leading-edge genes.

Functions

  • getLeadingEdgeIndexFromMatrix: x is a matrix.

See also

Examples

myProfile <- c(rnorm(5, 3), rnorm(15, -3), rnorm(100, 0))
getLeadingEdgeIndexFromVector(myProfile, 1:20)
#> [1] 1 2 3 4 5
getLeadingEdgeIndexFromVector(myProfile, 1:20, comparison="less")
#>  [1]  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
getLeadingEdgeIndexFromVector(myProfile, 1:20, comparison="less", reference="geneset")
#>  [1]  7  8  9 10 12 13 14 17 19 20
myProfile2 <- c(rnorm(15, 3), rnorm(5, -3), rnorm(100, 0))
myProfileMat <- cbind(myProfile, myProfile2)
getLeadingEdgeIndexFromMatrix(myProfileMat, 1:20)
#> $myProfile
#> [1] 1 2 3 4 5
#> 
#> $myProfile2
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
#> 
getLeadingEdgeIndexFromMatrix(myProfileMat, 1:20, comparison="less")
#> $myProfile
#>  [1]  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
#> 
#> $myProfile2
#> [1] 16 17 18 19 20
#> 
getLeadingEdgeIndexFromMatrix(myProfileMat, 1:20, comparison="less", reference="geneset")
#> $myProfile
#>  [1]  7  8  9 10 12 13 14 17 19 20
#> 
#> $myProfile2
#>  [1]  3  5  8  9 11 16 17 18 19 20
#>