Title: | rqt: utilities for gene-level meta-analysis |
---|---|
Description: | Despite the recent advances of modern GWAS methods, it still remains an important problem of addressing calculation an effect size and corresponding p-value for the whole gene rather than for single variant. The R- package rqt offers gene-level GWAS meta-analysis. For more information, see: "Gene-set association tests for next-generation sequencing data" by Lee et al (2016), Bioinformatics, 32(17), i611-i619, <doi:10.1093/bioinformatics/btw429>. |
Authors: | Ilya Zhbannikov [aut, cre], Konstantin Arbeev [aut], Anatoliy Yashin [aut] |
Maintainer: | Ilya Zhbannikov <[email protected]> |
License: | GPL |
Version: | 1.33.0 |
Built: | 2024-11-06 06:15:07 UTC |
Source: | https://github.com/bioc/rqt |
Applies linear of logistic regregression to the data.
build.null.model(y, x, reg.family = "binomial", verbose = FALSE)
build.null.model(y, x, reg.family = "binomial", verbose = FALSE)
y |
A vector with values of dependent variable (outcome). |
x |
A data.frame of covariates. |
reg.family |
A regression family. Can be either "binomial" or "gaussian." |
verbose |
Indicates verbosing output. Default: FALSE. |
A list of two: "S" - a dataframe with predictors and "fit" - an object returned by "glm" function.
An accessor to covariates
covariates(obj) ## S4 method for signature 'rqt' covariates(obj)
covariates(obj) ## S4 method for signature 'rqt' covariates(obj)
obj |
An object of |
covariates returns the covariates
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) covariates(obj)
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) covariates(obj)
This function performs a gene-level test based on combined effect sizes.
geneTest This function performs a gene-level test based on combined effect sizes.
geneTest(obj, ...) ## S4 method for signature 'rqt' geneTest( obj, perm = 0, STT = 0.2, weight = FALSE, cumvar.threshold = 75, out.type = "D", method = "pca", scaleData = FALSE, asym.pval = FALSE, penalty = 0.001, verbose = FALSE )
geneTest(obj, ...) ## S4 method for signature 'rqt' geneTest( obj, perm = 0, STT = 0.2, weight = FALSE, cumvar.threshold = 75, out.type = "D", method = "pca", scaleData = FALSE, asym.pval = FALSE, penalty = 0.001, verbose = FALSE )
obj |
Object of class |
... |
Additional parameters to pass to the function |
perm |
Integer indicating the number of permutations to compute p-values. Default: 0. |
STT |
Numeric indicating soft truncation threshold (STT) to convert to gamma parameter (must be <= 0.4). Needed for an optimal parameter a in Gamma-distribution. Default: 0.2. See, for example, Fridley, et al 2013: "Soft truncation thresholding for gene set analysis of RNA-seq data: Application to a vaccine study". |
weight |
Logical value. Indicates using weights (see Lee et al 2016). Default: FALSE. |
cumvar.threshold |
Numeric value indicating the explained variance threshold for PCA-like methods. Default: 75 |
out.type |
Character, indicating a type of phenotype.
Possible values: |
method |
Method used to reduce multicollinerity and account for LD.
Default: |
scaleData |
A logic parameter (TRUE/FALSE) indicating scaling of the genotype dataset. |
asym.pval |
Indicates Monte Carlo approximation for p-values. Default: FALSE. |
penalty |
A value of |
verbose |
Indicates verbosing output. Default: FALSE. |
Updated rqt object with result slot
Object of class rqt
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) res <- geneTest(obj, method="pca", out.type = "D") print(res)
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) res <- geneTest(obj, method="pca", out.type = "D") print(res)
This function performs a gene-level meta-analysis based on combined effect sizes.
This function performs a gene-level meta-analysis based on combined effect sizes.
geneTestMeta(objects, ...) ## S4 method for signature 'list' geneTestMeta( objects, perm = 0, STT = 0.2, weight = FALSE, cumvar.threshold = 75, out.type = "D", method = "pca", scaleData = FALSE, asym.pval = FALSE, comb.test = "wilkinson", penalty = 0.001, verbose = FALSE )
geneTestMeta(objects, ...) ## S4 method for signature 'list' geneTestMeta( objects, perm = 0, STT = 0.2, weight = FALSE, cumvar.threshold = 75, out.type = "D", method = "pca", scaleData = FALSE, asym.pval = FALSE, comb.test = "wilkinson", penalty = 0.001, verbose = FALSE )
objects |
List of objects of class rqt |
... |
Additional parameters to pass to the function |
perm |
Integer indicating the number of permutations to compute p-values. Default: 0. |
STT |
Numeric indicating soft truncation threshold (STT) to convert to gamma parameter (must be <= 0.4). Needed for an optimal parameter a in Gamma-distribution. Default: 0.2. See, for example, Fridley, et al 2013: "Soft truncation thresholding for gene set analysis of RNA-seq data: Application to a vaccine study". |
weight |
Logical value. Indicates using weights (see Lee et al 2016). Default: FALSE. |
cumvar.threshold |
Numeric value indicating the explained variance threshold for PCA-like methods. Default: 75 |
out.type |
Character, indicating a type of phenotype.
Possible values: |
method |
Method used to reduce multicollinerity and account for LD.
Default: |
scaleData |
A logic parameter (TRUE/FALSE) indicating scaling of the genotype dataset. |
asym.pval |
Indicates Monte Carlo approximation for p-values. Default: FALSE. |
comb.test |
Statistical test for combining p-values. |
penalty |
Value of |
verbose |
Indicates verbosing output. Default: FALSE. |
A list of two: (i) final.pvalue - a final p-value across all studies; (ii) pvalueList - p-values for each study;
A list of two: (i) final.pvalue - a final p-value across all studies; (ii) pvalueList - p-values for each study;
data1 <- data.matrix(read.table(system.file("extdata/phengen2.dat", package="rqt"), skip=1)) pheno <- data1[,1] geno <- data1[, 2:dim(data1)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj1 <- rqt(phenotype=pheno, genotype=geno.obj) data2 <- data.matrix(read.table(system.file("extdata/phengen3.dat", package="rqt"), skip=1)) pheno <- data2[,1] geno <- data2[, 2:dim(data2)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj2 <- rqt(phenotype=pheno, genotype=geno.obj) data3 <- data.matrix(read.table(system.file("extdata/phengen.dat", package="rqt"), skip=1)) pheno <- data3[,1] geno <- data3[, 2:dim(data3)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj3 <- rqt(phenotype=pheno, genotype=geno.obj) res.meta <- geneTestMeta(list(obj1, obj2, obj3)) print(res.meta)
data1 <- data.matrix(read.table(system.file("extdata/phengen2.dat", package="rqt"), skip=1)) pheno <- data1[,1] geno <- data1[, 2:dim(data1)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj1 <- rqt(phenotype=pheno, genotype=geno.obj) data2 <- data.matrix(read.table(system.file("extdata/phengen3.dat", package="rqt"), skip=1)) pheno <- data2[,1] geno <- data2[, 2:dim(data2)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj2 <- rqt(phenotype=pheno, genotype=geno.obj) data3 <- data.matrix(read.table(system.file("extdata/phengen.dat", package="rqt"), skip=1)) pheno <- data3[,1] geno <- data3[, 2:dim(data3)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj3 <- rqt(phenotype=pheno, genotype=geno.obj) res.meta <- geneTestMeta(list(obj1, obj2, obj3)) print(res.meta)
get.reg.family
geneTestOne( phenotype, genotype, covariates, STT = 0.2, weight = FALSE, cumvar.threshold = 75, method = "pca", out.type = "D", scaleData = FALSE, penalty = 0.001, verbose = FALSE )
geneTestOne( phenotype, genotype, covariates, STT = 0.2, weight = FALSE, cumvar.threshold = 75, method = "pca", out.type = "D", scaleData = FALSE, penalty = 0.001, verbose = FALSE )
phenotype |
phenotype |
genotype |
genotype |
covariates |
covariates |
STT |
STT |
weight |
weight |
cumvar.threshold |
cumvar.threshold |
method |
method |
out.type |
out.type |
scaleData |
scaleData |
penalty |
penalty |
verbose |
verbose |
rslt
A genotype accessor
genotype(obj) ## S4 method for signature 'rqt' genotype(obj)
genotype(obj) ## S4 method for signature 'rqt' genotype(obj)
obj |
An object of |
genotype returns the genotype
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) genotype(obj)
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) genotype(obj)
Get a given STT
get.a(L, STT = 0.2)
get.a(L, STT = 0.2)
L |
TODO |
STT |
Numeric indicating soft truncation threshold (STT) to convert to gamma parameter (must be <= 0.4). |
a number from gamma distribution
get.reg.family
get.reg.family(out.type = "D")
get.reg.family(out.type = "D")
out.type |
out.type |
reg.family
A phenotype accessor
phenotype(obj) ## S4 method for signature 'rqt' phenotype(obj)
phenotype(obj) ## S4 method for signature 'rqt' phenotype(obj)
obj |
An object of |
phenotype returns the phenotype
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) phenotype(obj)
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) phenotype(obj)
Preprocess input data with Principal Component Analysis method (PCA)
preprocess( data, pheno = NULL, method = "pca", reg.family = "binomial", scaleData = FALSE, cumvar.threshold = 75, out.type = "D", penalty = 0.001, verbose = FALSE )
preprocess( data, pheno = NULL, method = "pca", reg.family = "binomial", scaleData = FALSE, cumvar.threshold = 75, out.type = "D", penalty = 0.001, verbose = FALSE )
data |
An input matrix with values of independent variables (predictors). |
pheno |
A phenotype - column-vector, needed for LASSO/ridge and
|
method |
A dimensionality reduction method.
Default: |
reg.family |
A regression family.
Default: |
scaleData |
A logical variable, indicates wheither or
not scaling should be performed. Default: |
cumvar.threshold |
A threshold value for explained variance.
Default: |
out.type |
An output (phenotype) type.
Default: |
penalty |
Value of penalty parameter for LASSO/ridge regression.
Default: |
verbose |
Indicates verbosing output. Default: FALSE. |
A list of one: "S" - a data frame of predictor values.
preprocessLASSO
preprocessLASSO(data, pheno, reg.family, penalty = 0.001)
preprocessLASSO(data, pheno, reg.family, penalty = 0.001)
data |
data |
pheno |
pheno data |
reg.family |
reg.family |
penalty |
penalty Default: FALSE. |
list(S, fit, model)
preprocessPCA
preprocessPCA(data, scaleData, cumvar.threshold, verbose)
preprocessPCA(data, scaleData, cumvar.threshold, verbose)
data |
data |
scaleData |
scaled data |
cumvar.threshold |
cumvar.threshold |
verbose |
Indicates verbosing output Default: FALSE. |
list(S, indices, model).
preprocessPLS
preprocessPLS(data, pheno, scaleData, cumvar.threshold, out.type)
preprocessPLS(data, pheno, scaleData, cumvar.threshold, out.type)
data |
data |
pheno |
pheno data |
scaleData |
scaleData |
cumvar.threshold |
cumvar.threshold |
out.type |
out.type Default: FALSE. |
list(S, Y, model)
preprocessLASSO
preprocessRidge(data, pheno, reg.family, penalty = 0.001)
preprocessRidge(data, pheno, reg.family, penalty = 0.001)
data |
data |
pheno |
pheno data |
reg.family |
reg.family |
penalty |
penalty Default: FALSE. |
list(S, fit, model)
An accessor to results
results(obj) ## S4 method for signature 'rqt' results(obj)
results(obj) ## S4 method for signature 'rqt' results(obj)
obj |
An object of |
results returns the results
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) res <- geneTest(obj, method="pca", out.type = "D") results(res)
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) res <- geneTest(obj, method="pca", out.type = "D") results(res)
Importing required packages and functions
ridge_se(xs, y, yhat, my_mod, verbose = FALSE)
ridge_se(xs, y, yhat, my_mod, verbose = FALSE)
xs |
Genotype matrix |
y |
Phenotype |
yhat |
Ridge/LASSO regression object |
my_mod |
Ridge/LASSO regression object |
verbose |
Indicates verbosing output, Default: FALSE. |
list(vcov, se). vcov: variance-covariance matrix; se: standard deviation
This function generates rqt class objects
rqt(phenotype = NULL, genotype = NULL, covariates = NULL, results = NULL)
rqt(phenotype = NULL, genotype = NULL, covariates = NULL, results = NULL)
phenotype |
Phenotype (a vector of length
|
genotype |
Genotype - an object of class
|
covariates |
Covariates, a data frame |
results |
A list of two: test statistics:
( |
Object of class rqt
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) print(obj)
data <- data.matrix(read.table(system.file("extdata/test.bin1.dat", package="rqt"), header=TRUE)) pheno <- data[,1] geno <- data[, 2:dim(data)[2]] colnames(geno) <- paste(seq(1, dim(geno)[2])) geno.obj <- SummarizedExperiment(geno) obj <- rqt(phenotype=pheno, genotype=geno.obj) print(obj)
This class stores parameters and results of the rtq algorithms
None
phenotype
:Phenotype (a vector of length
N
, where N
- number of individuals).
genotype
:Genotype - an object of class
SummarizedExperiment
. Should contain one assay
(matrix, N
by M
where N
- number of individuals, M
- number of genetic variants).
covariates
:data frame N
by K
where N
- number of individuals, K
- number of covariates)
results
:A list of two:
test statistics (Q1
, Q2
, Q3
),
p-values (p1.Q1
, p2.Q2
, p3.Q3
)
rqt
such as accessors and printing.Common methods for class rqt. This document lists a series of basic methods for the class rqt
Common methods for class rqt
None
Applies linear of logistic regregression to the data.
simple.multvar.reg(null.model, Z, verbose = FALSE)
simple.multvar.reg(null.model, Z, verbose = FALSE)
null.model |
A fitted null model |
Z |
A genotype matrix |
verbose |
Indicates verbosing output. Default: FALSE. |
A list of two: "S" - a dataframe with predictors and "fit" - an object returned by "glm" function.
vcov_ridge: returns variance-covariance matrix and standard deviation for ridge/LASSO regression object
vcov_ridge(x, y, rmod, verbose = FALSE)
vcov_ridge(x, y, rmod, verbose = FALSE)
x |
Genotype matrix |
y |
Phenotype |
rmod |
Ridge/LASSO regression object |
verbose |
Indicates verbosing output, Default: FALSE. |
list(vcov, se). vcov: variance-covariance matrix; se: standard deviation