Skip to content
Snippets Groups Projects
Commit bdba3d42 authored by Timothe Jost's avatar Timothe Jost
Browse files

tutorial push

parent 327100ba
No related branches found
No related tags found
No related merge requests found
*.ipynb_checkpoints*
*.png
*.avi
*.mp4
*.svg
built-in-python/*
extract_preprocessed_results/*
neuropil_mapping/*
suite2p/*
\ No newline at end of file
%% Cell type:markdown id:9552f563-b67e-4312-86c6-b21b7da0bc78 tags:
# Installation of ONE-api
First, make sure one is installed. Follow the instructions here for help : https://gitlab.pasteur.fr/haisslab/data-management/ONE/-/blob/main/README.md
# Importation of ONE-api
%% Cell type:code id:39216369-eeaf-456b-acae-b1924048972c tags:
``` python
import one
```
%% Cell type:markdown id:78d21eed-c2cb-419d-a47f-19f2f5756415 tags:
# Setup the keys and passwords for the fist time :
- For ALYX_URL, enter : http://157.99.138.172:8080
If this value is already the current value, just press enter.
- For ALYX_LOGIN, enter the login that you recieved.
If no login was created for you, ask one to Timothé (timothe.jost-mousseau@pasteur.fr)
- For LOCAL_ROOT, enter the localisation where you want the temp raw data from the server to be downloaded to so that you can work on it.
(by default, it will be inside your download folder. Change it if you want it to be on a different hard drive for example.)
- Finally, keep the database cache location to default. (used for database queries cache, not raw data temp folder. Very low data usage so there is no use to move this one in a specific location.)
%% Cell type:code id:d5603f7e-46b4-4463-a21e-7d30ed28ec59 tags:
``` python
one.params.setup()
```
%% Output
Param ALYX_URL, current value is ["http://157.99.138.172:8080"]: http://157.99.138.172:8080
Param ALYX_LOGIN, current value is ["tjostmou"]: tjostmou
Param LOCAL_ROOT, current value is ["D:\LOCAL_DATA"]: D:\LOCAL_DATA
Would you like to keep the default database cache location ? [Y/n] Y
Would you like to set this URL as the default one? [Y/n] Y
Are the above settings correct? [Y/n] Y
ONE Parameter files location: C:\Users\tjostmou\AppData\Roaming\.one
IBLParams(CLIENT_MAP={'157.99.138.172_8080': 'C:\\Users\\tjostmou\\Downloads\\ONE\\157.99.138.172_8080'}, DEFAULT='157.99.138.172_8080')
%% Cell type:markdown id:3c25ff9b-de52-4cf8-88c9-c848ad822ad4 tags:
# Creating the connector object, cnx
%% Cell type:code id:27293ffb-8498-4eda-a4c9-c2f7a47ccf96 tags:
``` python
cnx = one.ONE() #et voilà !
print(cnx)
```
%% Output
One (online, http://157.99.138.172:8080)
%% Cell type:markdown id:92a5b383-85e7-46e2-9842-84991415226d tags:
### (Optionnal) Specific database address
To open the connector from a specific database location (in case of prod/dev base usage)
%% Cell type:code id:ff127144-67c9-41f3-ac8d-8f91330db4c4 tags:
``` python
cnx = one.ONE(base_url='http://157.99.138.172:8080')
```
%% Cell type:markdown id:85d8a612-b966-431c-9d42-027ddfb037e4 tags:
# Imports
%% Cell type:code id:54c58b39-8a98-4988-9fe6-0fda8868bb75 tags:
``` python
import one
```
%% Cell type:code id:d8ac09b4-7c6b-40ab-a6e8-61434a1855d2 tags:
``` python
cnx = one.ONE()
```
%% Cell type:markdown id:09d3c7ba-ece1-441d-bcd5-d6f40aff8c69 tags:
# Create a session with user interface :
#### Do it here : [http://157.99.138.172:8080/admin/actions/session/add/](http://157.99.138.172:8080/admin/actions/session/add/)
# Or : Create a session in a programmatic way :
Enter your informations below :
%% Cell type:code id:b1078a37-f46b-470b-a72d-aed5f1d3f6d1 tags:
``` python
session_short_path = r"wm25\2022-08-05\003" #following the format : two letters of the person in charge of the animal.
d = cnx.default_session_data()
d.update(cnx.get_parts_from_path(session_short_path)) # change session path here
d["users"] = ["wilsonmena"] # change user(s) here
#d["start_time"] = d["date"] + "T" + '16:31:00' # optionnal_set_date_time
d["procedures"] = ['Imaging', 'Behavior training/tasks'] # change procedures here
d["projects"] = ['Adaptation'] # change projects names here
#optionnal :
d["task_protocol"] = '' # change task protocol name here
```
%% Cell type:code id:8ec0182a-9ec8-4f77-9b84-fa25d5d742ee tags:
``` python
cnx.create_session( d )
```
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
%% Cell type:code id:38d52785-dd9e-4925-905b-0d3d3dab3ca2 tags:
``` python
```
%% Cell type:code id:d9f870bc-db29-4c14-bacb-d8e5d03e92d0 tags:
``` python
import one
import Inflow
from ResearchProjects import adaptation
from ResearchProjects.adaptation import aliases as alias
```
%% Cell type:code id:47b1ad86-ac3d-42cc-a46b-f33e3ae8a251 tags:
``` python
connector = one.ONE()
```
%% Cell type:code id:661207a3-8a5a-4125-b276-e9ba86c195dd tags:
``` python
connector.search()
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment