app.permut: Pairs permuations

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/permut_pairs.r

Description

Apply given function to relatedness of permutated pairs

Usage

1
 app.permut(app, permut.pairs, group=rep(1:nrow(app)), FUN, unpairs=FALSE, fixed.pairs=NULL, B=1e5, thread=1) 

Arguments

app

Relatedness matrix

permut.pairs

Vector defining permutated pairs

group

Vector defining potential group in which permutations are done

FUN

Function to apply to relatedness of individulas excepted for given pairs. Argument function must be a vector.

unpairs

Logical, if TRUE relatedness of individuals pairs excepted for given pairs are considered.

fixed.pairs

Vector or matrix defining not permutated pairs or a list of such elements

B

Number of permutations

thread

Number of thread used by parallel package for permutations

Details

In each group, pairs definition are permutated in main to apply FUN function.

It is possible to include fixed rules for paris definition in fixed.pairs argument.

Value

A list of two.

First element, app_pairs, is the value of function FUN results for relatedness between given pairs or of individulas pairs excepted for given pairs for given pairs.

Second element, permut, is a vector of function FUN results for relatedness between given pairs or of individulas pairs excepted for given pairs for each permutations.

Author(s)

Claire Dandine-Roulland

References

Laurent, R and Chaix, R, 2012, MHC-dependent mate choice in humans: Why genomic patterns from the HapMap European American dataset support the hypothesi, BioEssays 34(4), 267-271

See Also

app.pairs, app.unpairs, zscore

Examples

1
2
3
4
5
6
7
8
# load chr2 data set (~10k SNPs in low LD)
x <- read.bed.matrix( system.file("extdata", "chr2.bed", package="gaston") )

# Compute Rousset Relationship Matrix
K <- Rousset(x)$Rousset

# Permutations
str(app.permut(K, x@ped$population, FUN=mean, B=20, thread=2))

genostats/gaston.pop documentation built on Jan. 17, 2022, 10:58 a.m.