Open gmaggi opened 3 years ago
Hi Giuliano,
Great to hear you are interested in Alyx! Not certain I fully understood the question but here is my best shot.
The "on server" server field has a specific role for when you have multiple individual labs that want to merge their data on a single central server. This is what happens in IBL but I imagine not in your case. So I think it is fine for the field to remain unset.
It should be possible to link the dataset to a session even without the "on server" field set. Has this been a problem?
Does the client have access to the NAS? In this case it should be straightforward. If the client does not have access to the NAS, you need to set up some other means of getting the data to the client (eg http server), which is more complicated.
We are currently updating the ONE libraries, and this would be a great test case! So please stay in touch and we will make sure it works.
Hi Kenneth,
Thanks for the explanation!
What we pursue in a first stage is:
Alyx
as "Data repository" by providing the WebDAV URL link (in the future we might use Globus). Subsequently, users can create the session with the correspond metadataHow I do so far:
subject
in "COMMON -> Subjects", then I create a session
associated to this subject. However, I can no add dataset information, see attachment. do I miss something here?. It seems is does not give the option to select a dataset.Thanks, Giuliano.
OK I see! I think these things will all be much easier using the REST endpoints - you can add files programatically straight from the recording software and it will take care of all of this for you. I'm not the best person to explain though, @k1o0 could you take this?
Hi Giuliano,
As Kenneth mentioned, adding datasets is much more easily done through REST. We have endpoints for creating sessions and registering files, but first I'll go over the workflow for linking everything together. The first four steps are done through the web browser and only need to be done once per subject/dataset type etc.
*log.raw*
When you register a file such as _rig1_log.raw.txt
or log.raw.rtf
it will automatically be part of the 'raw log' dataset type. The main purpose of this is to use the dataset type description field to document what the files are and how to work with them. When registering files they must match exactly 1 dataset type.mouse1/2021-05-27/001/log.raw.rtf
. Using the /register-file endpoint, the files will be associated to the correct session based on this folder structure.You can make REST queries through the MATLAB API and Python. The important thing is to register the files after you've created the subject and session, otherwise they may not be linked to the correct meta data.
I hope that helps!
Hi @k1o0 and @kdharris101 , thank you the feedback!
I've followed the steps indicated above by @k1o0 . However, I cannot manage to set "Data->Datasets" as "on server", actually, when I select the option "add dataset", the "on server" option is always disabled. See attachment.
I wonder if I am missing something in the settings, the only thing I've changed so far to make it work with our resources is the ALLOWED_HOSTS in alyx/alyx/settings_lab.py
:
from textwrap import dedent
# ALYX-SPECIFIC
ALLOWED_HOSTS = ['nerfsql01vm']
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'GB'
GLOBUS_CLIENT_ID = '525cc517-8ccb-4d11-8036-af332da5eafd'
SUBJECT_REQUEST_EMAIL_FROM = 'alyx-noreply@cortexlab.net'
DEFAULT_SOURCE = 'Cruciform BSU'
DEFAULT_PROTOCOL = '1'
SUPERUSERS = ('root',)
STOCK_MANAGERS = ('charu',)
WEIGHT_THRESHOLD = 0.75
DEFAULT_LAB_NAME = 'cortexlab'
DEFAULT_LAB_PK = '4027da48-7be3-43ec-a222-f75dffe36872'
SESSION_REPO_URL = \
"http://ibl.flatironinstitute.org/{lab}/Subjects/{subject}/{date}/{number:03d}/"
NARRATIVE_TEMPLATES = {
'Headplate implant': dedent('''
== General ==
...
could you give me an extra hand with this please?
There are two models: datasets and dataset types. In step 3 above it's the dataset types that we add through the admin interface. The datasets themselves are registered through REST. The on_server field is calculated, so you can't manually set it. A dataset is shown as online if one of the associated file records has an exist field that is set to true and is on a data repository that has a non null url field.
Hi k1o0,
I have installed Alyx as a local database and trying to use it to store my own data and possibly extending it even further for the entire lab. I've ran into the same issue as described here that I am unable to register my files. I cannot associate a dataset with a session. I follow steps 1 to 5 as you outlined. However, I cannot pass through step 6. Matlab REST API appears to be nonfunctioning and I raised an issue here https://github.com/cortex-lab/alyx-matlab/issues/80 Now I am trying to use the python interface but am not able to create an AlyxClient object. Executing code
from one.webclient import AlyxClient
alyx = AlyxClient(base_url='http://localhost:8000/admin', username='admin', password='admin', cache_dir=None, silent=False, cache_rest='GET')
Gives the following error:
$ /home/user/anaconda3/envs/iblenv/bin/python alyxRegisterFiles.py
Traceback (most recent call last):
File "alyxRegisterFiles.py", line 3, in <module>
alyx = AlyxClient(base_url='http://localhost:8000/admin', username='admin', password='admin', cache_dir=None, silent=False, cache_rest='GET')
File "/home/user/anaconda3/envs/iblenv/lib/python3.10/site-packages/one/webclient.py", line 502, in __init__
self.authenticate(username, password)
File "/home/user/anaconda3/envs/iblenv/lib/python3.10/site-packages/one/webclient.py", line 630, in authenticate
rep.raise_for_status()
File "/home/user/anaconda3/envs/iblenv/lib/python3.10/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://localhost:8000/admin/auth-token
What is a correct way to set up AlyxClient?
Also a related issue. I think having a tutorial on how to upload files onto the Alyx database using the graphical interface would really be useful for new people trying to adopt Alyx for their data management. The existing documentations assume a high level of familiarity with the Alyx database already which, seems to me, would prevent its widespread adoption.
Registering files worked after correcting base_url to base_url='http://localhost:8000'
Hi, yes the 'admin' part of the URL refers to the admin interface, which is for browsing and editing the database in the browser. Just use the root URL for REST requests through ONE and alyx-matlab
Also a related issue. I think having a tutorial on how to upload files onto the Alyx database using the graphical interface would really be useful for new people trying to adopt Alyx for their data management. The existing documentations assume a high level of familiarity with the Alyx database already which, seems to me, would prevent its widespread adoption.
Unfortunately we don't have a system for registering files through the admin interface. You can do it but it would be incredibly arduous. It's better to the use register-file
endpoint. Endpoint documentation can be found here. You can use the registration module in the ONE-API or the registerFile method of alyx-matlab.
Thanks for a quick reply. I have also submitted a related issue on https://github.com/int-brain-lab/iblenv/issues/305 I suspect I am doing something wrong but I'm not exactly sure. But again this comes back to the issue of being able to enter all the required info in the Alyx database correctly, which is difficult without a tutorial.
Hi,
I am starting to get familiar with Alyx (and ONE) to promote its usage in my institution (a neuroscience lab). I managed to install it in a server and enable the apache service, all is fine so far. What I am trying to do is the following:
Could you give me some guidance with this please?
Thanks, Giuliano.