Learn R Programming

seqMeta (version 1.6.7)

prepScores2: Prepare scores for region based (meta) analysis

Description

This function is a replacement for prepScores, prepScoresX and prepCox. It computes and organizes the neccesary output to efficiently meta-analyze SKAT and other tests. Note that the tests are *not* computed by these functions. The output must be passed to one of skatMeta, burdenMeta, or singlesnpMeta. Unlike the SKAT package which operates on one gene at a time, these functions are intended to operate on many genes, e.g. a whole exome, to facilitate meta analysis of whole genomes or exomes.

Usage

prepScores2(Z, formula, family = "gaussian", SNPInfo = NULL, snpNames = "Name", aggregateBy = "gene", kins = NULL, sparse = TRUE, data = parent.frame(), male = NULL, verbose = FALSE)

Arguments

Z
A genotype matrix (dosage matrix) - rows correspond to individuals and columns correspond to SNPs. Use 'NA' for missing values. The column names of this matrix should correspond to SNP names in the SNP information file.
formula
Base formula, of the kind used in glm() - typically of the form y~covariate1 + covariate2. For Cox models, the formula follows that of the coxph() function.
family
either 'gaussian', for continuous data, 'binomial' for 0/1 outcomes or 'cox' for survival models. Family data not currently supported for binomial or survival outcomes. Male also not supported for survival outcomes. See Details.
SNPInfo
SNP Info file - must contain fields given in 'snpName' and 'aggregateBy'.
snpNames
The field of SNPInfo where the SNP identifiers are found. Default is 'Name'. See Details.
aggregateBy
The field of SNPInfo on which the skat results were aggregated. Default is 'gene'. For single snps which are intended only for single variant analyses, it is recomended that they have a unique identifier in this field.
kins
the kinship matrix for related individuals. Only supported for family=gaussian(). See lmekin in the kinship2 package for more details.
sparse
whether or not to use a sparse Matrix approximation for dense kinship matrices (defaults to TRUE).
data
data frame in which to find variables in the formula
male
For analyzing the X chromosome, with prepScoresX, `male' is the gender (0/1 or F/T) indicating female/male. See details.
verbose
logical. whether or not to print the progress bar.

Value

an object of class 'seqMeta'. This is a list, not meant for human consumption, but to be fed to skatMeta() or another function. The names of the list correspond to gene names. Each element in the list contains

Details

This function is a drop in replacement for prepScores, prepScoresX, and prepCox. If family is 'cox' then the call is equivalent to prepCox and an error will occur if either male or kins is provided. When family is 'gaussian' or 'binomial' and male is not provided then the call is equivalent to prepScores. Whereas if male is provided then the call is equivalent to prepScoresX. This function computes the neccesary information to meta analyze SKAT analyses: the individual SNP scores, their MAF, and a covariance matrix for each unit of aggregation. Note that the SKAT test is *not* calculated by this function. The output must be passed to one of skatMeta, burdenMeta, or singlesnpMeta. A crucial component of SKAT and other region-based tests is a common unit of aggregation accross studies. This is given in the SNP information file (argument SNPInfo), which pairs SNPs to a unit of aggregation (typically a gene). The additional arguments snpNames and aggregateBy specify the columns of the SNP information file which contain these pairings. Note that the column names of the genotype matrix Z must match the names given in the snpNames field. Using prepScores2, users are strongly recommended to use all SNPs, even if they are monomorphic in your study. This is for two reasons; firstly, monomorphic SNPs provide information about MAF across all studies; without providing the information we are unable to tell if a missing SNP data was monomorphic in a study, or simply failed to genotype adequately in that study. Second, even if some SNPs will be filtered out of a particular meta-analysis (e.g., because they are intronic or common) constructing seqMeta objects describing all SNPs will reduce the workload for subsequent follow-up analyses. Note: to view results for a single study, one can pass a single seqMeta object to a function for meta-analysis.

References

Wu, M.C., Lee, S., Cai, T., Li, Y., Boehnke, M., and Lin, X. (2011) Rare Variant Association Testing for Sequencing Data Using the Sequence Kernel Association Test (SKAT). American Journal of Human Genetics. Chen H, Meigs JB, Dupuis J. Sequence Kernel Association Test for Quantitative Traits in Family Samples. Genetic Epidemiology. (To appear) Lin, DY and Zeng, D. On the relative efficiency of using summary statistics versus individual-level data in meta-analysis. Biometrika. 2010.

See Also

prepScores prepScoresX prepCox skatMeta burdenMeta singlesnpMeta skatOMeta

Examples

Run this code
###load example data for two studies:
### see ?seqMetaExample
data(seqMetaExample)

####run on each cohort:
cohort1 <- prepScores2(Z=Z1, y~sex+bmi, SNPInfo = SNPInfo, data = pheno1)
cohort2 <- prepScores2(Z=Z2, y~sex+bmi, SNPInfo = SNPInfo, kins = kins, data = pheno2)

#### combine results:
##skat
out <- skatMeta(cohort1, cohort2, SNPInfo = SNPInfo)
head(out)

##T1 test
out.t1 <- burdenMeta(cohort1,cohort2, SNPInfo = SNPInfo, mafRange = c(0,0.01))
head(out.t1)

##single snp tests:
out.ss <- singlesnpMeta(cohort1,cohort2, SNPInfo = SNPInfo)
head(out.ss)
## Not run: 
# ########################
# ####binary data
# cohort1 <- prepScores2(Z=Z1, formula = ybin~1, family = "binomial", 
#                        SNPInfo = SNPInfo, data = pheno1)
# out <- skatMeta(cohort1, SNPInfo = SNPInfo)
# head(out)
# 
# ####################
# ####survival data
# cohort1 <- prepScores2(Z=Z1, formula = Surv(time,status)~strata(sex)+bmi, 
#                        family = "cox", SNPInfo = SNPInfo, data = pheno1)
# out <- skatMeta(cohort1, SNPInfo = SNPInfo)
# head(out)
# ## End(Not run)

Run the code above in your browser using DataLab