snpgdsSNPListIntersect {SNPRelate}R Documentation

Get a common SNP list between two SNP list objects

Description

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

Usage

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

# open an example dataset (HapMap)
genofile <- snpgdsOpen(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 file
snpgdsClose(genofile)

[Package SNPRelate version 1.10.2 Index]