blockgen: Haplotype block generator

ghap.blockgenR Documentation

Haplotype block generator

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

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

Arguments

object

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


# #### DO NOT RUN IF NOT NECESSARY ###
# 
# # Copy phase data in the current working directory
# exfiles <- ghap.makefile(dataset = "example",
#                          format = "phase",
#                          verbose = TRUE)
# file.copy(from = exfiles, to = "./")
# 
# # Load data
# phase <- ghap.loadphase("example")
# 
# ### 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 kbp sliding 100 kbp at a time
# blocks.kb <- ghap.blockgen(phase, windowsize = 100,
#                            slide = 100, unit = "kbp")



GHap documentation built on July 2, 2022, 1:07 a.m.