Skip to content

Commit

Permalink
notebook updates
Browse files Browse the repository at this point in the history
  • Loading branch information
egmcbride committed Jul 2, 2024
1 parent 3cbca16 commit 3d1e202
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
15 changes: 15 additions & 0 deletions notebooks/compute_single_unit_metrics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,24 @@
"metadata": {},
"outputs": [],
"source": [
"#get all uploaded & annotated ephys sessions\n",
"ephys_sessions=tuple(s for s in npc_lims.get_session_info(is_ephys=True, is_uploaded=True, is_annotated=True,))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#alternatively, provide a list of session ids:\n",
"session_id_list=['712815_2024-05-22','712815_2024-05-20','708016_2024-05-01']\n",
"session_list=[]\n",
"for ss in session_id_list:\n",
" session_list.append(npc_lims.get_session_info(ss))\n",
"ephys_sessions=tuple(session_list)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
24 changes: 10 additions & 14 deletions notebooks/decoding_example_egm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"metadata": {},
"outputs": [],
"source": [
"#load ephys sessions\n",
"ephys_sessions = tuple(s for s in npc_lims.get_session_info(is_ephys=True, is_uploaded=True, is_annotated=True)) #, project='DynamicRouting', project='TempletonPilotSession'))\n"
"#get all uploaded & annotated ephys sessions\n",
"ephys_sessions = tuple(s for s in npc_lims.get_session_info(is_ephys=True, is_uploaded=True, is_annotated=True))"
]
},
{
Expand All @@ -34,7 +34,13 @@
"metadata": {},
"outputs": [],
"source": [
"ephys_sessions[35]"
"#alternatively, provide a list of session ids:\n",
"session_id_list=['712815_2024-05-22','712815_2024-05-20','708016_2024-05-01']\n",
"session_list=[]\n",
"for ss in session_id_list:\n",
" session_list.append(npc_lims.get_session_info(ss))\n",
"ephys_sessions=tuple(session_list)\n",
"ephys_sessions"
]
},
{
Expand All @@ -43,7 +49,7 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"#set savepath and filename\n",
"savepath=r'\\\\allen\\programs\\mindscope\\workgroups\\templeton\\TTOC\\decoding results\\new_annotations\\linear_shift_20_units'\n",
"filename='decoding_results_linear_shift_20_units.pkl'\n",
"\n",
Expand All @@ -58,12 +64,7 @@
"decoder_time_after=0.1\n",
"\n",
"params={\n",
" # 'predict':['block_ids','cr_vs_fa','mouse_response_context'],\n",
" # 'predict':['block_ids'],\n",
" # 'trnum':'all',\n",
" # 'n_units':[5,10,20,50,100,'all'],\n",
" 'n_units':20,\n",
" # 'u_min':20,\n",
" 'n_repeats':25, \n",
" 'input_data_type':'spikes', #spikes or facemap\n",
" 'vid_angle':'face', #behavior, face, eye\n",
Expand All @@ -77,15 +78,12 @@
" 'decoder_binsize':decoder_binsize,\n",
" 'decoder_time_before':decoder_time_before,\n",
" 'decoder_time_after':decoder_time_after,\n",
" # 'balance_labels':0,\n",
" 'savepath':savepath,\n",
" 'filename':filename,\n",
" 'use_structure_probe':True,\n",
" 'crossval':'5_fold',\n",
" # 'all_areas':True,\n",
" 'labels_as_index':True,\n",
" 'decoder_type':'linearSVC', # 'linearSVC' or 'LDA' or 'RandomForest' or 'LogisticRegression'\n",
" # 'generate_labels':False,\n",
"}\n",
"\n",
"\n",
Expand All @@ -94,9 +92,7 @@
" session = DynamicRoutingSession(ephys_session.id)\n",
" print(session.id+' loaded')\n",
" if 'structure' in session.electrodes[:].columns:\n",
" # decoding_utils.decode_context_from_units(session,params)\n",
" decoding_utils.decode_context_with_linear_shift(session,params)\n",
"\n",
" else:\n",
" print('no structure column found in electrodes table, moving to next recording')\n",
" session=[]\n",
Expand Down

0 comments on commit 3d1e202

Please sign in to comment.