TODO
computePmatrix(pathOut, pRAIDS)vector with the info of the index associated the synthetic
group with the matrix-P
TODO
## Load the known ancestry for the demo 1KG reference profiles
data(demoKnownSuperPop1KG)
## Path to the demo Profile GDS file is located in this package
dataDir <- system.file("extdata/demoAncestryCall", package="RAIDS")
pathOut <- file.path(tempdir(), "out.tmp")
if(!dir.exists(pathOut)){
dir.create(pathOut)
}
# The name of the synthetic study
studyID <- "MYDATA"
studyDF <- data.frame(study.id=studyID,
study.desc=studyID,
study.platform="NotDef",
stringsAsFactors=FALSE)
pathProfileGDS <- file.path(dataDir) # , "ex1.gds"
fileReferenceGDS <- system.file("extdata/tests/ex1_good_small_1KG.gds", package="RAIDS")
pedStudy <- data.frame(Name.ID=c("ex1"),
Case.ID=c("ex1"),
Sample.Type=c("type"),
Diagnosis="NotDef",
Source=c("NotDef"),
stringsAsFactors=FALSE)
row.names(pedStudy) <- pedStudy$Name.ID
pRAIDS <- RAIDSparam(studyDF=studyDF,
pedStudy=pedStudy,
pathProfileGDS=pathProfileGDS,
fileReferenceGDS=fileReferenceGDS,
fieldPopInfAnc="SuperPop")
matPIndex <- RAIDS:::computePmatrix(pathOut=pathOut, pRAIDS=pRAIDS)
#> Genotype matrix: 28 samples X 61 SNPs
#> Genotype matrix: 27 samples X 61 SNPs
#> Genotype matrix: 5 samples X 61 SNPs
#> Genotype matrix: 33 samples X 61 SNPs
#> Genotype matrix: 10 samples X 61 SNPs
dir(file.path(pathOut,"matP"))
#> [1] "ex1.P.in" "ex1.syn.1.P.in" "ex1.syn.2.P.in"
o <- lapply(dir(file.path(pathOut,"matP")),
FUN=function(x,pathC){unlink(file.path(pathC,x))},
pathC = file.path(pathOut,"matP"))
unlink(file.path(pathOut,"matP"), recursive=TRUE)
unlink(file.path(pathOut), recursive=TRUE)