if (FALSE) {
library(Rlabkey)
## uploads data to an existing assay
df <- data.frame(participantId=c(1:3), visitId = c(10,20,30), sex = c("f", "m", "f"))
bprops <- list(LabNotes="this is a simple demo")
bpl <- list(name=paste("Batch ", as.character(date())),properties=bprops)
run <- labkey.experiment.createRun(list(name="new assay run"), dataRows = df)
labkey.experiment.saveBatch(baseUrl="http://labkey/", folderPath="home",
assayConfig=list(assayName="GPAT", providerName="General"),
batchPropertyList=bpl, runList=run)
## create a non-assay backed run with samples as material inputs and outputs
m1 <- labkey.experiment.createMaterial(
list(name = "87444063.2604.626"), sampleSetName = "Study Specimens")
m2 <- labkey.experiment.createMaterial(
list(name = "87444063.2604.625"), sampleSetName = "Study Specimens")
run <- labkey.experiment.createRun(
list(name="new run"), materialInputs = m1, materialOutputs = m2)
labkey.experiment.saveBatch(baseUrl="http://labkey/", folderPath="home",
protocolName=labkey.experiment.SAMPLE_DERIVATION_PROTOCOL, runList=run)
}
Run the code above in your browser using DataLab