M.E. Ketelaar 2020-02-17 19:39:03 +00:00
parent 2b14b008cf
commit 082c3868be
1 changed files with 24 additions and 0 deletions

24
CalculationFDR_Script.md Normal file

@ -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)