List of useful one queries

from one.api import ONE
one = ONE(base_url='', silent=True)

Query session for several subjects

subjects = ['DY_003', 'DY_006']
ses ='sessions', 'list', django=f"subject__nickname__in,{subjects}")

Query sessions that have histology available

ses ='sessions', 'list', histology=True)
# the generic way
ses ='sessions', 'list',

Query sessions that do not have matlab in the project name

ses ='sessions', 'list', django='~project__name__icontains,matlab')

Query sessions that do not contain a given dataset type

ses ='sessions', 'list',

Query all sessions not labelled as CRITICAL

ses ='sessions', 'list', django='qc__lt,50')

Query probe insertions for a given task protocol

ins ='insertions', 'list', django='session__task_protocol__icontains,choiceworld')

Query trajectories with channels in given brain region

trajs ='trajectories', 'list', django='channels__brain_region__name__icontains,'
                                                     'Entorhinal area medial part dorsal zone '
                                                     'layer 2')

Query spikesorting tasks that have errored in angelaki lab

errored ='tasks', 'list', status='Errored', lab='angelakilab',

Query ephys sessions that have errored tasks

ses ='sessions', 'list', task_protocol='ephys', django='tasks__status,40')

Query insertions that have alignment resolved

ins ='insertions', 'list', django='json__extended_qc__alignment_resolved,True')

Get names of users who have aligned specified insertion

names ='trajectories', 'list', provenance='Ephys aligned histology track',

List all sessions which any video QC set

keys = ('videoLeft', 'videoRight', 'videoBody')
ses ='sessions', 'list', django=f'extended_qc__has_any_keys,{keys}')

List all weighings for a given date

date = '2021-02-05'
weighings ='weighings', 'list', django=f'date_time__date,{date}')