View source: R/burden_continuous.r
burden.continuous | R Documentation |
Performs a linear regression on a genetic score
burden.continuous(x, NullObject, genomic.region = x@snps$genomic.region,
burden, maf.threshold = 0.5, get.effect.size = F,
alpha = 0.05, cores = 10)
x |
A bed matrix, only needed if |
NullObject |
A list returned from |
genomic.region |
A factor containing the genomic region of each SNP, |
burden |
"CAST" or "WSS" to directly compute the CAST or the WSS genetic score, or a matrix with one row per individual and one column per |
maf.threshold |
The MAF threshold to use for the definition of a rare variant in the CAST score. Set at 0.5 by default |
get.effect.size |
TRUE/FALSE: whether to return the beta value |
alpha |
The alpha threshold to use for the OR confidence interval |
cores |
How many cores to use for moments computation, set at 10 by default |
This function will return results from the regression of the continuous phenotype on the genetic score for each genomic region.
If another genetic score than CAST or WSS is wanted, a matrix with one row per individual and one column per genomic.region
containing this score should be given to burden
. In this situation, no bed matrix x
is needed.
A dataframe with one row per genomic region and at least two columns:
p.value |
The p.value of the regression |
is.err |
0/1: whether there was a convergence problem with the regression |
beta |
The beta coefficient associated to the tested genomic region |
l.lower |
The lower bound of the confidence interval of beta |
l.upper |
The upper bound of the confidence interval of beta |
CAST
, WSS
, burden.weighted.matrix
#Import data in a bed matrix
x <- as.bed.matrix(x=LCT.matrix.bed, fam=LCT.matrix.fam, bim=LCT.snps)
#Add population
x@ped[,c("pop", "superpop")] <- LCT.matrix.pop1000G[,c("population", "super.population")]
#Select EUR superpopulation
x <- select.inds(x, superpop=="EUR")
x@ped$pop <- droplevels(x@ped$pop)
#Group variants within known genes
x <- set.genomic.region(x)
#Filter of rare variants: only non-monomorphic variants with
#a MAF lower than 2.5%
#keeping only genomic regions with at least 10 SNPs
x1 <- filter.rare.variants(x, filter = "whole", maf.threshold = 0.025, min.nb.snps = 10)
#run burden test WSS, using a random continuous variable as phenotype
x1@ped$pheno <- rnorm(nrow(x1))
#Null model
x1.H0 <- NullObject.parameters(pheno = x1@ped$pheno,
RVAT = "burden", pheno.type = "continuous")
#Get the beta value
burden.continuous(x1, NullObject = x1.H0, burden = "WSS",
get.effect.size = TRUE, cores = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.