Jaccard: Jaccard index

Description Usage Arguments Details Value References Examples

View source: R/jaccard.r

Description

Calculates the Jaccard index for each pair of individuals using a bed.matrix

Usage

1
Jaccard(x, maf.threshold = 0.01)

Arguments

x

A bed.matrix

maf.threshold

The MAF used for the definition of a rare variant, set at 0.01 by default

Details

The individuals carrying no rare variants will have a null Jaccard index with all the individuals including themselves.

Value

A squared matrix giving the Jaccard index for each pair of individuals

References

Jaccard, P. (1908) Nouvelles researches sur la distribution florale, Bulletin de la Société vaudoise des sciences naturelles, 44, 223-270

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Simulation of genetic data with GRR values according to the SKAT formula
GRR.del <- GRR.matrix(GRR = "SKAT", genes.maf = Kryukov, 
                      n.case.groups = 2, select.gene = "R1",
                      GRR.multiplicative.factor=2)

#Simulation of one group of 1,000 controls and two groups of 500 cases, 
#50% of causal variants, 5 genomic regions are simulated.
x <- rbm.GRR(genes.maf=Kryukov, size = c(1000, 500, 500),
             prev = c(0.001, 0.001), select.gene = "R1", 
             GRR.matrix.del = GRR.del, p.causal = 0.5,
             genetic.model = "multiplicative", replicates = 5)
                           
#Calculate the Jaccard matrix
J <- Jaccard(x, maf.threshold = 0.01)

Ravages documentation built on Oct. 19, 2021, 5:07 p.m.