Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions element_interface/dandi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def upload_to_dandi(
api_key: str = None,
sync: bool = False,
existing: str = "refresh",
validation: str = "required",
shell=True, # without this param, subprocess interprets first arg as file/dir
):
"""Upload NWB files to DANDI Archive
Expand All @@ -27,6 +28,7 @@ def upload_to_dandi(
sync (str, optional): If True, delete all files in archive that are not present
in the local directory.
existing (str, optional): see full description from `dandi upload --help`
validation (str, optional): [require|skip|ignore] see full description from `dandi upload --help`
"""

working_directory = working_directory or os.path.curdir
Expand Down Expand Up @@ -84,4 +86,5 @@ def upload_to_dandi(
dandi_instance="dandi-staging" if staging else "dandi",
existing=existing,
sync=sync,
validation=validation,
)
8 changes: 8 additions & 0 deletions element_interface/run_caiman.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ def run_caiman(
parameters["fnames"] = file_paths
parameters["fr"] = sampling_rate

if "indicies" in parameters:
indices = params.pop("indicies")
indicies = slice(*indices[0]), slice(*indices[1])
parameters['motion'] = {**parameters.get('motion', {}), "indicies": indicies}
else:
indicies = None

opts = params.CNMFParams(params_dict=parameters)

c, dview, n_processes = cm.cluster.setup_cluster(
Expand All @@ -45,6 +52,7 @@ def run_caiman(
cnm = CNMF(n_processes, params=opts, dview=dview)
cnmf_output, mc_output = cnm.fit_file(
motion_correct=True,
indices=indicies,
include_eval=True,
output_dir=output_dir,
return_mc=True,
Expand Down