diff --git a/object/OpenBis.m b/object/OpenBis.m index 03093653bd2fff29a3f81bfc34200df28ed8c686..657828fdf7a30411840f543b623c71444401fae5 100644 --- a/object/OpenBis.m +++ b/object/OpenBis.m @@ -193,6 +193,7 @@ classdef OpenBis % get_objects % new_object % delete_object + function object = get_object(obj, id) % Return object (sample) corresponding to the id % ID can be either the Space + Object code (e.g. /SPACE/123456789) or the PermID (e.g. 20181002164551373-1234) @@ -230,6 +231,30 @@ classdef OpenBis end + %% Experiment methods + % this section defines the following Matlab methods: + % get_experiments + + function experiments = get_experiments(obj, varargin) + space = ''; + type = ''; + project = ''; + %tag = '*'; % currently only 1 tag can be specified + + p = inputParser; + addRequired(p, 'obj'); + addParameter(p, 'space', space, @ischar); + addParameter(p, 'type', type, @ischar); + addParameter(p, 'project', project, @ischar); +% addParameter(p, 'tag', tag); + parse(p, obj, varargin{:}); + a = p.Results; + + experiments = obj.pybis.get_experiments(pyargs('space', a.space, 'type', a.type, 'project', a.project)); + experiments = df_to_table(experiments.df); + end + + %% Dataset methods % this section defines following Matlab methods: % get_datasets diff --git a/pybis_example.ipynb b/pybis_example.ipynb index 458df4027d63b66e1a853b167c92df0edc996098..382d053f059758e064aed9cb325b53f3949dcbb8 100644 --- a/pybis_example.ipynb +++ b/pybis_example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -30,17 +30,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdin", - "output_type": "stream", - "text": [ - " 路路路路路路路路路路路路路路路路路路路路路\n" - ] - } - ], + "outputs": [], "source": [ "username = 'hluetcke'\n", "pw = getpass.getpass()" @@ -48,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -58,40 +50,18 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'hluetcke-181106131140777x0D8760E91A8250DDB699A8762B00EC9D'" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "o.token" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "o.is_session_active()" ] @@ -202,7 +172,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -211,17 +181,9 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Sample 20181106132848572-9284 successfully deleted.\n" - ] - } - ], + "outputs": [], "source": [ "sample.delete('just a test')" ]