DEFMap icon indicating copy to clipboard operation
DEFMap copied to clipboard

ValueError when postprocessing

Open Sofia-GMT opened this issue 2 years ago • 0 comments

Describe the bug

Good morning!

I'm trying to run defmap using the volumes of EMD-4054 and the atomic model of 5lij. When I try to postprocess the output with rmsf_map2model_for_defmap.py, it raises a ValueError if I indicate a threshold different than 0.

To Reproduce

You can download the files from this google drive folder https://drive.google.com/drive/folders/1BMWRu0OwjAZj8S2tALvK8a9h0u4nmDzX?usp=sharing

  1. Create the conda environment
conda install python=3.8 moleculekit=1.5.6 -c acellera -c conda-forge -y 
conda install -c anaconda tensorflow=2.9.1 -y
conda install -c conda-forge scikit-learn -y
conda install -c conda-forge matplotlib -y
  1. Create the dataset
cd preprocessing
python prep_dataset.py -m "/home/usuario/Descargas/emd_4054.mrc" -o "../sample.jbl" -p -t 0.020000

  1. Infer
python 3dcnn_main.py infer -t "sample.jbl" -p "prediction.jbl" -o "./model/model_res5A.h5"
  1. Postprocess with voxel
cd postprocessing
python rmsf_map2grid.py -m "/home/usuario/Descargas/emd_4054.mrc" -p "../prediction.jbl" -t 0.020000
  1. Postprocess with atomic model
cd ..
ln -s /home/usuario/Descargas/emd_4054.mrc volumes.mrc
ln -s /home/usuario/Descargas/5lij.pdb 5lij.pdb
cd postprocessing
python rmsf_map2model_for_defmap.py -l "../sample_for_visual.list" -p "../prediction.jbl" -n

It raises this error

Traceback (most recent call last):
  File "rmsf_map2model_for_defmap.py", line 101, in <module>
    main()
  File "rmsf_map2model_for_defmap.py", line 97, in main
    map_pred_vals(mol, pred, info, args)
  File "rmsf_map2model_for_defmap.py", line 77, in map_pred_vals
    mol.set('beta', np.round(norm_log10rmsf.flatten(), 5))
  File "/home/usuario/workspace/miniconda3/envs/defmap-1.0.1/lib/python3.8/site-packages/moleculekit/molecule.py", line 610, in set
    self.__dict__[field][s] = value
ValueError: NumPy boolean array indexing assignment cannot assign 70 input values to the 761 output values where the mask is true

The content of sample_for_visual.list is this line: 5lij.pdb volumes.mrc

Expected behavior To return a pdb file to visualize in pymol

Environments:

  • OS: Ubuntu
  • Version 22.4.3 LTS
  • CUDA Toolkit version 12.2 in base, 11.7 in python environment and outside conda
  • NVIDIA driver version 535.54.03

Sofia-GMT avatar Dec 19 '23 11:12 Sofia-GMT