Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'extra_metadata' when running 'setup_puncta_analysis.jpynb' #37

Open
ginger830617 opened this issue Apr 23, 2024 · 1 comment

Comments

@ginger830617
Copy link

🐛 Bug

KeyError: 'extra_metadata' when running 'setup_puncta_analysis.jpynb'

To Reproduce

Steps to reproduce the behavior:

  1. Install punctatols via conda create -n python=3.8 (packages are installed individually to get rid of bioformat error).
  2. Image converted via option 2 (run macro in Fiji).
  3. Try to run through 'setup_puncta_analysis.jpynb', and then key error 'extra_metadata' cannot be resolved.

(punctatools) u2173688@01-G3-80424-21 ~ % python
Python 3.8.18 (default, Sep 11 2023, 08:17:33)
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

import json
import os
import numpy as np
import intake_io
from skimage.feature import blob_log
from skimage.segmentation import watershed
from scipy import ndimage
import pylab as plt
from am_utils.utils import walk_dir
from punctatools.lib.segment import calculate_background_image, centers_to_markers, threshold_puncta, filter_laplace
from punctatools.lib.utils import show_dataset, show_imgs, display_blobs
from punctatools.lib.utils import crop_dataset, convert_params
input_dir = "/Users/u2173688/Desktop/input/test/DM4_a"
roi_segmentation = False
output_dir = "/Users/u2173688/Desktop/puncta_analysis"
print(rf"Input directory: {input_dir}")
Input directory: /Users/u2173688/Desktop/input/test/DM4_a
if not roi_segmentation:
... print('No cell segmentation provided')
...
No cell segmentation provided
samples = walk_dir(input_dir)
print(f'\n{len(samples)} images were found:')

1 images were found:

for i in range(len(samples)):
... print(i, samples[i])
...
0 /Users/u2173688/Desktop/input/test/DM4_a/DM4_a_test.tif
sample_index = 0
if sample_index is None:
... sample_index = np.random.randint(len(samples))
...
sample = samples[sample_index]
dataset = intake_io.imload(sample)
Traceback (most recent call last):
File "", line 1, in
File "/Users/u2173688/miniconda3/envs/punctatools/lib/python3.8/site-packages/intake_io/io.py", line 62, in imload
with _autodetect(uri, **kwargs) as src:
File "/Users/u2173688/miniconda3/envs/punctatools/lib/python3.8/site-packages/intake/source/base.py", line 245, in enter
self._load_metadata()
File "/Users/u2173688/miniconda3/envs/punctatools/lib/python3.8/site-packages/intake/source/base.py", line 88, in _load_metadata
self.metadata.update(self._schema.extra_metadata)
File "/Users/u2173688/miniconda3/envs/punctatools/lib/python3.8/site-packages/intake/source/base.py", line 18, in getattr
return self[item]
KeyError: 'extra_metadata'

Expected behavior

Expected to running through 'setup_puncta_analysis.jpynb'

Environment

  • Operation System: Zsh on osx-64 Mac
  • conda version (conda --version): conda 24.1.2
  • pip version (pip --version): pip 23.3.1
  • punctatools version: 0.2.0

Additional context

Could I ask if anyone has any idea to figure out this issue, please?

@Louison5
Copy link

Louison5 commented Nov 21, 2024

Hey, I think downgrading the library "intake" to 0.7.0 works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants