rbm.GRR.power: Power of RVAT based on simulations and theoretical...

Description Usage Arguments Details Value See Also Examples

View source: R/rbm_GRR_power.r

Description

Computes the power of the tests CAST, WSS and SKAT based on simulations with GRR and based on theoretical calculations for CAST

Usage

1
2
3
4
5
6
7
8
9
rbm.GRR.power(genes.maf = Kryukov, size = c(500, 500), prev = 0.01, 
              GRR.matrix.del, GRR.matrix.pro = NULL, 
              p.causal = 0.5, p.protect = 0, same.variant = FALSE, 
              genetic.model=c("multiplicative", "general", "dominant", "recessive"), 
              select.gene, alpha = 2.5e-6, selected.controls = TRUE, 
              power.type = c("simulations", "theoretical"), verbose = TRUE, 
              RVAT = c("CAST", "WSS", "SKAT"), 
              SKAT.method = c("permutations", "theoretical"),
              maf.threshold = 0.01, replicates = 1000, cores = 10)

Arguments

genes.maf

A dataframe containing at least the MAF in the general population (column maf) for variants with their associated gene (column gene), by default the file Kryukov is used

size

A vector containing the size of each group (the first one being the control group)

prev

A vector containing the prevalence of each group of cases

GRR.matrix.del

A list containing the GRR matrix associated to the heterozygous genotype compared to the homozygous reference genotype as if all variants are deleterious. An additional GRR matrix associated to the homozygous for the alternate allele is needed if genetic.genetic.model="general"

GRR.matrix.pro

The same argument as GRR.matrix.del but for protective variants

p.causal

The proportion of causal variants in cases

p.protect

The proportion of protective variants in cases among causal variants

same.variant

TRUE/FALSE: whether the causal variants are the same in the different groups of cases

genetic.model

The genetic model of the disease

select.gene

Which gene to choose from genes.maf$gene if multiple genes are present. If missing, only the first level is kept.

alpha

The significance level to compute the power

selected.controls

Whether controls are selected controls (by default) or controls from the general population

power.type

Whether to compute the power based on 'simulations' (by default) or 'theoretical' calculations (only for CAST)

verbose

Whether to print details about the running function

RVAT

On which RVAT among 'CAST', 'WSS' and 'SKAT' to compute power (only needed if power.type="simulations"

SKAT.method

Which method to use to compute SKAT ppower, i.e. permutations or theoretical moments (cf SKAT documentation)

maf.threshold

The maf threshold to consider a causal variant (set at 0.01 by default)

replicates

On how many replicates the power should be computed

cores

How many cores to use for moments computation, set at 10 by default

Details

Simulations are performed in the same was as in rbm.GRR. Please refer to the documentation of this function.

Theoretical power is only available for CAST for which a non-central Chi-squared is used.

Value

A single value giving the power of CAST if power.type="theoretical" or the power of RVAT if power.type="simulations".

See Also

GRR.matrix, Kryukov, GnomADgenes, rbm.GRR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#GRR values calculated with the SKAT formula
GRR.del <- GRR.matrix(GRR = "SKAT", genes.maf = Kryukov, 
                      n.case.groups = 2, select.gene = "R1",
                      GRR.multiplicative.factor=2)
                              
#Simulation of one group of 1,000 controls and two groups of 500 cases, 
#each one with a prevalence of 0.001
#with 50% of causal variants, 5 genomic regions are simulated.
rbm.GRR.power(genes.maf = Kryukov, size = c(1000, 500, 500), 
              prev = c(0.001, 0.001), GRR.matrix.del = GRR.del, 
              p.causal = 0.5, p.protect = 0, select.gene="R1",
              same.variant = FALSE, genetic.model = "multiplicative", 
              power.type="theoretical", cores = 1, alpha = c(0.001,2.5e-6))

Ravages documentation built on Oct. 19, 2021, 5:07 p.m.