write.hap: Save Haplotype Results to Disk

View source: R/IO.R

write.hapR Documentation

Save Haplotype Results to Disk

Description

This function will write hap result into a txt file.

Usage

write.hap(x, file = file, sep = "\t", pheno = pheno, phenoName = phenoName)

Arguments

x

objec of hapResult or hapSummary class

file

file path, where to save the hap result/summary

sep

the field separator string. Values within each row of x are separated by this string. Default as "⁠\t⁠"

pheno, phenoName

the phenotype data.frame, only used for export hapResult object.

Details

The hap result and hap summary result have common features. The common features of these two types are: First four rows contains extra information: CHR, POS, INFO and ALLELE Hap names were in the first column. The differences are: Hap summary result have a freq column while hap result not. Rows represent haplotypes in hap summary result, while rows represent accessions in hap result. In addtion, the accessions of each haplotype in hap summary result were separated by ";".

Value

No return value

Examples



oriDir <- getwd()
 temp_dir <- tempdir()
 if(! dir.exists(temp_dir))
   dir.create(temp_dir)
 setwd(temp_dir)
data("geneHapR_test")
write.hap(hapResult, file = "hapResult.txt")
setwd(oriDir)


geneHapR documentation built on May 29, 2024, 11:59 a.m.