MouseLand / suite2p

cell detection in calcium imaging recordings
http://www.suite2p.org
GNU General Public License v3.0
334 stars 239 forks source link

BUG: data_path key is checked even if h5py is supplied #1041

Closed arielleleon closed 6 months ago

arielleleon commented 9 months ago

Describe the issue:

Hello - When an h5 file is supplied to suite2p through the run_s2p command as a list in the h5py input key, the data_path key is still checked in io.utils.find_files_open_binaries and subsequently, searches the data directory. It looks like this can be fixed by re-ordering the logic in the io.utils.find_files_open_binaries which I have created a PR for. I bring this up because in default_ops, it states that the data_path is deactivated if an h5py key is provided and I would like to be able to supply the key without out suite2p looking anywhere else. Thanks!

Reproduce the code example:

import suite2p

s2p_args = {'suite2p_version': '0.13.1', 'look_one_level_down': False, 'fast_disk': [], 'delete_bin': False, 'mesoscan': False, 'bruker': False, 'bruker_bidirectional': False, 'h5py': ['/tmp/nxf.ymdA9tRLDh/capsule/data/965980162.h5'], 'h5py_key': 'data', 'nwb_file': '', 'nwb_driver': '', 'nwb_series': '', 'save_path0': '/scratch/tmpay4zvwhe', 'save_folder': [], 'subfolders': [], 'move_bin': False, 'nplanes': 1, 'nchannels': 1, 'functional_chan': 1, 'tau': 1.0, 'fs': 10.0, 'force_sktiff': False, 'frames_include': -1, 'multiplane_parallel': False, 'ignore_flyback': [], 'preclassify': 0.0, 'save_mat': False, 'save_NWB': False, 'combined': True, 'aspect': 1.0, 'do_bidiphase': False, 'bidiphase': 0, 'bidi_corrected': False, 'do_registration': 1, 'two_step_registration': False, 'keep_movie_raw': False, 'nimg_init': 500, 'batch_size': 500, 'maxregshift': 0.2, 'align_by_chan': 1, 'reg_tif': False, 'reg_tif_chan2': False, 'subpixel': 10, 'smooth_sigma_time': 0.0, 'smooth_sigma': 1.15, 'th_badframes': 1.0, 'norm_frames': True, 'force_refImg': True, 'pad_fft': False, 'nonrigid': True, 'block_size': [128, 128], 'snr_thresh': 1.2, 'maxregshiftNR': 5, '1Preg': False, 'spatial_hp_reg': 42, 'pre_smooth': 0, 'spatial_taper': 40, 'roidetect': False, 'spikedetect': True, 'sparse_mode': True, 'spatial_scale': 0, 'connected': True, 'nbinned': 5000, 'max_iterations': 20, 'threshold_scaling': 1.0, 'max_overlap': 0.75, 'high_pass': 100, 'spatial_hp_detect': 25, 'denoise': False, 'anatomical_only': 0, 'diameter': 0, 'cellprob_threshold': 0.0, 'flow_threshold': 1.5, 'spatial_hp_cp': 0, 'pretrained_model': 'cyto', 'soma_crop': True, 'neuropil_extract': True, 'inner_neuropil_radius': 2, 'min_neuropil_pixels': 350, 'lam_percentile': 50.0, 'allow_overlap': False, 'use_builtin_classifier': False, 'classifier_path': '', 'chan2_thres': 0.65, 'baseline': 'maximin', 'win_baseline': 60.0, 'sig_baseline': 10.0, 'prctile_baseline': 8.0, 'neucoeff': 0.7, 'refImg': array([[247, 243, 263, ..., 244, 225, 254],
         [244, 251, 258, ..., 255, 245, 221],
         [241, 257, 251, ..., 258, 248, 239],
         ...,
         [268, 272, 266, ..., 191, 192, 191],
         [254, 257, 275, ..., 191, 184, 185],
         [297, 285, 263, ..., 193, 192, 185]], dtype=int16)}
suite2p.run_s2p(s2p_args)

Error message:

No error, just a note stating the following coming from the io.utils package:

NOTE: using a list of h5 files:
  ['/tmp/nxf.ymdA9tRLDh/capsule/data/965680907.h5', '/tmp/nxf.ymdA9tRLDh/capsule/data/965980162.h5']

Version information:

0.13.1

Context for the issue:

No response

arielleleon commented 9 months ago

Here is a link to the PR https://github.com/MouseLand/suite2p/pull/1042

chriski777 commented 6 months ago

Closing since this was addressed with PR #1042. Thanks @arielleleon!