app.genome: Across the genome

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

View source: R/across_genome.r

Description

Apply given function to relatedness at sliding genomic windows

Usage

1
2
 app.genome(bed, FUN, relatedness=GRM, windows, sliding,
                   unit=c("bases", "indices"), map='B36', centromere=NULL, LD.thin=NULL, thread=22) 

Arguments

bed

A bed.matrix

FUN

Function to apply to relatedness of individulas at genomic windows. Argument function must be a relatedness matrix.

relatedness

Function to compute relatedness matrix at genomic windows. Argument function must be a bed.matrix.

windows

Numerical value defined length of genomic windows

sliding

Increment length value of sliding genomic windows

unit

Distance unit in windows and sliding

map

Recombinaison map. Must be B36, B37 or a data.frame contains 'chr', 'base', 'rate.cM.Mb' and 'cM' variables". If B36, we use recombinaison map from Hapmap contained in genmapB36. If B37, we use recombinaison map from 1000 Genomes contained in genmapB37. If data.frame, centromere argument must be given.

centromere

Optional data.frame contains 'chr', 'start', 'end' variables which define centromere localisations (one line by chromosom)

LD.thin

Distance unit in windows and sliding

thread

Number of thread used by parallel package for permutations

Details

Compute the genetic relatedness and apply given function(s) for all sliding windows of given length windows in increments of sliding.

Value

A data.frame (one line by genomic region) with columns :

chr, start end end defining genomic region localisation

index.start end index.end defining first and last SNP index inluded in genomic region

recombi_snps, recombinaison rate estimated on SNPs included in x defining genomic region

recombi_region, mean recombinaison rate on genomic region

centro, logical, TRUE if region overlapping a centromere

num, number of SNPs in genomic region

LD end LD_sd, mean and standard deviation of LD in genomic region

maf end maf_sd, mean and standard deviation of maf in genomic region

H end H_sd, mean and standard deviation of Heterogosity in genomic region

Hz end Hz_sd, mean and standard deviation of heterozygous individuals proportion in genomic region

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
9
# load chr2 data set (~10k SNPs in low LD)
x <- read.bed.matrix( system.file("extdata", "chr2.bed", package="gaston") )

# Compute Rousset Relationship Matrix
relatedness <- function(x) Rousset(x)$Rousset
fun <- function(app) app.pairs(app, x@ped$population, mean)

# Across the genome
head(app.genome(x, fun, relatedness, windows=2000, sliding=500, unit="bases", thread=2))

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