corrected.p: Correction of p-values for associations between features and...

Description Usage Arguments Details Value Author(s) Examples

View source: R/corrected.p.R

Description

The function corrects for multiple testing of associations of features to sample annotation. Adjustment is done by padjust() or by the p-values from permuted data.

Usage

1
2
corrected.p(feature.assoc, correction = "fdr", adjust.permute = T, 
            adjust.rank = T, ties.method = "first")

Arguments

feature.assoc

a list with the p-values of feature associations, typically created by the function feature.assoc(). (If not created by feature.assoc() the list has to contain the elements observed.p and permuted.p.)

correction

adjustment method to use for padjust(). default="fdr". must be one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr" or "none".

adjust.permute

if set to TRUE (default), the p-values will be adjusted by observed.p divided by permuted.p for each rank in observed.p and permuted.p.

adjust.rank

if set to TRUE (default), the p-values will be adjusted by calculating for every observed p-value the proportion of smaller permuted.p values to smaller observed.p values.

ties.method

if adjust.permute=TRUE or adjust.rank=TRUE the method for handling ties can be either "first" or "random". Tied p-values are likely when using "AUC" as method to measure feature associations. default="first".

Details

As high-dimensional data contains many features, the p-values of feature associations have to be corrected for multiple testing. The number of features that are significantly associated with sample annotation can show how strog the data is connected to the respective sample annotation. The p-values can be adjusted using the standard correction methods of padjust(). Additionally two methods that use the p-values from permuted data are proposed. First, p-values are adjusted by observed.p divided by permuted.p for each rank in observed.p and permuted.p. For instance if the third lowest p-value in the observed associations is 1e-9 and the third lowest p value in the permuted data is 1e-4, this p-value is correced by 1e-9 divided by 1e-4 which is 1e-5. Second, p-values are adjusted by calculating for every observed p-value the proportion of smaller permuted. p values to smaller observed.p values. For instance, we have a p-value of 1e-3 which is ranked as the 300-lowest p-value in the observed data. In the permuted data there are 3 p-values that are lower than 1e-3. In the 300 p-values we suspect 3 of them to occur by chance, hence the adjusted p-value is 3 divided by 300 which is 0.01. This correction method can yield p-values of 0 and is less robust when only a few permuted.p are smaller than the observed.p. Both proposed correction methods may acutally show similar results to padjust(observed.p,method="fdr")

Value

a list with components

padjust

a numeric vector containing the corrected p-values using padjust().

adjust.permute

a numeric vector containing the corrected p-values using observed.p divided by permuted.p at each rank

adjust.rank

a numeric vector containing the corrected p-values by calculating for every observed p-value the proportion of smaller permuted.p values to smaller observed.p values

Author(s)

Martin Lauss

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# data as a matrix
set.seed(100)
g<-matrix(nrow=1000,ncol=50,rnorm(1000*50),dimnames=list(paste("Feature",1:1000),
          paste("Sample",1:50)))
g[1:100,26:50]<-g[1:100,26:50]+1 # the first 100 features show
# higher values in the samples 26:50
# patient annotations as a data.frame, annotations should be numbers and factor
# but not characters.
# rownames have to be the same as colnames of the data matrix 
set.seed(200)
o<-data.frame(Factor1=factor(c(rep("A",25),rep("B",25))),
              Factor2=factor(rep(c("A","B"),25)),
              Numeric1=rnorm(50),row.names=colnames(g))
              

#calculate feature associations
res4a<-feature.assoc(g,o$Factor1,method="correlation")
#correct the p-values
res5<-corrected.p(res4a)
  names(which(res5$padjust<0.05))
  names(which(res5$adjust.permute<0.05))
  names(which(res5$adjust.rank<0.05))

Example output

Loading required package: impute
Loading required package: amap
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

Loading required package: MASS
 [1] "Feature 1"   "Feature 3"   "Feature 5"   "Feature 6"   "Feature 7"  
 [6] "Feature 8"   "Feature 9"   "Feature 10"  "Feature 11"  "Feature 12" 
