Description Usage Arguments Details Value Author(s) See Also Examples
Calculate the number of SNPs for identity by state for each pair of samples
1 2 3 |
gdsobj |
a GDS file object ( |
sample.id |
a vector of sample id specifying selected samples; if NULL, all samples are used |
snp.id |
a vector of snp id specifying selected SNPs; if NULL, all SNPs are used |
autosome.only |
if TRUE, use autosomal SNPs only |
remove.monosnp |
if TRUE, remove monomorphic SNPs |
maf |
to use the SNPs with ">= maf" only; if NaN, no MAF threshold |
missing.rate |
to use the SNPs with "<= missing.rate" only; if NaN, no missing threshold |
num.thread |
the number of CPU cores used |
verbose |
if TRUE, show information |
The minor allele frequency and missing rate for each SNP passed in snp.id
are
calculated over all the samples in sample.id
.
Return a list (n is the number of samples):
sample.id |
the sample ids used in the analysis |
snp.id |
the SNP ids used in the analysis |
ibs0 |
a n-by-n matrix, the number of SNPs sharing 0 IBS |
ibs1 |
a n-by-n matrix, the number of SNPs sharing 1 IBS |
ibs2 |
a n-by-n matrix, the number of SNPs sharing 2 IBS |
Xiuwen Zheng
1 2 3 4 5 6 7 8 9 10 | # open an example dataset (HapMap)
genofile <- openfn.gds(snpgdsExampleFileName())
RV <- snpgdsIBSNum(genofile)
pop <- read.gdsn(index.gdsn(genofile, "sample.annot/pop.group"))
L <- order(pop)
image(RV$ibs0[L, L]/length(RV$snp.id))
# close the genotype file
closefn.gds(genofile)
|
Loading required package: gdsfmt
SNPRelate -- supported by Streaming SIMD Extensions 2 (SSE2)
Hint: it is suggested to call `snpgdsOpen' to open a SNP GDS file instead of `openfn.gds'.
Identity-By-State (IBS) analysis on genotypes:
Excluding 365 SNPs on non-autosomes
Excluding 1 SNP (monomorphic: TRUE, MAF: NaN, missing rate: NaN)
Working space: 279 samples, 8,722 SNPs
using 1 (CPU) core
IBS: the sum of all selected genotypes (0,1,2) = 2446510
Mon Apr 23 13:24:44 2018 (internal increment: 13056)
[..................................................] 0%, ETC: ---
[==================================================] 100%, completed in 0s
Mon Apr 23 13:24:44 2018 Done.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.