@@ -198,3 +198,43 @@ labkey.experiment.saveRuns <- function(baseUrl=NULL, folderPath, protocolName, r
198198
199199 return (fromJSON(response , simplifyVector = FALSE , simplifyDataFrame = FALSE ))
200200}
201+
202+ # # Get lineage parent/child relationships and information for exp objects by LSID(s)
203+ # #
204+ # # Optional parameters (passed via options) include:
205+ # # parents: (boolean) include parent objects in the lineage
206+ # # children: (boolean) include child objects in the lineage
207+ # # depth: (integer) the depth of the lineage to retrieve
208+ # # expType: the type of experiment objects to retrieve lineage for
209+ # # cpasType: the type of CPAS object to retrieve lineage for
210+ # # runProtocolLsid: the LSID of the run protocol to retrieve lineage for
211+ # # includeProperties: (boolean) include properties in the lineage response
212+ # # includeInputsAndOutputs: (boolean) include inputs and outputs in the lineage response
213+ # # includeRunSteps: (boolean) include run steps in the lineage response
214+ # #
215+ labkey.experiment.lineage <- function (baseUrl = NULL , folderPath , lsids , options = NULL )
216+ {
217+ baseUrl = labkey.getBaseUrl(baseUrl )
218+
219+ # # check required parameters
220+ if (missing(folderPath ))
221+ stop (paste(" A value must be specified for folderPath." ))
222+ if (missing(lsids ))
223+ stop (paste(" A value must be specified for lsids." ))
224+ if (! missing(lsids ) & ! (is.vector(lsids ) && is.atomic(lsids )))
225+ stop (paste(" The lsids parameter must be a vector data structure." ))
226+ if (! missing(options ) & ! is.list(options ))
227+ stop (paste(" The options parameter must be a list data structure." ))
228+
229+ params <- list (lsids = lsids )
230+ if (! missing(options ))
231+ params <- c(params , options )
232+
233+ # # normalize the folder path
234+ folderPath <- encodeFolderPath(folderPath )
235+
236+ url <- paste(baseUrl , " experiment" , folderPath , " lineage.api" , sep = " " )
237+ response <- labkey.post(url , toJSON(params , auto_unbox = TRUE ))
238+
239+ return (fromJSON(response , simplifyVector = FALSE , simplifyDataFrame = FALSE ))
240+ }
0 commit comments