hlaGenoSwitchStrand: Allele switching

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

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 or hlaSNPHaploClass

template

a genotypic object of hlaSNPGenoClass, a haplotypic object of hlaSNPHaploClass, 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 or hlaSNPHaploClass object consisting of the SNP intersect between target and template.

Author(s)

Xiuwen Zheng

See Also

hlaMakeSNPGeno, hlaMakeSNPHaplo, hlaGenoSubset, hlaHaploSubset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# load SNP genotypes
data(HapMap_CEU_Geno, package="HIBAG")
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 
#  471 2102   83  134 2046  480 

# 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 
# 136 655 632 141 

HIBAG documentation built on May 2, 2019, 4:50 p.m.