| Type: | Package |
| Encoding: | UTF-8 |
| Title: | Statistical Tests and Utilities for Genetic Association |
| Version: | 1.6.2 |
| Date: | 2026-7-16 |
| Depends: | lattice, CompQuadForm, MASS, MBESS, R (≥ 3.5) |
| Description: | A collection of statistical tests for genetic association studies and summary data based Mendelian randomization. |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| LazyLoad: | yes |
| Config/roxygen2/version: | 8.0.0 |
| LazyData: | true |
| NeedsCompilation: | no |
| Packaged: | 2026-07-16 14:18:59 UTC; kaiwang |
| Author: | Dr. Kai Wang [aut], Kai Wang [cre] |
| Maintainer: | Kai Wang <kai-wang@uiowa.edu> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-16 14:40:02 UTC |
Statistical Tests and utilities for Genetic Association
Description
iGasso is a collection of statistical tests developed by our group for genetic association studies. So far it contains functions for rare variants association, for association with multiple phenotypes, for linear mixed model analysis, and for model-free association analysis. There is also a function for genome plot. It will keep growing as more tests are developed. Use ?iGasso to see an introduction.
Details
| Package: | iGasso |
| Type: | Package |
| Version: | 1.6 |
| Date: | 2023-09-16 |
| License: | GPL (>=2) |
| LazyLoad: | yes |
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Anscombe F.J. (1948) The transformation of Poisson, binomial and negative-binomial data. Biometrika 35(3/4), 246–254.
Chanter, D. O. (1975). Modifications of the angular transformation. Journal of the Royal Statistical Society. Series B (Applied Statistics), 24 (3), 354–359.
Freeman, M. F., Tukey, J. W. (1950) Transformations related to the angular and the square root. The Annals of Mathematical Statistics 21(4), 607–611.
Wang, K. (2012) An application of the proportional odds model to genetic association studies. Submitted.
Wang K. (2012) Statistical tests of genetic association for case-control study designs. Biostatistics. Accepted. PMID: 22389176
Wang, K., Fingert, J. (2012) Statistical tests for detecting rare variants using variance-stabilizing transformations. Annals of Human Genetics. Accepted.
Zar, J. H. (1999) Biostatistical Analysis, 4th ed., New Jersey:Prentice-Hall, Inc.
Examples
y = rnorm(100)
chr = c(rep(1, 20), rep(3, 20), rep(10, 20), rep(19, 30), rep("X", 10))
pos = c(1:20, 1:20, 1:20, 1:30, 1:10)
mydata = data.frame(y=y, chr=chr, pos=pos)
genome.plot(mydata, sig.line=c(1, -1), ylab="T Statistic")
G = rbind(c(14, 999), c(3, 1081))
VSTF.test(G)
G = rbind(c(161, 474, 489), c(231, 444, 380))
MFree.test(G)
G = matrix(sample(c(0,1,2), 200, replace=TRUE), ncol=10)
y = rnorm(10)
X = matrix(rnorm(10), ncol=1)
Conditional Inference for the Kernel Association Test (KAT)
Description
Computes the asymptotic and the approximate conditional p-values for the kernel association test
Usage
KAT_coin(y, G, X = NULL, out_type = "D", distribution = "asymptotic", B = 1000)
Arguments
y |
a vector of phenotype on |
G |
an |
X |
a matrix of covariates. It has |
out_type |
an indicator of the outcome type. |
distribution |
a character, the conditional null distribution of the test statistic can be approximated by its asymptotic distribution ("asymptotic", default) or via Monte Carlo resampling ("approximate"), as in package |
B |
the number of permutations if |
Details
The asymptotic conditional null distribution is obtained using results in Strasser and Weber (1999). The p-value based on this distribution is computed using Davies' method.
Value
A list with class "htest" containing the following components:
statistic | The value of the kernel association test statistic. |
parameter | The sample size and the number of SNPs. |
p.value | The p-value based on the asymptotic or the approximate conditional null distribution. |
method | A character string indicting the test performed. |
data.name | A character string giving the name of the data. |
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Strasser, H. and Weber, C. (1999) On the asymptotic theory of permutation statistics. Mathematical Methods of Statistics. 8(2):220-250.
Wang, K. (2017) Conditional Inference for the Kernel Association Test. Bioinformatics 33 (23), 3733-3739.
Examples
n=1000
y = c(rep(1, n/2), rep(0, n/2))
maf = seq(0.05, 0.5, 0.05)
g = NULL
for (j in 1:10){
geno.freq = c(maf[j]^2, 2*maf[j]*(1-maf[j]), (1-maf[j])^2)
g = cbind(g, sample(c(0,1,2), n, replace=TRUE, prob=geno.freq))
}
KAT_coin(y, g, X=NULL, out_type="D", B=1000)
Model-free Association Tests
Description
MFree.test performs tests on association between an SNP and case-control status. It tests whether the frequencies of an allele are the same between cases and controls. It does not require specification of an inheritance model.
Usage
MFree.test(G, method = "score")
Arguments
G |
a |
method |
a character string indicating the test statistic to use. One of |
Details
Each test is named after the author(s) of the corresponding publication.
Value
A list with class "test" containing the following components:
statistic | The value of the test statistic. |
p.value | The p-value for the test computed from a chi-square distribution with 1 df. |
method | A character string indicting the test performed. |
data.name | A character string giving the name of the data. |
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang K. (2012) Statistical tests of genetic association for case-control study designs. Biostatistics. 13(4):724-33. PMID: 22389176
Examples
G = rbind(c(161, 474, 489), c(231, 444, 380))
MFree.test(G)
MFree.test(G, method = "Wald")
MFree.test(G, method = "LRT")
Test of Heterogeneity in MR using Principal Components
Description
MR_het_test performs tests of heterogeneity in MR.
Usage
MR_het_test(x.b, y.b, x.se, y.se, b0, k = NULL, cum.prop = 0.8)
Arguments
x.b |
a vector of the estimated regression coefficients from the SNP-exposure GWAS |
y.b |
a vector of the estimated regression coefficients from the SNP-outcome GWAS |
x.se |
a vector of SEs for |
y.se |
a vector of SEs for |
b0 |
a value used for the common effect size. It is used for the weighting matrix |
k |
the number of principal components used. It is used by the |
cum.prop |
threshold for selecting |
Value
A list containing the following components:
* P_\text{min}(b_0) statistic and its P-value.
* \tilde Q_\text{min}(b_0) statistic, its degrees of freedom, and its P-value.
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K, Alberding, Steven Y. (2024) Powerful test of heterogeneity in two-sample summary-data Mendelian randomization. Statistics in Medicine, 2024; 43:5791–5802.
Examples
p = 10
b = 0.5
gamma.true = runif(p, 0.34, 1.1)
x.se = runif(p, 0.06, 0.1)
y.se = runif(p, 0.015, 0.11)
x.b = rnorm(p, gamma.true, x.se)
y.b = rnorm(p, b*gamma.true, y.se)
b0 = 0.4
MR_het_test(x.b, y.b, x.se, y.se, b0)
A Gene- or Pathway-Based Test of Association
SKATlus provides enhanced power over SKAT by properly estimating the null distribution of SKAT.
Description
This version uses only subjects with lower phenotypic values for estimating the null distribution. That is, the "controls" are those of lower phenotypic values. When "controls" are of higher phenotypic values, change the sign of the phenotypic values in order to use this function.
Usage
SKATplus(
y,
G,
X = NULL,
out_type = "D",
tau = NULL,
permutation = FALSE,
B = 1000
)
Arguments
y |
a vector of phenotype on |
G |
an |
X |
a matrix of covariates. It has |
out_type |
an indicator of the outcome type. |
tau |
proportion of selected subjects used for SKATplus. |
permutation |
an indicator. Use permutation for p-value or not. |
B |
the number of permutations if |
Value
A list with class "htest" containing the following components:
statistic | The value of the test statistic. It is the same as SKAT statistic. |
parameter | The sample size and the number of SNPs. |
p.value | The p-value for SKATplus computed using Davies' method. |
method | A character string indicting the test performed. |
data.name | A character string giving the name of the data. |
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K. (2016) Boosting the power of the sequence kernel association test (SKAT) almost surely by properly estimating its null distribution. A J Hum Genet. 99 (1), 104-114.
Examples
n=1000
y = c(rep(1, n/2), rep(0, n/2))
maf = seq(0.05, 0.5, 0.05)
g = NULL
for (j in 1:10){
geno.freq = c(maf[j]^2, 2*maf[j]*(1-maf[j]), (1-maf[j])^2)
g = cbind(g, sample(c(0,1,2), n, replace=TRUE, prob=geno.freq))
}
SKATplus(y, g, X=NULL, out_type="D", tau=NULL, permutation=FALSE, B=1000)
Interval Estimates for Summary Data Mendelian Randomization Analysis in the Presence of Winner's Curse
Description
SMR_interval calculates conservative box method interval, k-unit support interval, and Wald confidence interval for the causal effect.
Usage
SMR_interval(
summary.data,
sig.level = 5e-08,
k = 2,
alpha = 0.05,
method = "box"
)
Arguments
summary.data |
a vector ( |
sig.level |
the threshold |
k |
the unit used for the k-unit support. The default value is 2. |
alpha |
|
method |
method to construct the interval. It is either " |
Value
The returned value is method-dependent.
For method == "box": A list containing the following components:
* an interval estimate.
* type of the interval: completely bounded, exclusive bounded, or bounded.
For method == "support": A list containing the following components:
* Estimate The likelihood estimate of b.
* an interval estimate.
For method == "wald": an interval estimate.
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K. (2023) Support interval for two-sample summary data-based mendelia randomization. Genes, 14(1):211.
Wang, K. (2023) Interval estimate of causal effect in summary data based Mendelian randomization in the presence of winner’s curse. Genetic Epidemiology, 14(1):211.
Zhu, Z. et al. (2016) Integration of summary data from GWAS and eQTL studies predicts complex trait gene targets. Nature Genetics, 48(5):481.
Examples
summary.data = c(0.13707, 0.0235162, -0.0637257, 0.013774)
SMR_interval(summary.data)
SMR_interval(summary.data, method = "support")
SMR_interval(summary.data, method = "wald")
Association Tests for Rare Variants Based on Variance-Stabilizing Transformation
Description
VSTF.test performs tests on association between a rare variant and case-control status using a variance-stabilizing transformation.
Usage
VSTF.test(G, method = "Anscombe")
Arguments
G |
a |
method |
a character string indicating which transformation to use. One of |
Details
Each test is named after the author(s) of the corresponding publication.
Value
A list with class "test" containing the following components:
statistic | The value of the test statistic. |
p.value | The p-value for the test computed from a chi-square distribution with 1 df. |
method | A character string indicting the test performed. |
data.name | A character string giving the name of the data. |
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Anscombe, F. J. (1948) The transformation of Poisson, binomial and negative-binomial data. Biometrika 35(3/4), 246–254.
Chanter, D. O. (1975). Modifications of the angular transformation. Journal of the Royal Statistical Society. Series B (Applied Statistics) 24(3), 354–359.
Freeman, M. F., Tukey, J. W. (1950) Transformations related to the angular and the square root. The Annals of Mathematical Statistics 21(4), 607–611.
Wang, K., Fingert, J. (2012) Statistical tests for detecting rare variants using variance-stabilizing transformations. Annals of Human Genetics. 76(5):402-409.
Zar, J.H. (1999) Biostatistical Analysis, 4th ed., New Jersey:Prentice-Hall, Inc.
Examples
## Example 1 of Li et al. (2010)
G = rbind(c(14, 999), c(3, 1081))
VSTF.test(G)
VSTF.test(G, method = "arcsine")
VSTF.test(G, method = "Freeman-Tukey")
Effect of Body Mass Index (BMI) on Coronary Artery Disease (CAD)
Description
It contains independent datasets from three genome-wide association studies (GWASs):
Exposure dataset: A GWAS for BMI in round 2 of the UK BioBank (sample size: 336,107), http://www.nealelab.is/uk-biobank.
Outcome dataset: A GWAS A GWAS for CAD from the CARDIoGRAMplusC4D consortium (sample size: ~185,000), with genotype imputation using the 1000 Genome Project, (PubMed 26343387).
Selection dataset: A GWAS for BMI in the Japanese population (sample size: 173,430), (PubMed 28892062).
Usage
data(bmi.cad)
Format
A data.frame with 1119 rows and 42 variables.
Source
https://github.com/qingyuanzhao/mr.raps, https://github.com/tye27/mr.divw
Genome-wide Plot of a Variable
Description
genome.plot plots the value of a variable across the genome.
Usage
genome.plot(
mydata,
style = 1,
type = "h",
sig.line = c(4, -4),
sig.color = c("red", "red"),
...
)
Arguments
mydata |
a data frame containing three variables: |
style |
either |
type |
a generic graphic parameter. Recommended values are |
sig.line |
vertical locations of significance lines. |
sig.color |
colors of significance lines. |
... |
other parameters to be passed to function |
Details
This function makes use of the function xyplot from package lattice.
Author(s)
Kai Wang <kai-wang@uiowa.edu>
Examples
y = rnorm(100)
chr = c(rep(1, 20), rep(3, 20), rep(10, 20), rep(19, 30), rep("X", 10))
pos = c(1:20, 1:20, 1:20, 1:30, 1:10)
mydata = data.frame(y=y, chr=chr, pos=pos)
mydata2 = data.frame(y=y^2, chr=chr, pos=pos)
genome.plot(mydata, sig.line=c(1, -1), ylab="T Statistic")
genome.plot(mydata, sig.line=c(1, -1), ylab="T Statistic", type="b")
genome.plot(mydata2, sig.line=c(2), ylab="y squared")
genome.plot(mydata, style=2, sig.line=c(1, -1), ylab="T Statistic")
genome.plot(mydata, style=2, sig.line=c(1, -1), ylab="T Statistic", type="b")
An exact method for SNP-heritability estimation using GWAS summary statistics
Description
h2_snp calculates heritability explained by a set of SNPs
Usage
h2_snp(beta, SE, N, R, alpha)
Arguments
beta |
a vector of beta coefficients for a set of SNPs. These coefficients are from a GWAS. |
SE |
a vector of the standard errors of the beta coefficients. |
N |
a vector of sample sizes used by the GWAS at these SNPs. |
R |
LD matrix for these SNPs. |
alpha |
|
Value
A list containing the following components:
* MLE of the heritability.
* umvu (uniformly minimum variance unbiased) estimator of the heritability.
* interval estimate for the heritability.
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K. (2023) An exact method for SNP-heritability estimation using GWAS summary statistics without heritability modeling. submitted
Examples
beta = c(0.225269, 0.221270, 0.162635, 0.261669, 0.150887,
0.214515, 0.170296, 0.204454, 0.254811, 0.213803)
SE = c(0.033244, 0.032551, 0.032171, 0.031042, 0.032815,
0.031908, 0.031717, 0.032023, 0.031907, 0.032291)
N = 10000
R = diag(1, 10)
alpha = 0.05
h2_snp(beta, SE, N, R, alpha)
Modified Bland-Altman plot for checking genetic homogeneity between two samples
Description
mBAplot checks genetic homogeneity between two samples using summary statistics.
Usage
mBAplot(
b.x,
se.x,
n.x,
b.y,
se.y,
n.y,
k.x = 0,
k.y = 0,
main = "Modified Bland-Altman Plot"
)
Arguments
b.x |
a vector of the estimated regression coefficients from the SNP-exposure GWAS |
se.x |
a vector of SEs for |
n.x |
a vector of the numbers of genotyped subjects at each SNP for the SNP-exposure GWAS. can be a scalar |
b.y |
a vector of the estimated regression coefficients from the SNP-outcome GWAS |
se.y |
a vector of SEs for |
n.y |
a vector of the numbers of genotyped subjects at each SNP for the SNP-outcome GWAS. can be a scalar |
k.x |
a value specifying the number of covariates used for the x-sample |
k.y |
a value specifying the number of covariates used for the y-sample |
main |
a title for the plot. Default: "Modified Bland-Altman Plot" |
Value
A modified Bland-Altman plot
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K, Wang, Grace Z. (2026) Checking genetic homogeneity using summary statistics for valid Mendelian randomization analysis. Statistics in Medicine. https://doi.org/10.1002/sim.70663
Examples
attach(bmi.cad)
mBAplot(beta.selection, se.selection, 173430, beta.outcome, se.outcome, 185000,
main = "BMI-Japanese vs CAD-Consortium")
detach(bmi.cad)
An Accurate Normalization Method for High Throughput Sequencing Data
Description
Estimates scaling factors using the trimmed average of ratios of quantiles (TARQ) method
Usage
tarq(X, tau = 0.3)
Arguments
X |
a matrix of raw counts. Rows are for taxa (genes, transcripts) and columns for samples |
tau |
a numerical value in (0, 0.5). The upper |
Details
Estimation of scaling factors for NGS read counts data is challenging. TARQ provides a quantile-based method for estimating scaling factors. It starts by ordering the raw counts sample by sample and constructs a reference sample from these ordered counts. To compute the scaling factor for a sample, ratios of its quantiles to those of the reference sample are formed. Zero ratios are removed. Then extreme ratios (too large or too small) are trimmed before taking average over the remaining ratios.
Value
a vector of scaling factors. Normalized counts can be obtained by sweep(X, 2, scale.factors, FUN="/")
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K. (2018) An Accurate Normalization Method for Next-Generation Sequencing Data. Submitted.
Examples
#data(throat.otu.tab)
#data(throat.meta)
#otu.tab = t(throat.otu.tab)
#tarq(otu.tab, 0.3)
##### Use TARQ with DESeq2
#dds <- DESeqDataSetFromMatrix(countData = otu.tab,
# colData = throat.meta,
# design= ~ SmokingStatus)
#sizeFactors(dds) <- tarq(otu.tab, 0.3)
#dds <- DESeq(dds)
#results(dds)
#
###### Use TARQ with edgeR
#cs <- colSums(otu.tab)
#scale.factors <- tarq(otu.tab, 0.3)
#tmp <- scale.factors/cs
#norm.factors <- tmp/exp(mean(log(tmp)))
#dgList <- DGEList(counts = otu.tab, genes=rownames(otu.tab), norm.factors = norm.factors)
#designMat <- model.matrix(~ throat.meta$SmokingStatus)
#dgList <- estimateGLMCommonDisp(dgList, design=designMat)
#fit <- glmFit(dgList, designMat)
#glmLRT(fit, coef=2)
Two-stage least squares estimator for two-sample summary statistics MR
Description
MR causal effect estimation using summary statistics from two independent GWASs
Usage
tssmr(b.x, se.x, n.x, b.y, se.y, n.y, k.x = 0, k.y = 0)
Arguments
b.x |
a vector of the estimated regression coefficients from the SNP-exposure GWAS |
se.x |
a vector of SEs for |
n.x |
a vector of the numbers of genotyped subjects at each SNP for the SNP-exposure GWAS. It can be a scalar |
b.y |
a vector of the estimated regression coefficients from the SNP-outcome GWAS |
se.y |
a vector of SEs for |
n.y |
a vector of the numbers of genotyped subjects at each SNP for the SNP-outcome GWAS. It can be a scalar |
k.x |
a value specifying the number of covariates used for the x-sample |
k.y |
a value specifying the number of covariates used for the y-sample |
Value
A list with the following components:
tstsls | Estimate and SE |
tstsls2 | Estimate and SE allowing for many invalid instruments |
tsiv | Estimate and SE |
iv.test | Test statistic and p-value for testing validity of the candidate IV SNPs |
ivw | Estimate and SEs (naive and consistent) |
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K, Wang, Grace Z. (2026) Valid inference for two sample summary data Mendelian randomization. Submitted.
Wang, K, Wang, Grace Z. (2026) Valid two-sample summary-statistics Mendelian randomization with many invalid instruments. Submitted.
Examples
attach(bmi.cad)
tssmr(beta.selection, se.selection, 173430, beta.outcome, se.outcome, 185000)
detach(bmi.cad)
V-V plot for checking genetic homogeneity between two samples
Description
vvplot checks genetic homogeneity between two samples using summary statistics.
Usage
vvplot(
b.x,
se.x,
n.x,
b.y,
se.y,
n.y,
k.x = 0,
k.y = 0,
xlab = "Exposure",
ylab = "Outcome",
main = "V-V Plot"
)
Arguments
b.x |
a vector of the estimated regression coefficients from the SNP-exposure GWAS |
se.x |
a vector of SEs for |
n.x |
a vector of the numbers of genotyped subjects at each SNP for the SNP-exposure GWAS. can be a scalar |
b.y |
a vector of the estimated regression coefficients from the SNP-outcome GWAS |
se.y |
a vector of SEs for |
n.y |
a vector of the numbers of genotyped subjects at each SNP for the SNP-outcome GWAS. can be a scalar |
k.x |
a value specifying the number of covariates used for the x-sample |
k.y |
a value specifying the number of covariates used for the y-sample |
xlab |
a title for the x axis. Default: "Exposure" |
ylab |
a title for the y axis. Default: "Outcome" |
main |
a title for the plot. Default: "V-V Plot" |
Value
A V-V plot
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K, Wang, Grace Z. (2026) Checking genetic homogeneity using summary statistics for valid Mendelian randomization analysis. Statistics in Medicine. https://doi.org/10.1002/sim.70663
Examples
attach(bmi.cad)
vvplot(beta.selection, se.selection, 173430, beta.outcome, se.outcome, 185000,
main = "BMI-Japanese vs CAD-Consortium")
detach(bmi.cad)