From 082c3868be74ddaa805b6a6fc50b23ecfec072d1 Mon Sep 17 00:00:00 2001 From: "M.E. Ketelaar" Date: Mon, 17 Feb 2020 19:39:03 +0000 Subject: [PATCH] --- CalculationFDR_Script.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 CalculationFDR_Script.md diff --git a/CalculationFDR_Script.md b/CalculationFDR_Script.md new file mode 100644 index 0000000..eac3b30 --- /dev/null +++ b/CalculationFDR_Script.md @@ -0,0 +1,24 @@ +#This script belongs to the paper of Ketelaar, Portelli, Dijk et al. +#Entitled 'Phenotypic and functional translation of IL33 genetics in asthma', submitted to JACI + +#Below example scripts for calculation of FDR of the results of the association analyses using R statistics +#Core Team R. R: A language and environment for statistical computing. 2013; Available at: http://www.R-project.org/. + + +# make a list of the files containing association results +fdrfiles = list.files(pattern = "*.txt") +p="P" +names=fdrfiles + +for(file in fdrfiles){ + # read-in file + contents = read.csv(file, sep = "\t", stringsAsFactors = FALSE, header = TRUE) + + + # calculate fdr + contents[,11] = p.adjust(p, "fdr", n=length(p)) + + } + +# Write contents/results to a file: +write.table(contents, file = names)