hlaGenoSwitchStrand: Allele switching

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/DataUtilities.R

Description

Determine the ordered pair of A and B alleles, using the allele information provided by template.

Usage

1
2
3
hlaGenoSwitchStrand(target, template,
    match.type=c("RefSNP+Position", "RefSNP", "Position"),
    same.strand=FALSE, verbose=TRUE)

Arguments

target

an object of hlaSNPGenoClass

template

a genotypic object of hlaSNPGenoClass, a model object of hlaAttrBagClass or a model object of hlaAttrBagObj

match.type

"RefSNP+Position" (by default) – using both of RefSNP IDs and positions; "RefSNP" – using RefSNP IDs only; "Position" – using positions only

same.strand

TRUE assuming alleles are on the same strand (e.g., forward strand); otherwise, FALSE not assuming whether on the same strand or not

verbose

show information, if TRUE

Details

The A/B pairs of target are determined using the information from template.

Value

Return a hlaSNPGenoClass object consisting of the SNP intersect between target and template.

Author(s)

Xiuwen Zheng

See Also

hlaMakeSNPGeno, hlaGenoSubset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
summary(HapMap_CEU_Geno)
# A/C A/G C/T G/T 
# 136 655 632 141 

# 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)
# A/C  A/G  A/T  C/G  C/T  G/T
# 332 1567   64  111 1510  348

# combine two datasets together
geno <- hlaGenoSwitchStrand(HapMap_CEU_Geno, hapmap.ceu)
summary(geno)
# There are 1564 SNPs in common.
# The allele pairs of 763 SNPs need to be switched.
# A/C A/G C/T G/T
# 104 505 496 109

Example output

HIBAG (HLA Genotype Imputation with Attribute Bagging)
Kernel Version: v1.3
Supported by Streaming SIMD Extensions (SSE2) [64-bit]
SNP genotypes: 
	60 samples X 1564 SNPs
	SNPs range from 25769023bp to 33421576bp on hg19
Missing rate per SNP:
	min: 0, max: 0.0666667, mean: 0.0651215, median: 0.0666667, sd: 0.00968287
Missing rate per sample:
	min: 0, max: 0.969949, mean: 0.0651215, median: 0.000639386, sd: 0.243737
Minor allele frequency:
	min: 0, max: 0.5, mean: 0.227582, median: 0.205357, sd: 0.1389
Allelic information:
A/C A/G C/T G/T 
136 655 632 141 
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 
No allelic strand orders are switched.
SNP genotypes: 
	60 samples X 1214 SNPs
	SNPs range from 28695148bp to 33421576bp on hg19
Missing rate per SNP:
	min: 0, max: 0.0666667, mean: 0.0650879, median: 0.0666667, sd: 0.0097381
Missing rate per sample:
	min: 0, max: 0.968699, mean: 0.0650879, median: 0.000823723, sd: 0.243373
Minor allele frequency:
	min: 0, max: 0.5, mean: 0.234476, median: 0.223214, sd: 0.13833
Allelic information:
A/C A/G C/T G/T 
104 505 496 109 

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