Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
Tools For Analysis Of Data Stored In Openbis
====
## Jupyter Notebooks
[](# "Print this article")
Jupyter notebooks are web applications that combine text, code and
output ([https://jupyter.org/](https://jupyter.org/)). Jupyter supports
over 40 programming languages.
Jupyter notebooks can be used to analyze data stored in openBIS.
It is possible to connect to a JupyterHub server and launch Jupyter
notebooks directly from the openBIS interface. This feature is not
available by default, but needs to be enabled and configured by a
*system admin*. JupyterHub docker containers are available from our
download page: [openBIS
download.](https://wiki-bsse.ethz.ch/display/bis/openBIS+Download+Page)
Further documentation can be found here: [JupyterHub for
openBIS](https://unlimited.ethz.ch/display/openBISDoc2010/JupyterHub+for+openBIS)
### How to use Jupyter notebooks from openBIS
Jupyter notebooks can be opened at every level of the openBIS hierarchy
(*Space, Project, Experiment/Collection, Object, Dataset*) from the
**More…** dropdown menu, as shown below.

If you get a similar error as the one shown below when you try to launch
a notebook from an entity, you need to start the JupyterHub server by
going to the main menu **Utilities** -> **Jupyter Workspace**. This
error appears when the JupyterHub server is restarted (e.g. after an
upgrade), because the user profile needs to be recreated.

If you go to the Jupyter workspace, the user profile is re-created on
the server. After this, you can open a notebook from any entity of the
openBIS hierarchy as explained above (*Space, Project,
Experiment/Collection, Object, Dataset*).
Jupyter notebooks can also be launched from the main menu, under
**Utilities**, as shown below.

**Note**: if you use SSO for authentication (eg. Switch aai), the first
time you want to work with a Jupyter notebook, you first need to open
the **Jupyter Workspace** and then launch a notebook from wherever you
want to open it.
When you launch a notebook from the **New Jupyter Notebook** in the main
menu under **Utilities**, it is necessary to enter:
1. The **dataset(s)** needed for the analysis.
2. The **owner** of the Jupyter notebook. Jupyter notebooks are saved
back to openBIS as datasets, and these belong either to an
*Experiment/Collection* or to an *Object*. The owner is the
*Experiment/Collection* or *Object* where the notebook should be
stored.
3. The **directory name**. This is the name of the folder that will be
created on the JupyterHub server.
4. **Notebook name**. This is the name of the Jupyter notebook.

Jupyter notebooks can also be opened from a *Project*, *Experiment*,
*Experimental Step* choosing the corresponding option in the **More**
drop down menu. When opening notebooks from an *Experiment* or
*Experimental Step*, all connected datasets are automatically selected.
If some are not needed, they can be deselected.
### Overview of Jupyter notebook opened from openBIS.
The Jupyter notebooks running on the JupyterHub server for openBIS
support the following kernels: *Bash, Octave, Python 2, Python 3, R,
SoS* ([Script of Scripts).](https://vatlab.github.io/sos-docs/)
When you open a Jupyter notebook from openBIS, the default kernel used
is Python 3, but you can change to another language as shown below.

The Jupyter notebook opened from the openBIS interface contains some
pre-filled cells. All cells need to be run. The information of two cells
should be modified: **Name of the dataset** where the notebook will be
stored and **Notes** (in red below).

If you are running a JupyterHub version released after July 2021
(available at
[https://hub.docker.com/u/openbis](https://hub.docker.com/u/openbis))
you do not need to enter username and password, as authentication uses
the openBIS session token.
#### What to do in case of invalid session token
If your session token is not automatically renewed you will see a long
error message when you try to retrieve information of a dataset. At the
bottom of the error message you can see:

In such case, the session token can be manually entered in the cell as
shown below:

The session token can be copied from the **User Profile** under the
**Utilities** Main Menu in the ELN.
Enter the session token, run the cell above and then move to the next
cell to get the dataset(s) information.
Alternatively you can go to the Jupyter Workspace under **Utilities**
and restart the server.
Your script should be written in the section named *Process your data
here*, that contains one empty cell (see below). You can, of course, add
additional cells.

After the analysis is done, the notebook can be saved back to openBIS,
by running the last few cells which contain the information about where
the notebook will be stored (as shown below).

The last pre-filled cell in the notebook, contains the information on
where to upload the Jupyter notebook in openBIS. After you run this
cell, you can go back to the ELN interface, refresh the webpage and you
will see your Jupyter notebook uploaded to the Object or Experiment you
specified. By default the Jupyter notebook are save to datasets of type
ANALYSIS\_NOTEBOOK. If you prefer to use a different type, you can edit
the pre-filled cell shown above.
### Using a local Jupyter installation with openBIS
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
It is also possible to use a local Jupyter installation with openBIS. In
this case, it is possible to download an extension for JupyterLab that
adds 3 buttons to a default notebook:
1. connect to an openBIS instance;
2. download datasets from the openBIS instance;
3. upload the notebook to openBIS.

The JupyterLab openBIS extension is available from: [JupyterLab openBIS
extension](https://www.npmjs.com/package/jupyterlab-openbis)
Updated on April 25, 2023
## MATLAB toolbox
[](# "Print this article")
The MATLAB toolbox for openBIS allows to access data stored in openBIS
directly from MATALB. Full documentation can be found here: [MATLAB
API](https://openbis.readthedocs.io/en/latest/software-developer-documentation/apis/matlab-v3-api.html)