hlaFlankingSNP: SNP IDs or SNP genotypes in Flanking Region

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

View source: R/DataUtilities.R

Description

To get SNPs in the flanking region of a specified HLA/KIR locus.

Usage

1
2
3
hlaFlankingSNP(snp.id, position, locus, flank.bp=500000L, assembly="auto",
    pos.start=NA_integer_, pos.end=NA_integer_)
hlaGenoSubsetFlank(genoobj, locus="any", flank.bp=500000L, assembly="auto")

Arguments

snp.id

a vector of SNP IDs

genoobj

a genotype object of hlaSNPGenoClass

position

a vector of positions

locus

the name of HLA locus, or "any" for other genes

flank.bp

the size of flanking region on each side in basepair

assembly

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

pos.start

the start position of the gene

pos.end

the end position of the gene

Details

hla.id is "A", "B", "C", "DRB1", "DRB5", "DQA1", "DQB1", "DPB1" or "any".

Value

Return selected SNP IDs from snp.id.

Author(s)

Xiuwen Zheng

See Also

hlaGenoSubset, hlaLociInfo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# make a "hlaAlleleClass" object
hla.id <- "A"
hla <- hlaAllele(HLA_Type_Table$sample.id,
    H1 = HLA_Type_Table[, paste(hla.id, ".1", sep="")],
    H2 = HLA_Type_Table[, paste(hla.id, ".2", sep="")],
    locus=hla.id, assembly="hg19")

# training genotypes
region <- 500   # kb
snpid <- hlaFlankingSNP(HapMap_CEU_Geno$snp.id, HapMap_CEU_Geno$snp.position,
    hla.id, region*1000, assembly="hg19")
train.geno <- hlaGenoSubset(HapMap_CEU_Geno,
    snp.sel  = match(snpid, HapMap_CEU_Geno$snp.id))
summary(train.geno)


# or using hlaGenoSubsetFlank
train.geno <- hlaGenoSubsetFlank(HapMap_CEU_Geno, hla.id, region*1000)
summary(train.geno)


## customize positions
snpid <- hlaFlankingSNP(HapMap_CEU_Geno$snp.id, HapMap_CEU_Geno$snp.position,
    "any", 500*1000, pos.start=29457816, pos.end=30450205)

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