jianlin-cheng / Cryo2Struct

Deep learning tools for converting cryo-EM density maps to protein structures
MIT License
2 stars 1 forks source link

Absolute input and model paths needed #1

Closed RodenLuo closed 5 months ago

RodenLuo commented 5 months ago

Hi Nabin, I need to put the absolute paths in config/arguments.yml, otherwise I face the following error.

(c2s) [luod@gpu211-06 Cryo2Struct]$ python3 cryo2struct.py --density_map_name 34610

##############- Cryo2Struct -##############

Running with below configuration: 
density_map_name : 34610
input_data_dir : input
amino_checkpoint : models/amino_acid_type.ckpt
atom_checkpoint : models/atom_type.ckpt
infer_run_on : cpu
infer_on_gpu : 0
threshold : 0.4
clustering_threshold : 2
use_sequence : full
std_lambda : 10

- This might take a bit. Time for a coffee break, maybe! -
Traceback (most recent call last):
  File "/ibex/scratch/projects/c2115/luod/Cryo2Struct/cryo2struct.py", line 131, in <module>
    main()
  File "/ibex/scratch/projects/c2115/luod/Cryo2Struct/cryo2struct.py", line 122, in main
    make_predictions(config_dict)
  File "/ibex/scratch/projects/c2115/luod/Cryo2Struct/cryo2struct.py", line 54, in make_predictions
    grid_division.create_subgrids(input_data_dir=config_dict['input_data_dir'], density_map_name=config_dict['density_map_name'])
  File "/ibex/scratch/projects/c2115/luod/Cryo2Struct/utils/grid_division.py", line 80, in create_subgrids
    protein = get_data(density_map_dir)
  File "/ibex/scratch/projects/c2115/luod/Cryo2Struct/utils/grid_division.py", line 41, in get_data
    os.chdir(density_map_dir)
FileNotFoundError: [Errno 2] No such file or directory: 'input/34610'
nabingiri commented 5 months ago

Hello RodenLuo, Thank you for pointing this out. This has been mentioned in the README file. Below is the screenshot if it.

Screenshot 2024-01-09 at 9 09 46 PM
RodenLuo commented 5 months ago

Thanks, Nabin! I see that. The default in config/arguments.yml makes me think

input_data_dir : input
amino_checkpoint : models/amino_acid_type.ckpt
atom_checkpoint : models/atom_type.ckpt

is enough. But only after I changed them to the full path

input_data_dir : /ibex/scratch/projects/c2115/luod/Cryo2Struct/input
amino_checkpoint : /ibex/scratch/projects/c2115/luod/Cryo2Struct/models/amino_acid_type.ckpt
atom_checkpoint : /ibex/scratch/projects/c2115/luod/Cryo2Struct/models/atom_type.ckpt

it then worked.

A similar issue is when I run bash preprocess/run_data_preparation.bash input/.

I have to change

https://github.com/jianlin-cheng/Cryo2Struct/blob/f8b2f91eaab4b226fe4c5b2ded84ca9766b7cc19/preprocess/run_data_preparation.bash#L7-L8

to

 python3 preprocess/get_resample_map.py "$i" 
 python3 preprocess/get_normalize_map.py "$i" 
nabingiri commented 5 months ago

Hey @RodenLuo,

Thanks for finding that issue. You are right. I updated both the bash script and config file based on your findings. Thanks again.!