blockgen: Haplotype block generator

Description Usage Arguments Value Author(s) Examples

Description

This function generates HapBlocks based on sliding windows. The window and the step size can be specified in markers or kbp. For each window, block coordinates are generated.

Usage

1
 ghap.blockgen(phase, windowsize = 10, slide = 5, unit = "marker", nsnp = 2)

Arguments

phase

A GHap.phase object

windowsize

A numeric value for the size of the window (default = 10).

slide

A numeric value for the step size (default = 5).

unit

A character value for the size unit used for the window and the step. It can be either "marker" or "kbp" (default = "marker").

nsnp

A numeric value for the minimum number of markers per block.

Value

A data frame with columns:

BLOCK

Block alias.

CHR

Chromosome name.

BP1

Block start position.

BP2

Block end position.

SIZE

Haplotype size.

NSNP

Number of marker.

Author(s)

Yuri Tani Utsunomiya <ytutsunomiya@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# #### 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)
# 
# ### RUN ###
# 
# # Generate blocks of 5 markers sliding 5 markers at a time
# blocks.mkr <- ghap.blockgen(phase, windowsize = 5, slide = 5, unit = "marker")
# 
# # Generate blocks of 100 kb sliding 100 kbp at a time
# blocks.kb <- ghap.blockgen(phase, windowsize = 100, slide = 100, unit = "kbp")

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

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