list_experiments: List experiments

Description Usage Arguments Details Value openBIS See Also Examples

Description

Experiments can be represented by two object classes: Experiment and ExperimentIdentifier. The fields that make up an ExperimentIdentifier object are a subset of those required for an Experiment object. Therefore an experiment can be turned into an experiment id object without an API call, using the function as_experiment_id(). The reverse can be achieved by calling list_experiments() on experiment id objects. In general, experiments and experiment id objects can be listed using list_experiments() and list_experiment_ids().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
list_experiments(token, x, ...)

## S3 method for class 'ExperimentIdentifier'
list_experiments(token, x, ...)

## S3 method for class 'Project'
list_experiments(token, x,
  types = list_experiment_types(token), require = c(NA, "DataSets",
  "Samples"), ...)

list_experiment_ids(token, ...)

list_experiment_types(token, ...)

as_experiment_id(x, ...)

## S3 method for class 'Experiment'
as_experiment_id(x, ...)

## S3 method for class 'ExperimentIdentifier'
as_experiment_id(x, ...)

Arguments

token

Login token as created by login_openbis().

x

Object to limit the number of returned experiments, e.g. a set of ExperimentIdentifier or Project objects.

...

Generic compatibility. Extra arguments will be passed to make_requests().

types

Either a single or set of ExperimentType objects

require

A switch to require the resulting experiments to contain a nonzero number of dataset or sample. Default behavior is no requirement.

Details

By calling list_experiments() on project objects, all corresponding experiments are listed. It is possible to limit the search to experiments that are of a certain type and exclude experiments that either have no datasets or samples associated. An exhaustive list of realized experiment types can be retrieved using list_experiment_types(). If several experiment types are requested in list_experiments(), the default is to iterate over all available types, an API call per experiment type has to be made.

ExperimentIdentifier objects present a more compact way of uniquely representing experiments. All experiments that are available to the current user can be listed with list_experiment_ids(). There is no way of limiting the search for experiments.

Value

Depending on the number of resulting objects, either a json_class (single object) or a json_vec (multiple objects), is returned. Experiments are represented by Experiment, experiment ids by ExperimentIdentifier and experiment types by ExperimentType objects.

openBIS

See Also

Other object listing functions: list_datasets, list_material, list_plates, list_projects, list_samples

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  tok <- login_openbis()

  # list all available projects to limit the search for experiments
  proj <- list_projects(tok)

  # list all experiments corresponding to the project with index 1
  exps <- list_experiments(tok, proj[[1L]])

  # convert experiment to experiment ids and back
  exp_ids <- as_experiment_id(exps)
  identical(exps, list_experiments(tok, exp_ids))

  # experiments can also be searched for
  exp <- search_openbis(tok,
                        search_criteria(
                          attribute_clause("code",
                                           get_field(exps[[1L]],
                                                     "identifier"))
                        ),
                        target_object = "experiment")
  identical(exps[[1L]], exp)

  logout_openbis(tok)

ropensci/infx documentation built on May 9, 2019, 7:36 p.m.