library(GWASdata)
dbpath <- tempfile()
scanAnnot <- ScanAnnotationSQLite(dbpath)
data(illumina_scan_annot)
writeAnnotation(scanAnnot, illumina_scan_annot)
# list columns
vars <- getVariableNames(scanAnnot)
# add metadata
metadf <- data.frame(varname=vars, description=rep(NA, length(vars)),
row.names=vars, stringsAsFactors=FALSE)
metadf["scanID", "description"] <- "unique id"
writeMetadata(scanAnnot, metadf)
scanID <- getScanID(scanAnnot)
sex <- getSex(scanAnnot)
if (hasVariable(scanAnnot, "plate")) plate <- getVariable(scanAnnot, "plate")
subjectID <- getVariable(scanAnnot, "subjectID", condition="WHERE sex='M'")
# display data
head(getAnnotation(scanAnnot))
getMetadata(scanAnnot)
close(scanAnnot)
file.remove(dbpath)
Run the code above in your browser using DataLab