# first set
snp1 <- data.frame(snpID=1:10, chromosome=1L, position=101:110,
rsID=paste("rs", 101:110, sep=""),
alleleA="A", alleleB="G", stringsAsFactors=FALSE)
scan1 <- data.frame(scanID=1:3, subjectID=c("A","B","C"), sex="F", stringsAsFactors=FALSE)
mgr <- MatrixGenotypeReader(genotype=matrix(c(0,1,2), ncol=3, nrow=10), snpID=snp1$snpID,
chromosome=snp1$chromosome, position=snp1$position, scanID=1:3)
genoData1 <- GenotypeData(mgr, snpAnnot=SnpAnnotationDataFrame(snp1),
scanAnnot=ScanAnnotationDataFrame(scan1))
# second set
snp2 <- data.frame(snpID=1:5, chromosome=1L,
position=as.integer(c(101,103,105,107,107)),
rsID=c("rs101", "rs103", "rs105", "rs107", "rsXXX"),
alleleA= c("A","C","G","A","A"),
alleleB=c("G","T","A","G","G"),
stringsAsFactors=FALSE)
scan2 <- data.frame(scanID=1:3, subjectID=c("A","C","C"), sex="F", stringsAsFactors=FALSE)
mgr <- MatrixGenotypeReader(genotype=matrix(c(1,2,0), ncol=3, nrow=5), snpID=snp2$snpID,
chromosome=snp2$chromosome, position=snp2$position, scanID=1:3)
genoData2 <- GenotypeData(mgr, snpAnnot=SnpAnnotationDataFrame(snp2),
scanAnnot=ScanAnnotationDataFrame(scan2))
duplicateDiscordanceAcrossDatasets(genoData1, genoData2,
match.snps.on="position",
subjName.cols="subjectID")
duplicateDiscordanceAcrossDatasets(genoData1, genoData2,
match.snps.on=c("position", "alleles"),
subjName.cols="subjectID")
duplicateDiscordanceAcrossDatasets(genoData1, genoData2,
match.snps.on=c("position", "alleles", "name"),
subjName.cols="subjectID",
snpName.cols="rsID")
duplicateDiscordanceAcrossDatasets(genoData1, genoData2,
subjName.cols="subjectID",
one.pair.per.subj=FALSE)
minorAlleleDetectionAccuracy(genoData1, genoData2,
subjName.cols="subjectID")
dupDosageCorAcrossDatasets(genoData1, genoData2,
scan.exclude2=scan2$scanID[duplicated(scan2$subjectID)])
Run the code above in your browser using DataLab