Last chance! 50% off unlimited learning
Sale ends in
prepScores
, but
with the additional argument `adjustments' specifying genes for which
conditional analyses are desired, and which SNPs to condition on.
prepCondScores(Z, formula, family = stats::gaussian(), SNPInfo = NULL, adjustments = NULL, snpNames = "Name", aggregateBy = "gene", kins = NULL, sparse = TRUE, data = parent.frame())
prepScores
, the null models in each element of the
list may be different. When meta analyzing these, it may be good to subset
the SNPInfo file to the genes of interest.
prepCondScores
,
but requires an extra argument `adjustments`. This is a data frame of the
same format as the SNPInfo, i.e. with a `snpNames` and `aggregateBy`
columns. The function works by looping through the genes in the adjustment
file, adding the corresponding SNPs to the null model. For instance, if
one wants to adjuste `gene1` for SNPs a and b (which need not be in gene
1), and `gene2' for SNPs c, the adjustments would be something like
adjustments = data.frame(Name = c("a","b","c"), gene =
c("gene1","gene1","gene2"))
See the examples for an illustration.
prepScores
skatMeta
burdenMeta
singlesnpMeta
###load example data for two studies:
### see ?seqMetaExample
data(seqMetaExample)
#specify adjustment variables
adjustments <- SNPInfo[c(1:3, 20,100), ]
adjustments
####run on each study:
cohort1.adj <- prepCondScores(Z=Z1, y~sex+bmi, SNPInfo = SNPInfo,
adjustments=adjustments, data =pheno1)
cohort2.adj <- prepCondScores(Z=Z2, y~sex+bmi, SNPInfo = SNPInfo,
adjustments=adjustments, kins=kins, data=pheno2)
SNPInfo.sub <- subset(SNPInfo, (SNPInfo$gene \%in\% adjustments$gene) &
!(SNPInfo$Name \%in\% adjustments$Name) )
#skat
out.skat <- skatMeta(cohort1.adj,cohort2.adj, SNPInfo = SNPInfo.sub)
head(out.skat)
##T1 test
out.t1 <- burdenMeta(cohort1.adj,cohort2.adj, SNPInfo = SNPInfo.sub, mafRange = c(0,0.01))
head(out.t1)
##single snp tests:
out.ss <- singlesnpMeta(cohort1.adj,cohort2.adj, SNPInfo = SNPInfo.sub)
head(out.ss)
Run the code above in your browser using DataLab