hapstats: Haplotype statistics

Description Usage Arguments Value Author(s) Examples

Description

HapAllele summary statistics.

Usage

1
2
ghap.hapstats(haplo, alpha = c(1,1), only.active.samples = TRUE,
 only.active.alleles = TRUE, ncores = 1)

Arguments

haplo

A GHap.haplo object.

alpha

A numeric vector of size 2 specifying the shrinkage parameters for the expected-to-observed homozygotes ratio. Default is c(1,1).

only.active.samples

A logical value specifying whether only active samples should be included in the output (default = TRUE).

only.active.alleles

A logical value specifying whether only active haplotype alleles should be included in the output (default = TRUE).

ncores

A numeric value specifying the number of cores to be used in parallel computations (default = 1).

Value

A data frame with columns:

BLOCK

Block alias.

CHR

Chromosome name.

BP1

Block start position.

BP2

Block end position.

ALLELE

Haplotype allele identity.

N

Number of observations for the haplotype.

FREQ

Haplotype frequency.

O.HOM

Observed number of homozygotes.

O.HET

Observed number of heterozygotes.

E.HOM

Expected number of homozygotes.

RATIO

Shrinkage expected-to-observed ratio for the number of homozygotes.

BIN.logP

log10(1/P) or -log10(P) for Hardy-Weinberg equilibrium assuming number of homozygotes follows a Binomial distribution.

POI.logP

log10(1/P) or -log10(P) for Hardy-Weinberg equilibrium assuming number of homozygotes follows a Poisson distribution.

TYPE

Category of the haplotype: "SINGLETON" = unique haplotype of its block; "ABSENT" = the frequency of the allele is 0; "MINOR" = the least frequent haplotype of its block (in the case of ties, only the first haplotype is marked); "MAJOR" = the most frequent hapotype of its block (ties are also resolved by marking the first haplotype); "REGULAR" = the haplotype does not fall in any of the previous categories. Categories "SINGLETON", "MINOR" and "MAJOR" only apply for blocks where frequencies sum to 1.

Author(s)

Yuri Tani Utsunomiya <ytutsunomiya@gmail.com>

Marco Milanesi <marco.milanesi.mm@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# #### DO NOT RUN IF NOT NECESSARY ###
# 
# # Copy the example data in the current working directory
# ghap.makefile()
# 
# # Load data
# phase <- ghap.loadphase("human.samples", "human.markers", "human.phase")
# 
# # Subset data - markers with maf > 0.05
# maf <- ghap.maf(phase, ncores = 2)
# markers <- phase$marker[maf > 0.05]
# phase <- ghap.subsetphase(phase, unique(phase$id), markers)
# 
# # Generate blocks of 5 markers sliding 5 markers at a time
# blocks.mkr <- ghap.blockgen(phase, windowsize = 5, slide = 5, unit = "marker")
#
# # Generate matrix of haplotype genotypes
# ghap.haplotyping(phase, blocks.mkr, batchsize = 100, ncores = 2, outfile = "human")
#
# # Load haplotype genotypes
# haplo <- ghap.loadhaplo("human.hapsamples", "human.hapalleles", "human.hapgenotypes")
#
#
# ### RUN ###
#
# #Compute haplotype statistics
# hapstats <- ghap.hapstats(haplo, ncores = 2)

GHap documentation built on May 29, 2017, 9:56 p.m.

Search within the GHap package
Search all R packages, documentation and source code