kymata-atlas / kymata-core

Core Kymata codebase, including statistical analysis and plotting tools
https://kymata.org
MIT License
5 stars 0 forks source link

Running plotting with brain maps no longer works since move to kymata-core #323

Open neukym opened 1 month ago

neukym commented 1 month ago

I don't understand where it is getting /kymata-toolbox/kymata-toolbox-data from! It specifically says: "Data root set at /Users/administration/Github/kymata-core/kymata-core-data". And it is nowhere in the code. It must be an environmental flag somewhere?

/Users/administration/Github/kymata-core/.venv/bin/python /Users/administration/Github/kymata-core/invokers/invoker_run_nkg_plotting.py 
Traceback (most recent call last):
  File "/Users/administration/Github/kymata-core/invokers/invoker_run_nkg_plotting.py", line 119, in <module>
    main()
  File "/Users/administration/Github/kymata-core/invokers/invoker_run_nkg_plotting.py", line 20, in main
    fig = expression_plot(expression_data, color = {
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/administration/Github/kymata-core/kymata/plot/plot.py", line 524, in expression_plot
    _plot_minimap_hexel(expression_set,
  File "/Users/administration/Github/kymata-core/kymata/plot/plot.py", line 228, in _plot_minimap_hexel
    fsaverage = FSAverageDataset(download=True)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/administration/Github/kymata-core/kymata/datasets/fsaverage.py", line 26, in __init__
    super().__init__(
  File "/Users/administration/Github/kymata-core/kymata/datasets/sample.py", line 38, in __init__
    self.download()
  File "/Users/administration/Github/kymata-core/kymata/datasets/fsaverage.py", line 37, in download
    _dir = fetch_fsaverage(subjects_dir=str(self.path), verbose=__debug__)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<decorator-gen-341>", line 10, in fetch_fsaverage
  File "/Users/administration/Github/kymata-core/.venv/lib/python3.11/site-packages/mne/datasets/_fsaverage/base.py", line 67, in fetch_fsaverage
    subjects_dir = _set_montage_coreg_path(subjects_dir)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/administration/Github/kymata-core/.venv/lib/python3.11/site-packages/mne/datasets/_fsaverage/base.py", line 130, in _set_montage_coreg_path
    old_subjects_dir = get_subjects_dir(None, raise_error=False)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/administration/Github/kymata-core/.venv/lib/python3.11/site-packages/mne/utils/config.py", line 474, in get_subjects_dir
    subjects_dir = _check_fname(
                   ^^^^^^^^^^^^^
  File "<decorator-gen-0>", line 12, in _check_fname
  File "/Users/administration/Github/kymata-core/.venv/lib/python3.11/site-packages/mne/utils/check.py", line 280, in _check_fname
    raise FileNotFoundError(f'{name} does not exist: "{fname}"')
FileNotFoundError: subjects_dir does not exist: "/Users/administration/Github/kymata-toolbox/kymata-toolbox-data/tutorial_nkg_data/fsaverage"
Data root set at /Users/administration/Github/kymata-core/kymata-core-data.
Consider setting this as environmental variable KYMATA_DATA_ROOT to ensure it's reused next time.
Hint: $> KYMATA_DATA_ROOT="/Users/administration/Github/kymata-core/kymata-core-data"
Downloading dataset: fsaverage

Process finished with exit code 1
neukym commented 1 month ago

OK, it is stored in $HOME/.mne/mne-python.json - @caiw can we talk about if this is a good idea?

{
"MNE_BROWSE_RAW_SIZE": "8.0,8.0",
"MNE_DATASETS_SAMPLE_PATH": "/Users/administration/mne_data",
"SUBJECTS_DIR": "/Users/administration/Github/kymata-toolbox/kymata-toolbox-data/tutorial_nkg_data/fsaverage"
}
caiw commented 1 month ago

Hah, I just got this error too.

caiw commented 1 month ago

I think using SUBJECTS_DIR may be a requirement of MNE if we want to use MNE for plotting... but where is that config file created? We didn't do it...