snpgdsSNPListIntersect {SNPRelate} | R Documentation |
Get a common SNP list by comparing their rs id, chromosome indices and positions.
snpgdsSNPListIntersect(snplist1, snplist2)
snplist1 |
the first SNP list object |
snplist2 |
the second SNP list object |
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 |
Xiuwen Zheng
snpgdsSNPList
, snpgdsSNPListStrand
# 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)