Wrong mode in MrcParser with MRC density map file
Closed this issue · 12 comments
Hi all,
When I try to run the script below in jupyterlab, the MRC file wasn't loaded and the browser console displays the following error message:
MrcParser unknown mode 1010723949 664.8a35b9da8e921c96bddb.js:2:1362848
STAGE LOG error loading file: 'TypeError: r[a[1]] is undefined' 664.8a35b9da8e921c96bddb.js:2:1109224
Uncaught (in promise) error loading file: 'TypeError: r[a[1]] is undefined' 49.13801d0d3acfe1244269.js:1:80728
- I checked with the Python package
mrcfile
and the file is correctly read with a MRC mode of 2 (float32) - I tried with a swap-byte file but the error message is the same (wrong mode).
- I reproduced the error with other MRC files (downloaded from the EMDB databank).
Thanks in advance, Jean-Christophe.
Here is the script:
import nglview as nv
view = nv.NGLWidget()
# Parameters of viewport
view.background = '#333'
view.parameters = {'clip_near': 0, 'clip_far': 10000}
# https://scipion.cnb.csic.es/downloads/scipion/data/tests/resmap/
view.add_component('data/map/betaGal.mrc')
print(view.n_components)
# Display 0
# Display...
view
Versions
jupyterlab 4.0.6 pypi_0 pypi
nglview 3.0.8 pypi_0 pypi
hi @jeesay: thanks for your report.
Would you mind trying with the NGL
(that nglview
uses) to see if you can view your file?
https://nglviewer.org/ngl/?script=showcase/ferredoxin
If yes, it's nglview
issue. We will try to fix.
If no, it's NGL
issue, and please help file a case in https://github.com/nglviewer/ngl
thanks.
Hi @hainm,
-
Works perfectly in
NGL
. -
I don't know if it can help. I tested several scripts:
- The function add_component(url) returns the wrong MODE only if the url is set like:
view.add_component('http://localhost:8888/lab/data/map/betaGal.mrc',ext="mrc")
- . The add_component(path/filename) returns a 'Not found file'. For example,
view.add_component('data/map/betaGal.mrc',ext="mrc")
Thanks. Jean-Christophe
Hi @hainm,
- Works perfectly in
NGL
.- I don't know if it can help. I tested several scripts:
- The function add_component(url) returns the wrong MODE only if the url is set like:
view.add_component('http://localhost:8888/lab/data/map/betaGal.mrc',ext="mrc")
- . The add_component(path/filename) returns a 'Not found file'. For example,
view.add_component('data/map/betaGal.mrc',ext="mrc")Thanks. Jean-Christophe
oh then it's an issue for nglview
with jupyterlab then.
If possible, please try with traditional notebook since it (notebook) will accept data/map/betaGal.mrc
path.
Hi @hainm,
- Works perfectly in
NGL
.- I don't know if it can help. I tested several scripts:
- The function add_component(url) returns the wrong MODE only if the url is set like:
view.add_component('http://localhost:8888/lab/data/map/betaGal.mrc',ext="mrc")
- . The add_component(path/filename) returns a 'Not found file'. For example,
view.add_component('data/map/betaGal.mrc',ext="mrc")Thanks. Jean-Christophe
oh then it's an issue for
nglview
with jupyterlab then. If possible, please try with traditional notebook since it (notebook) will acceptdata/map/betaGal.mrc
path.
jupyter notebook
finds the file with path but I got the same wrong MODE message:
MrcParser unknown mode 171863149 664.8a35b9da8e921c96bddb.js:2:1362848
_parse http://localhost:8888/lab/extensions/nglview-js-widgets/static/664.8a35b9da8e921c96bddb.js?v=8a35b9da8e921c96bddb:2
parse http://localhost:8888/lab/extensions/nglview-js-widgets/static/664.8a35b9da8e921c96bddb.js?v=8a35b9da8e921c96bddb:2
noted. thanks @jeesay.
Do you have a .mcr file to share to reproduce it here? thanks.
noted. thanks @jeesay.
Do you have a .mcr file to share to reproduce it here? thanks.
The test map betaGal.mrc
in ngl repository at https://github.com/nglviewer/ngl/blob/master/data/betaGal.mrc