suite2p icon indicating copy to clipboard operation
suite2p copied to clipboard

run nwb conversion regardless of moved files

Open vickerse1 opened this issue 2 years ago • 4 comments

here is output and error:


root <class 'pynwb.file.NWBFile'> Fields: acquisition: { } analysis: { } devices: { } electrode_groups: { } epoch_tags: {} ic_electrodes: { } imaging_planes: { } lab_meta_data: { } modules: { } ogen_sites: { } stimulus: { } stimulus_template: { } time_intervals: { }

Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\suite2p\gui\menus.py", line 54, in lambda: save_nwb(get_suite2p_path(parent.basename)) File "C:\ProgramData\Anaconda3\lib\site-packages\suite2p\io\nwb.py", line 291, in save_nwb manufacturer='The best microscope manufacturer' File "C:\ProgramData\Anaconda3\lib\site-packages\hdmf\utils.py", line 386, in func_call raise_from(ExceptionType(msg), None) File "", line 3, in raise_from TypeError: unrecognized argument: 'description', unrecognized argument: 'manufacturer'

can you help?

thanks, evan

vickerse1 avatar Feb 24 '22 19:02 vickerse1

Is there a way to load an existing stat.npy and create an nwb file from the gui, or can the nwb file only be created when the data is initially processed with suite2p?

Thanks, Evan

vickerse1 avatar Mar 07 '22 18:03 vickerse1

are you using the version of pynwb that's listed in the setup.py file? is this an error in older suite2p versions? yes you can save an nwb in the File menu of the GUI but I'm guessing you would also get an error.

can you try pip install pynwb==1.4.0? that's the last version I've tested, and running it just now from the GUI with save_nwb=1 and saving from the file menu worked.

If pynwb>1.4.0 is your problem, please post this issue on the pynwb (https://github.com/NeurodataWithoutBorders/pynwb) repo because it seems they may have changed formatting. and if that's the case I'll fix the version in setup.py

carsen-stringer avatar Mar 07 '22 19:03 carsen-stringer

Hi,

I entered "pip install pynwb==1.4.0" in ipython (didnt seem to work in anaconda shell?). My previous version of pynwb was 1.0.2. When this was replaced with 1.4.0, the problem went away.

However, I had a new problem with the save directory, which appears to be suite2p looking for the path to the original analysis output directory, which no longer exists (I do runs on a GPU cluster and then post-hoc stuff on a local workstation):


(suite2p) C:\Users\McCormick Lab\Documents\Python>python -m suite2p Warning: cellpose did not import No module named 'cellpose' cannot use anatomical mode, but otherwise suite2p will run normally D:/Mesoscope_Analysis_IV_May27_2021-/E267_A1V1M2/4022_210609_E267_3_1_1_2D_HAL/suite2p_out/suite2p/plane0/stat.npy no channel 2 labels found (redcell.npy) 2.295999765396118 root pynwb.file.NWBFile at 0x2931073006616 Fields: file_create_date: [datetime.datetime(2022, 3, 7, 12, 18, 8, 501295, tzinfo=tzlocal())] identifier: /data/evicker2/suite2p_run session_description: suite2p_proc session_start_time: 2022-03-07 12:18:08.501295-08:00 timestamps_reference_time: 2022-03-07 12:18:08.501295-08:00

Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\suite2p\gui\menus.py", line 54, in lambda: save_nwb(get_suite2p_path(parent.basename)) File "C:\ProgramData\Anaconda3\lib\site-packages\suite2p\io\nwb.py", line 345, in save_nwb iscell = np.load(os.path.join(ops['save_path'], 'iscell.npy')) File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\npyio.py", line 428, in load fid = open(os_fspath(file), "rb") FileNotFoundError: [Errno 2] No such file or directory: '/data/evicker2/suite2p_out/suite2p/plane0\iscell.npy'

Is there an easy way to add an option for a user designated save directory / target directory, if those have changed?

Thanks,

Evan


From: carsen-stringer @.> Sent: Monday, March 7, 2022 11:00 AM To: MouseLand/suite2p @.> Cc: Evan Vickers @.>; Author @.> Subject: Re: [MouseLand/suite2p] just updated to current git version, save to nwb doesnt work "off the shelf" (Issue #806)

are you using the version of pynwb that's listed in the setup.py file? is this an error in older suite2p versions? yes you can save an nwb in the File menu of the GUI but I'm guessing you would also get an error.

can you try pip install pynwb==1.4.0? that's the last version I've tested, and running it just now from the GUI with save_nwb=1 and saving from the file menu worked.

If pynwb>1.4.0 is your problem, please post this issue on the pynwb (https://github.com/NeurodataWithoutBorders/pynwbhttps://urldefense.com/v3/__https://github.com/NeurodataWithoutBorders/pynwb__;!!C5qS4YX3!QVJuCOMw9wckt1IW-8Q_RfFa4YBEl_LLqc7FlhLVkvL4WZFrVZoAzuFB_XYCEE0yH-k$) repo because it seems they may have changed formatting. and if that's the case I'll fix the version in setup.py

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/MouseLand/suite2p/issues/806*issuecomment-1061024542__;Iw!!C5qS4YX3!QVJuCOMw9wckt1IW-8Q_RfFa4YBEl_LLqc7FlhLVkvL4WZFrVZoAzuFB_XYClIoXk9w$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AJGCDZXGTGIUZ4Y5CIGU5Y3U6ZG45ANCNFSM5PIH4S3A__;!!C5qS4YX3!QVJuCOMw9wckt1IW-8Q_RfFa4YBEl_LLqc7FlhLVkvL4WZFrVZoAzuFB_XYC5dSK6uQ$. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!C5qS4YX3!QVJuCOMw9wckt1IW-8Q_RfFa4YBEl_LLqc7FlhLVkvL4WZFrVZoAzuFB_XYC74FfsLE$ or Androidhttps://urldefense.com/v3/__https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!C5qS4YX3!QVJuCOMw9wckt1IW-8Q_RfFa4YBEl_LLqc7FlhLVkvL4WZFrVZoAzuFB_XYClIdD7y4$. You are receiving this because you authored the thread.Message ID: @.***>

vickerse1 avatar Mar 07 '22 20:03 vickerse1

However, I had a new problem with the save directory, which appears to be suite2p looking for the path to the original analysis output directory, which no longer exists (I do runs on a GPU cluster and then post-hoc stuff on a local workstation)

Maybe as a workaround, you could borrow some ideas from this test fixture, which seems to do something close to what you want, i.e.:

  1. loading the ops.npy file,
  2. updating the save_path with some other path,
  3. saving the updated ops.npy file.

kir0ul avatar Jun 11 '22 04:06 kir0ul

I think this should be fixed now but let me know if not

carsen-stringer avatar May 14 '23 02:05 carsen-stringer

(there were some changes in NWB formatting last year)

carsen-stringer avatar May 14 '23 02:05 carsen-stringer