Learn R Programming

gap (version 1.9)

Genetic Analysis Package

Description

As first reported [Zhao, J. H. 2007. "gap: Genetic Analysis Package". J Stat Soft 23(8):1-18. ], it is designed as an integrated package for genetic data analysis of both population and family data. Currently, it contains functions for sample size calculations of both population-based and family-based designs, probability of familial disease aggregation, kinship calculation, statistics in linkage analysis, and association analysis involving genetic markers including haplotype analysis with or without environmental covariates. Over years, the package has been developed in-between many projects hence also in line with the name (gap).

Copy Link

Version

Install

install.packages('gap')

Monthly Downloads

20,276

Version

1.9

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Jing Zhao

Last Published

February 6th, 2026

Functions in gap (1.9)

cs

Credible set
gc.em

Gene counting for haplotype analysis
gc.lambda

Estimation of the genomic control inflation statistic (lambda)
comp.score

score statistics for testing genetic linkage of quantitative trait
gcontrol2

genomic control based on p values
gap

Genetic analysis package
gcontrol

genomic control
gcp

Permutation tests using GENECOUNTING
g2a

Conversion of a genotype identifier to alleles
fbsize

Sample size for family-based linkage and association design
grid2d

Two-dimensional grid
geno.recode

Genotype recoding
genecounting

Gene counting for haplotype analysis
get_sdy

Get sd(y) from AF, n, b, se
h2.jags

Heritability estimation based on genomic relationship matrix using JAGS
h2G

Heritability and its variance
get_pve_se

Get pve and its standard error from n, z
get_b_se

Get b and se from AF, n, and z
gif

Kinship coefficient and genetic index of familiality
h2GE

Heritability and its variance when there is an environment component
hmht.control

Controls for highlights
hap.control

Control for haplotype reconstruction
hap

Haplotype reconstruction
h2l

Heritability under the liability threshold model
hg19

Chromosomal lengths for build 37
h2_mzdz

Heritability estimation according to twin correlations
hap.em

Gene counting for haplotype analysis
hg38

Chromosomal lengths for build 38
hg18

Chromosomal lengths for build 36
hwe.hardy

Hardy-Weinberg equilibrium test using MCMC
hap.score

Score statistics for association of traits with haplotypes
invnormal

Inverse normal transformation
kin.morgan

kinship matrix for simple pedigree
klem

Haplotype frequency estimation based on a genotype table of two multiallelic markers
hwe.jags

Hardy-Weinberg equlibrium test for a multiallelic marker using JAGS
hwe

Hardy-Weinberg equlibrium test for a multiallelic marker
ixy

Conversion of chrosome name from strings
htr

Haplotype trend regression
hwe.cc

A likelihood ratio test of population Hardy-Weinberg equilibrium for case-control studies
inv_chr_pos_a1_a2

Retrieval of chr:pos+a1/a2 according to SNP id
log10pvalue

log10(p) for a P value including its scientific format
metap

Meta-analysis of p values
mht.control

Controls for mhtplot
labelManhattan

Annotate Manhattan or Miami Plot
log10p

log10(p) for a normal deviate z
logp

log(p) for a normal deviate z
mhtplot

Manhattan plot
metareg

Fixed and random effects model for meta-analysis
makeped

A function to prepare pedigrees in post-MAKEPED format
masize

Sample size calculation for mediation analysis
mia

Multiple imputation analysis for hap
mhtplot.trunc

Truncated Manhattan plot
mr_forestplot

Mendelian Randomization forest plot
mr

Mendelian randomization analysis
mtdt2

Transmission/disequilibrium test of a multiallelic marker by Bradley-Terry model
miamiplot

Miami plot
mhtplot2

Manhattan plot with annotations
mtdt

Transmission/disequilibrium test of a multiallelic marker
miamiplot2

Miami Plot
muvar

Means and variances under 1- and 2- locus (biallelic) QTL model
plot.hap.score

Plot haplotype frequencies versus haplotype score statistics
pgc

Preparing weight for GENECOUNTING
pbsize2

Power for case-control association design
pedtodot

Converting pedigree(s) to dot file(s)
mvmeta

Multivariate meta-analysis based on generalized least squares
pbsize

Power for population-based association design
pedtodot_verbatim

Pedigree-drawing with graphviz
pfc.sim

Probability of familial clustering of disease
print.hap.score

Print a hap.score object
pfc

Probability of familial clustering of disease
qtl2dplot

2D QTL plot
qtlFinder

Distance-based signal identification
qqfun

Quantile-comparison plots
qtl2dplotly

2D QTL plotly
pvalue

P value for a normal deviate
qtl3dplotly

3D QTL plot
qtlClassifier

A QTL cis/trans classifier
revStrand

Allele on the reverse strand
read.ms.output

A utility function to read ms output
runshinygap

Start shinygap
qqunif

Q-Q plot for uniformly distributed random variable
whscore

Whittemore-Halpern scores for allele-sharing
tscc

Power calculation for two-stage case-control design
sentinels

Sentinel identification from GWAS summary statistics
snptest_sample

A utility to generate SNPTEST sample file
s2k

Statistics for 2 by K table
xy

Conversion of chromosome names to strings
LD22

LD statistics for two diallelic markers
KCC

Disease prevalences in cases and controls
ReadGRM

A function to read GRM file
a2g

Allele-to-genotype conversion
ReadGRMBin

A function to read GRM binary files
WriteGRM

A function to write GRM file
ESplot

Effect-size plot
FPRP

False-positive report probability
LDkl

LD statistics for two multiallelic markers
BFDP

Bayesian false-discovery probability
MCMCgrm

Mixed modeling with genetic relationship matrices
snpHWE

Functions for single nucleotide polymorphisms
chr_pos_a1_a2

SNP id by chr:pos+a1/a2
ci2ms

Effect size and standard error from confidence interval
b2r

Obtain correlation coefficients and their variance-covariances
METAL_forestplot

forest plot as R/meta's forest for METAL outputs
AE3

AE model using nuclear family trios
cis.vs.trans.classification

A cis/trans classifier
cnvplot

genomewide plot of CNVs
ab

Test/Power calculation for mediating effect
allele.recode

Allele recoding
asplot

Regional association plot
bt

Bradley-Terry model for contingency table
ccsize

Power and sample size for case-cohort design
circos.mhtplot2

Another circos Manhattan plot
circos.mhtplot

circos Manhattan plot with gene annotation
WriteGRMBin

A function to write GRM binary file
circos.cis.vs.trans.plot

circos plot of cis/trans classification
circos.cnvplot

circos plot of CNVs.
chow.test

Chow's test for heterogeneity in two regressions