Learn R Programming

geneHapR (version 1.2.4)

hap2hmp: Convert hapResult object to hapmap (hmp) format, for interact with other packages

Description

Convert hapResult object to hapmap (hmp) format, for interact with other packages

Usage

hap2hmp(hap)

hmp2hap(hmp, hapPrefix = "H", hetero_remove = TRUE, na_drop = TRUE, ...)

Value

a data.frame in hapmap format.

Arguments

hap

object of "hapResult" class

hmp

object of "data.frame" class in hapmap format

hapPrefix

prefix of haplotype names

hetero_remove

whether remove accessions contains hyb-sites, Character not A T C G

na_drop

whether drop accessions contains missing data ("N", "NA", ".")

...

Arguments passed on to table2hap

x

a data.frame contains variants information. The first file column are fix as Chrome name, position, reference nuclieotide, alter nuclieotide and INFO. Accession genotype should be in followed columns. "-" will be treated as Indel. "." and "N" will be treated as missing data. Heterozygotes should be "A/T", "AAA/A"

pad

The number length in haplotype names should be extend to.

Examples

Run this code
# \donttest{
data("geneHapR_test")
hmp <- hap2hmp(hapResult)
hap <- hmp2hap(hmp)
# }

Run the code above in your browser using DataLab