snpgdsSNPListIntersect: Get a common SNP list between two SNP list objects

Description Usage Arguments Value Author(s) See Also Examples

View source: R/SNPRelate_Main.r

Description

Get a common SNP list by comparing their rs id, chromosome indices and positions.

Usage

1
snpgdsSNPListIntersect(snplist1, snplist2)

Arguments

snplist1

the first SNP list object snpgdsSNPListClass

snplist2

the second SNP list object snpgdsSNPListClass

Value

Return an object of “snpgdsSNPListClass” including the following components:

rs.id

SNP id

chromosome

SNP chromosome index

position

SNP physical position in basepair

allele

reference / non-ref alleles from the first SNP list object

afreq

allele frequency from the first SNP list object

Author(s)

Xiuwen Zheng

See Also

snpgdsSNPList, snpgdsSNPListStrand

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# open an example dataset (HapMap)
genofile <- openfn.gds(snpgdsExampleFileName())

# to get a snp list object
snplist1 <- snpgdsSNPList(genofile)
snplist2 <- snpgdsSNPList(genofile)

# a common snp list
snplist <- snpgdsSNPListIntersect(snplist1, snplist2)

summary(snplist$afreq)

# close the genotype file
closefn.gds(genofile)

SNPRelate documentation built on May 2, 2019, 4:56 p.m.