hlaBED2Geno: Convert from PLINK BED format

Description Usage Arguments Value Author(s) See Also Examples

View source: R/DataUtilities.R

Description

To convert a PLINK BED file to an object of hlaSNPGenoClass.

Usage

1
2
hlaBED2Geno(bed.fn, fam.fn, bim.fn, rm.invalid.allele=FALSE,
    import.chr="xMHC", assembly="auto", verbose=TRUE)

Arguments

bed.fn

binary file, genotype information

fam.fn

family, individual information, etc

bim.fn

extended MAP file: two extra cols = allele names

rm.invalid.allele

if TRUE, remove SNPs with invalid alleles

import.chr

the chromosome, "1" .. "22", "X", "Y", "XY", "MT", "xMHC", or "", where "xMHC" implies the extended MHC on chromosome 6, and "" for all SNPs; "6" for all SNPs on chromosome 6 for HLA; "19" for all SNPs on chromosome 19 for KIR

assembly

the human genome reference: "hg18", "hg19" (default), "hg38"; "auto" refers to "hg19"; "auto-silent" refers to "hg19" without any warning

verbose

if TRUE, show information

Value

Return an object of hlaSNPGenoClass.

Author(s)

Xiuwen Zheng

See Also

hlaGeno2PED, hlaGDS2Geno

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Import a PLINK BED file
bed.fn <- system.file("extdata", "HapMap_CEU.bed", package="HIBAG")
fam.fn <- system.file("extdata", "HapMap_CEU.fam", package="HIBAG")
bim.fn <- system.file("extdata", "HapMap_CEU.bim", package="HIBAG")

hapmap.ceu <- hlaBED2Geno(bed.fn, fam.fn, bim.fn, assembly="hg19")
summary(hapmap.ceu)

# Or

hapmap.ceu <- hlaBED2Geno(bed.fn, fam.fn, bim.fn, assembly="hg19",
    rm.invalid.allele=TRUE, import.chr="6")
summary(hapmap.ceu)

Example output

HIBAG (HLA Genotype Imputation with Attribute Bagging)
Kernel Version: v1.3
Supported by Streaming SIMD Extensions (SSE2) [64-bit]
Open "/usr/local/lib/R/site-library/HIBAG/extdata/HapMap_CEU.bed" in the individual-major mode.
Open "/usr/local/lib/R/site-library/HIBAG/extdata/HapMap_CEU.fam".
Open "/usr/local/lib/R/site-library/HIBAG/extdata/HapMap_CEU.bim".
Import 3932 SNPs within the xMHC region on chromosome 6.
SNP genotypes: 
	90 samples X 3932 SNPs
	SNPs range from 28694391bp to 33426848bp on hg19
Missing rate per SNP:
	min: 0, max: 0.1, mean: 0.0888861, median: 0.1, sd: 0.0298489
Missing rate per sample:
	min: 0, max: 0.869786, mean: 0.0888861, median: 0.00101729, sd: 0.261554
Minor allele frequency:
	min: 0, max: 0.5, mean: 0.210453, median: 0.191358, sd: 0.155144
Allelic information:
 A/C  A/G  A/T  C/G  C/T  G/T 
 332 1567   64  111 1510  348 
Open "/usr/local/lib/R/site-library/HIBAG/extdata/HapMap_CEU.bed" in the individual-major mode.
Open "/usr/local/lib/R/site-library/HIBAG/extdata/HapMap_CEU.fam".
Open "/usr/local/lib/R/site-library/HIBAG/extdata/HapMap_CEU.bim".
Import 5316 SNPs from chromosome 6.
SNP genotypes: 
	90 samples X 5316 SNPs
	SNPs range from 25651262bp to 33426848bp on hg19
Missing rate per SNP:
	min: 0, max: 0.1, mean: 0.0882054, median: 0.1, sd: 0.030674
Missing rate per sample:
	min: 0, max: 0.863619, mean: 0.0882054, median: 0.00131678, sd: 0.259735
Minor allele frequency:
	min: 0, max: 0.5, mean: 0.201867, median: 0.179012, sd: 0.155475
Allelic information:
 A/C  A/G  A/T  C/G  C/T  G/T 
 471 2102   83  134 2046  480 

HIBAG documentation built on March 24, 2021, 6 p.m.