# NOT RUN {
################
# Run prepareEnv
################
#Without calculating population structure.
prepareEnv(envFile=system.file("extdata", "uganda-subset-env.csv", package = "R.SamBada"),
outputFile=file.path(tempdir(),'uganda-subset-env-export.csv'), maxCorr=0.8,
numPc=0, idName='short_name', x='longitude',y='latitude', locationProj=4326,
interactiveChecks = FALSE)
# }
# NOT RUN {
# While it is not mandatory to provide gdsFile, it is recommended to define it so that IDs
# in envrionmental and genomic file are in the same order (gdsFile also needed to compute
# population structure)
# determine gdsFile according to OS
if(Sys.info()['sysname']=='Windows'){
gdsFile="uganda-subset-mol_windows.gds"
} else {
gdsFile="uganda-subset-mol_unix.gds"
}
#Calculating PCA-based population structure
prepareEnv(envFile=system.file("extdata", "uganda-subset-env.csv", package = "R.SamBada"),
outputFile=file.path(tempdir(),'uganda-subset-env-export.csv'), maxCorr=0.8,
idName='short_name', genoFile=system.file("extdata", gdsFile, package = "R.SamBada"),
numPc=0.2, mafThresh=0.05, missingnessThresh=0.1, ldThresh=0.2, numPop=NULL,
x='longitude', y='latitude', locationProj=4326, interactiveChecks = TRUE)
#Calculating structure membership coefficient based on kmeans clustering
prepareEnv(envFile=system.file("extdata", "uganda-subset-env.csv", package = "R.SamBada"),
outputFile=file.path(tempdir(),'uganda-subset-env-export.csv'), maxCorr=0.8,
idName='short_name', genoFile=system.file("extdata", gdsFile, package = "R.SamBada"),
numPc=0.2, mafThresh=0.05, missingnessThresh=0.1, ldThresh=0.2, numPop=NULL,
x='longitude', y='latitude', locationProj=4326, interactiveChecks = TRUE)
# }
Run the code above in your browser using DataLab