Description Usage Arguments Value Author(s) See Also Examples
Get a common SNP list by comparing their snp id, chromosome, positions and allele frequency if needed.
1 2 |
snplist1 |
the SNP list object |
snplist2 |
the SNP list object |
... |
the other SNP list objects |
method |
|
na.rm |
if TRUE, remove mismatched alleles |
same.strand |
if TRUE, assuming the alleles on the same strand |
verbose |
if TRUE, show information |
Return a list of snpgdsSNPListClass
including the following
components:
idx1 |
the indices of common SNPs in the first GDS file |
idx2 |
the indices of common SNPs in the second GDS file |
idx... |
|
idx |
the indices of common SNPs in the n-th GDS file |
flag2 |
an integer vector, flip flag for each common SNP for the
second GDS file (assuming a value |
flag... |
|
flag |
flip flag for each common SNP for the n-th GDS file |
Xiuwen Zheng
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())
# to get a snp list object
snplist1 <- snpgdsSNPList(genofile)
snplist2 <- snpgdsSNPList(genofile)
# a common snp list, exactly matching
v <- snpgdsSNPListIntersect(snplist1, snplist2)
names(v)
# "idx1" "idx2"
# a common snp list, matching by position
v <- snpgdsSNPListIntersect(snplist1, snplist2, method="pos")
names(v)
# "idx1" "idx2" "flag2"
table(v$flag2, exclude=NULL)
# close the file
snpgdsClose(genofile)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.