global.test | R Documentation |
This function runs a global test of the null hypothesis that there are no SNP-disease associations across a range of chromosome sizes
global.test(results.list, n.top.scores = 10)
results.list |
A list of length d, where d is the number of chromosome
sizes to be included in a global test. Each element of the list must itself
be a list whose first element |
n.top.scores |
The number of top scoring chromosomes, for each chromosome size, to be used in calculating the global test. Defaults to 10. |
A list containing the following:
The observed test statistic.
A vector of test statistics from permuted data.
The p-value for the global test.
A vector of observed test statistics for each chromosome size.
A matrix of test statistics for the permutation datasets, where rows correspond to permutations and columns correspond to chromosome sizes.
A vector containing marignal p-values for each chromosome size.
A vector of the maximum fitness score for each chromosome size in the observed data.
A list of vectors for each chromosome size of maximum observed fitness scores for each permutation.
A vector of p-values for the maximum observed order statistics for each chromosome size. P-values are the proportion of permutation based maximum order statistics that exceed the observed maximum fitness score.
A grob of a ggplot plot of the observed vs permuted fitness score densities for each chromosome size.
A vector indicating the number of top scores (k)
from each chromosome size that the test used.
This will be equal to n.top.scores
unless GADGETS returns fewer than
n.top.scores
unique chromosomes for
the observed data or any permute, in which case the chromosome size-specific
value will be equal to the smallest number of unique chromosomes returned.
The 95th percentile of the permutation maximum order statistics for each chromosome size.
data(case) data(dad) data(mom) case <- as.matrix(case) dad <- as.matrix(dad) mom <- as.matrix(mom) data(snp.annotations) set.seed(1400) pp.list <- preprocess.genetic.data(case[, 1:10], father.genetic.data = dad[ , 1:10], mother.genetic.data = mom[ , 1:10], ld.block.vec = c(10)) ## run GA for observed data #observed data chromosome size 2 run.gadgets(pp.list, n.chromosomes = 5, chromosome.size = 2, results.dir = 'tmp_2', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) combined.res2 <- combine.islands('tmp_2', snp.annotations[ 1:10, ], pp.list, 2) unlink('tmp_reg', recursive = TRUE) #observed data chromosome size 3 run.gadgets(pp.list, n.chromosomes = 5, chromosome.size = 3, results.dir = 'tmp_3', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) combined.res3 <- combine.islands('tmp_3', snp.annotations[ 1:10, ], pp.list, 2) unlink('tmp_reg', recursive = TRUE) # create three permuted datasets set.seed(1400) perm.data.list <- permute.dataset(pp.list, "perm_data", n.permutations = 3) #pre-process permuted data case.p1 <- readRDS("perm_data/case.permute1.rds") comp.p1 <- readRDS("perm_data/complement.permute1.rds") p1.list <- preprocess.genetic.data(case.p1, complement.genetic.data = comp.p1, ld.block.vec = c(10)) case.p2 <- readRDS("perm_data/case.permute2.rds") comp.p2 <- readRDS("perm_data/complement.permute2.rds") p2.list <- preprocess.genetic.data(case.p2, complement.genetic.data = comp.p2, ld.block.vec = c(10)) case.p3 <- readRDS("perm_data/case.permute3.rds") comp.p3 <- readRDS("perm_data/complement.permute3.rds") p3.list <- preprocess.genetic.data(case.p3, complement.genetic.data = comp.p3, ld.block.vec = c(10)) #permutation 1, chromosome size 2 run.gadgets(p1.list, n.chromosomes = 5, chromosome.size = 2, results.dir = 'p1_tmp_2', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) p1.combined.res2 <- combine.islands('p1_tmp_2', snp.annotations[ 1:10, ], p1.list, 2) unlink('tmp_reg', recursive = TRUE) #permutation 1, chromosome size 3 run.gadgets(p1.list, n.chromosomes = 5, chromosome.size = 3, results.dir = 'p1_tmp_3', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) p1.combined.res3 <- combine.islands('p1_tmp_3', snp.annotations[ 1:10, ], p1.list, 2) unlink('tmp_reg', recursive = TRUE) #permutation 2, chromosome size 2 run.gadgets(p2.list, n.chromosomes = 5, chromosome.size = 2, results.dir = 'p2_tmp_2', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) p2.combined.res2 <- combine.islands('p2_tmp_2', snp.annotations[ 1:10, ], p2.list, 2) unlink('tmp_reg', recursive = TRUE) #permutation 2, chromosome size 3 run.gadgets(p2.list, n.chromosomes = 5, chromosome.size = 3, results.dir = 'p2_tmp_3', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) p2.combined.res3 <- combine.islands('p2_tmp_3', snp.annotations[ 1:10, ], p2.list, 2) unlink('tmp_reg', recursive = TRUE) #permutation 3, chromosome size 2 run.gadgets(p3.list, n.chromosomes = 5, chromosome.size = 2, results.dir = 'p3_tmp_2', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) p3.combined.res2 <- combine.islands('p3_tmp_2', snp.annotations[ 1:10, ], p3.list, 2) unlink('tmp_reg', recursive = TRUE) #permutation 3, chromosome size 3 run.gadgets(p3.list, n.chromosomes = 5, chromosome.size = 3, results.dir = 'p3_tmp_3', cluster.type = 'interactive', registryargs = list(file.dir = 'tmp_reg', seed = 1500), generations = 2, n.islands = 2, island.cluster.size = 1, n.migrations = 0) p3.combined.res3 <- combine.islands('p3_tmp_3', snp.annotations[ 1:10, ], p3.list, 2) unlink('tmp_reg', recursive = TRUE) ## create list of results # chromosome size 2 results chrom2.list <- list( observed.data = combined.res2$fitness.score, permutation.list = list( p1.combined.res2$fitness.score, p2.combined.res2$fitness.score, p3.combined.res2$fitness.score ) ) # chromosome size 3 results chrom3.list <- list( observed.data = combined.res3$fitness.score, permutation.list = list( p1.combined.res3$fitness.score, p2.combined.res3$fitness.score, p3.combined.res3$fitness.score ) ) final.results <- list(chrom2.list, chrom3.list) lapply(c('tmp_2', 'tmp_3', 'p1_tmp_2', 'p2_tmp_2', 'p3_tmp_2', 'p1_tmp_3', 'p2_tmp_3', 'p3_tmp_3', 'perm_data'), unlink, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.