Description Usage Arguments Details Value Author(s) References See Also Examples
Calculate the genotype score for pairs of individuals based on identity-by-state (IBS) measure
1 2 3 4 |
gdsobj |
an object of class |
sample1.id |
a vector of sample id specifying selected samples; if NULL, all samples are used |
sample2.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 |
method |
|
type |
|
dosage |
TRUE, uses dosages 0, 1, 2; FALSE, uses 0, 1 (changing a return value of 1 or 2 to be 1) |
with.id |
if |
output |
if |
verbose |
if TRUE, show information |
sample1.id | sample2.id | |||||||
Patient | Donor | IBS | GVH | HVG | GVH.major | GVH.minor | GVH.major.only | GVH.minor.only |
AA / 2 | AA / 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 |
AA / 2 | AB / 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
AA / 2 | BB / 0 | 0 | 2 | 2 | 1 | 0 | 1 | NA |
AB / 1 | AA / 2 | 1 | 1 | 0 | 0 | 1 | NA | 1 |
AB / 1 | AB / 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 |
AB / 1 | BB / 0 | 1 | 1 | 0 | 1 | 0 | 1 | NA |
BB / 0 | AA / 2 | 0 | 2 | 2 | 0 | 1 | NA | 1 |
BB / 0 | AB / 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
BB / 0 | BB / 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 |
Return a list:
sample.id |
the sample ids used in the analysis,
if |
snp.id |
the SNP ids used in the analysis, if |
score |
a matrix of genotype score:
if |
Xiuwen Zheng
Warren, E. H., Zhang, X. C., Li, S., Fan, W., Storer, B. E., Chien, J. W., Boeckh, M. J., et al. (2012). Effect of MHC and non-MHC donor/recipient genetic disparity on the outcome of allogeneic HCT. Blood, 120(14), 2796-806. doi:10.1182/blood-2012-04-347286
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | # open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())
# autosomal SNPs
selsnp <- snpgdsSelectSNP(genofile, autosome.only=TRUE, remove.monosnp=FALSE)
# sample ID
sample.id <- read.gdsn(index.gdsn(genofile, "sample.id"))
father.id <- read.gdsn(index.gdsn(genofile, "sample.annot/father.id"))
offspring.id <- sample.id[father.id != ""]
father.id <- father.id[father.id != ""]
# calculate average genotype scores
z1 <- snpgdsPairScore(genofile, offspring.id, father.id, snp.id=selsnp,
method="IBS", type="per.pair")
str(z1)
head(z1$score)
# calculate average genotype scores
z1 <- snpgdsPairScore(genofile, offspring.id, father.id, snp.id=selsnp,
method="IBS", type="per.pair", dosage=FALSE)
str(z1)
head(z1$score)
# calculate average genotype scores
z2 <- snpgdsPairScore(genofile, offspring.id, father.id, snp.id=selsnp,
method="IBS", type="per.snp")
str(z2)
z2$score[, 1:4]
mean(z2$score["Avg",])
mean(z2$score["SD",])
plot(z2$score["Avg",], pch=20, cex=0.75, xlab="SNP Index", ylab="IBS score")
# calculate a matrix of genotype scores over samples and SNPs
z3 <- snpgdsPairScore(genofile, offspring.id, father.id, snp.id=selsnp,
method="IBS", type="matrix")
str(z3)
# output the score matrix to a GDS file
snpgdsPairScore(genofile, offspring.id, father.id, snp.id=selsnp,
method="IBS", type="gds.file", output="tmp.gds")
(f <- snpgdsOpen("tmp.gds"))
snpgdsClose(f)
# close the file
snpgdsClose(genofile)
unlink("tmp.gds", force=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.