haplotyping: Haplotype genotypes

Description Usage Arguments Value Author(s) Examples

Description

Generate matrix of HapGenotypes for user-defined blocks.

Usage

1
2
ghap.haplotyping(phase, blocks, outfile, freq = c(0,1), drop.minor = FALSE,
 batchsize = 500, ncores = 1, verbose = TRUE)

Arguments

phase

A GHap.phase object.

blocks

A data frame containing block boundaries, such as supplied by the ghap.blockgen function.

outfile

A character value specifying the name for the output files.

freq

A numeric vector of length 2 specifying the range of haplotype allele frequency to be included in the output. Default is c(0,1), which includes all alleles.

drop.minor

A logical value specfying whether the minor allele should be excluded from the output (default = FALSE).

batchsize

A numeric value controlling the number of haplotype blocks to be processed and written to output at a time (default = 500).

ncores

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

verbose

A logical value specfying whether log messages should be printed (default = TRUE).

Value

The function outputs three files with suffix:

  • .hapsamples: space-delimited file without header containing two columns: Population and Individual ID.

  • .hapalleles: space-delimited file without header containing five columns: Block Name, Chromosome, Start and End Position (in bp), and HapAllele.

  • .hapgenotypes: space-delimited file without header containing the HapGenotype matrix (coded as 0, 1 or 2 copies of the HapAllele). The dimension of the matrix is m x n, where m is the number of HapAlleles and n is the number of individuals.

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
# #### 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")
#
# 
# ### RUN ###
# 
# # Generate matrix of haplotype genotypes
# ghap.haplotyping(phase, blocks.mkr, batchsize = 100, ncores = 2, outfile = "human")


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

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.