Skip to contents

After multiple variables have been analysed using santaR_auto_fit, santaR_auto_summary helps identify significant results and summarise them in an interpretable fashion. Correction for multiple testing can be applied to generate Bonferroni [1], Benjamini-Hochberg [2] or Benjamini-Yekutieli [3] corrected p-values. P-values can be saved to disk in .csv files. For a given significance cut-off (plotCutOff), the number of variables significantly altered is reported and plots are automatically saved to disk by increasing p-value. The aspect of the plots can be altered such as the representation of confidence bands (showConfBand) or the generation of a mean curve across all samples (showTotalMeanCurve) to help assess difference between groups when group sizes are unbalanced.

Usage

santaR_auto_summary(
  SANTAObjList,
  targetFolder = NA,
  summaryCSV = TRUE,
  CSVName = "summary",
  savePlot = TRUE,
  plotCutOff = 0.05,
  showTotalMeanCurve = TRUE,
  showConfBand = TRUE,
  legend = TRUE,
  fdrBH = TRUE,
  fdrBY = FALSE,
  fdrBonf = FALSE,
  CIpval = TRUE,
  plotAll = FALSE
)

Arguments

SANTAObjList

A list of SANTAObj with p-values calculated, as generated by santaR_auto_fit.

targetFolder

(NA or str) NA or the path to a folder in which to save summary.xls and plots. If NA no outputs are saved to disk. If targetFolder does not exist, folders will be created. Default is NA.

summaryCSV

If TRUE save the (corrected if applicable) p-values to 'CSVName'_summary.csv, 'CSVName'_pvalue-all.csv, 'CSVName'_pvalue-dist.csv, 'CSVName'_pvalue-dist.csv (default summary_summary.csv,...). Default is TRUE.

CSVName

(string) Filename of the csv to save. Default is 'summary'.

savePlot

If TRUE save to targetFolder all variables with p < plotCutOff ordered by p-values. Default is TRUE.

plotCutOff

(float) P-value cut-off value to save summary plots to disk. Default 0.05.

showTotalMeanCurve

If TRUE add the mean curve across all groups on the plots. Default is TRUE.

showConfBand

If TRUE plot the confidence band for each group. Default is TRUE.

legend

If TRUE add a legend to the plots. Default is TRUE.

fdrBH

If TRUE add the Benjamini-Hochberg corrected p-value to the output. Default is TRUE.

fdrBY

If TRUE add the Benjamini-Yekutieli corrected p-value to the output. Default is FALSE.

fdrBonf

If TRUE add the Bonferroni corrected p-value to the output. Default is FALSE.

CIpval

If TRUE add the upper and lower confidence interval on p-value to the output. Default is TRUE.

plotAll

If TRUE override the plotCutOff parameter and plot all variables. Default is FALSE.

Value

A list: result$pval.all

data.frame of p-values, with all variables as rows and different p-value corrections as columns. result$pval.summary

data.frame of number of variables with a p-value inferior to a cut-off. Different metric and p-value correction as rows, different cut-off (Inf 0.05, Inf 0.01, Inf 0.001) as columns.

References

[1] Bland, J. M. & Altman, D. G. Multiple significance tests: the Bonferroni method. British Medial Journal 310, 170 (1995).

[2] Benjamini, Y. & Hochberg, Y. Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing. Journal of the Royal Statistical Society 57, 1, 289-300 (1995).

[3] Benjamini, Y. & Yekutieli, D. The control of the false discovery rate in multiple testing under depencency. The Annals of Statistics 29, 1165-1188 (2001).

Examples

## 2 variables, 56 measurements, 8 subjects, 7 unique time-points
## Default parameter values decreased to ensure an execution < 2 seconds
inputData     <- acuteInflammation$data[,1:2]
ind           <- acuteInflammation$meta$ind
time          <- acuteInflammation$meta$time
group         <- acuteInflammation$meta$group
SANTAObjList  <- santaR_auto_fit(inputData, ind, time, group, df=5, ncores=0, CBand=TRUE,
                                pval.dist=TRUE, nBoot=100, nPerm=100)
#> Input data generated: 0.01 secs
#> Spline fitted: 0.05 secs
#> ConfBands done: 0.58 secs
#> p-val dist done: 0.59 secs
#> total time: 1.22 secs
# Input data generated: 0.02 secs
# Spline fitted: 0.03 secs
# ConfBands done: 0.53 secs
# p-val dist done: 0.79 secs
# total time: 1.37 secs
result <- santaR_auto_summary(SANTAObjList)
#> p-value dist found
#> Benjamini-Hochberg corrected p-value
print(result)
#> $pval.all
#>             dist dist_upper  dist_lower     curveCorr    dist_BH
#> var_1 0.00990099 0.05432519 0.001737742 -0.2429725352 0.01980198
#> var_2 0.01980198 0.06971592 0.005416447  0.0006572238 0.01980198
#> 
#> $pval.summary
#>      Test Inf 0.05 Inf 0.01 Inf 0.001
#> 1    dist        2        1         0
#> 2 dist_BH        2        0         0
#> 
# $pval.all
#              dist dist_upper  dist_lower     curveCorr    dist_BH
# var_1 0.03960396 0.09783202 0.015439223 -0.2429725352 0.03960396
# var_2 0.00990099 0.05432519 0.001737742  0.0006572238 0.01980198
#
# $pval.summary
#       Test Inf 0.05 Inf 0.01 Inf 0.001
# 1    dist        2        1         0
# 2 dist_BH        2        0         0