[11] "Feature 13"  "Feature 14"  "Feature 15"  "Feature 17"  "Feature 19" 
[16] "Feature 20"  "Feature 21"  "Feature 22"  "Feature 24"  "Feature 25" 
[21] "Feature 26"  "Feature 27"  "Feature 29"  "Feature 31"  "Feature 34" 
[26] "Feature 35"  "Feature 36"  "Feature 37"  "Feature 39"  "Feature 40" 
[31] "Feature 41"  "Feature 43"  "Feature 45"  "Feature 46"  "Feature 48" 
[36] "Feature 53"  "Feature 55"  "Feature 56"  "Feature 58"  "Feature 59" 
[41] "Feature 61"  "Feature 62"  "Feature 63"  "Feature 64"  "Feature 66" 
[46] "Feature 67"  "Feature 68"  "Feature 69"  "Feature 70"  "Feature 71" 
[51] "Feature 72"  "Feature 75"  "Feature 77"  "Feature 78"  "Feature 82" 
[56] "Feature 83"  "Feature 84"  "Feature 85"  "Feature 86"  "Feature 88" 
[61] "Feature 90"  "Feature 91"  "Feature 94"  "Feature 95"  "Feature 97" 
[66] "Feature 98"  "Feature 99"  "Feature 100" "Feature 105" "Feature 457"
[71] "Feature 709" "Feature 787"
 [1] "Feature 3"   "Feature 5"   "Feature 6"   "Feature 7"   "Feature 8"  
 [6] "Feature 9"   "Feature 10"  "Feature 12"  "Feature 13"  "Feature 14" 
[11] "Feature 15"  "Feature 17"  "Feature 19"  "Feature 20"  "Feature 21" 
[16] "Feature 22"  "Feature 25"  "Feature 26"  "Feature 27"  "Feature 29" 
[21] "Feature 31"  "Feature 34"  "Feature 35"  "Feature 36"  "Feature 39" 
[26] "Feature 40"  "Feature 41"  "Feature 43"  "Feature 45"  "Feature 46" 
[31] "Feature 53"  "Feature 55"  "Feature 56"  "Feature 59"  "Feature 61" 
[36] "Feature 62"  "Feature 63"  "Feature 64"  "Feature 66"  "Feature 67" 
[41] "Feature 68"  "Feature 69"  "Feature 70"  "Feature 71"  "Feature 72" 
[46] "Feature 75"  "Feature 77"  "Feature 78"  "Feature 82"  "Feature 83" 
[51] "Feature 84"  "Feature 85"  "Feature 86"  "Feature 88"  "Feature 90" 
[56] "Feature 91"  "Feature 95"  "Feature 97"  "Feature 98"  "Feature 99" 
[61] "Feature 100" "Feature 105" "Feature 457" "Feature 787"
 [1] "Feature 1"   "Feature 3"   "Feature 5"   "Feature 6"   "Feature 7"  
 [6] "Feature 8"   "Feature 9"   "Feature 10"  "Feature 11"  "Feature 12" 
[11] "Feature 13"  "Feature 14"  "Feature 15"  "Feature 17"  "Feature 19" 
[16] "Feature 20"  "Feature 21"  "Feature 22"  "Feature 25"  "Feature 26" 
[21] "Feature 27"  "Feature 29"  "Feature 31"  "Feature 34"  "Feature 35" 
[26] "Feature 36"  "Feature 39"  "Feature 40"  "Feature 41"  "Feature 43" 
[31] "Feature 45"  "Feature 46"  "Feature 48"  "Feature 53"  "Feature 55" 
[36] "Feature 56"  "Feature 58"  "Feature 59"  "Feature 61"  "Feature 62" 
[41] "Feature 63"  "Feature 64"  "Feature 66"  "Feature 67"  "Feature 68" 
[46] "Feature 69"  "Feature 70"  "Feature 71"  "Feature 72"  "Feature 75" 
[51] "Feature 77"  "Feature 78"  "Feature 82"  "Feature 83"  "Feature 84" 
[56] "Feature 85"  "Feature 86"  "Feature 88"  "Feature 90"  "Feature 91" 
[61] "Feature 95"  "Feature 97"  "Feature 98"  "Feature 99"  "Feature 100"
[66] "Feature 105" "Feature 457" "Feature 787"

swamp documentation built on May 2, 2019, 2:14 p.m.