View source: R/labkey.experiment.R
labkey.experiment.saveBatch | R Documentation |
Saves a modified experiment batch.
labkey.experiment.saveBatch(baseUrl=NULL, folderPath,
assayConfig = NULL, protocolName = NULL,
batchPropertyList = NULL, runList)
baseUrl |
(optional) a string specifying the |
folderPath |
a string specifying the |
assayConfig |
(optional) a list specifying assay configuration information |
protocolName |
(optional) a string specifying the protocol name of the protocol to use |
batchPropertyList |
(optional) a list of batch properties |
runList |
a list of experiment run objects |
Saves a modified batch. Runs within the batch may refer to existing data and material objects, either inputs or outputs, by ID or LSID. Runs may also define new data and materials objects by not specifying an ID or LSID in their properties.
Runs can be created for either assay or non-assay backed protocols. For an assay backed protocol, either the assayId or the assayName and providerName name must be specified in the assayConfig parameter. If a non-assay backed protocol is to be used, specify the protocolName string value, note that currently only the simple : labkey.experiment.SAMPLE_DERIVATION_PROTOCOL is supported.
Refer to the labkey.experiment.createData, labkey.experiment.createMaterial, and labkey.experiment.createRun helper functions to assemble the data structure that saveBatch expects.
Returns the object representation of the experiment batch.
Karl Lum
labkey.experiment.createData
,
labkey.experiment.createMaterial
,
labkey.experiment.createRun
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.