3dem / model-angelo

Automatic atomic model building program for cryo-EM maps
MIT License
116 stars 18 forks source link

key error #27

Closed xuewuzhang-UTSW closed 1 year ago

xuewuzhang-UTSW commented 1 year ago

Hi Kiarash, I got the following error when trying to run the program with a simple map and sequence file("model_angelo build -v PostProcess/job099/postprocess_masked.mrc -f hS.fasta -o model_angelo/"):

2022-12-01 at 13:13:10 | ERROR | Error in ModelAngelo Traceback (most recent call last):

File "/home/xuewuzhang/miniconda3/envs/model_angelo/bin/model_angelo", line 33, in sys.exit(load_entry_point('model-angelo==0.2.2', 'console_scripts', 'model_angelo')()) \u2502 \u2502 \u2514 <function importlib_load_entry_point at 0x7f4d69444160> \u2502 \u2514 \u2514 <module 'sys' (built-in)> File "/home/xuewuzhang/miniconda3/envs/model_angelo/lib/python3.9/site-packages/model_angelo-0.2.2-py3.9.egg/model_angelo/main.py", line 51, in main args.func(args) \u2502 \u2502 \u2514 Namespace(volume_path='PostProcess/job099/postprocess_masked.mrc', fasta_path='./hS.fasta', output_dir='model_angelo', ma... \u2502 \u2514 <function main at 0x7f4c36565940> \u2514 Namespace(volume_path='PostProcess/job099/postprocess_masked.mrc', fasta_path='./hS.fasta', output_dir='model_angelo', ma...

File "/home/xuewuzhang/miniconda3/envs/model_angelo/lib/python3.9/site-packages/model_angelo-0.2.2-py3.9.egg/model_angelo/apps/build.py", line 225, in main gnn_output = gnn_infer(gnn_infer_args) \u2502 \u2514 {'num_rounds': 3, 'crop_length': 200, 'repeat_per_residue': 3, 'esm_model': 'esm1b_t33_650M_UR50S', 'aggressive_pruning': Tru... \u2514 <function infer at 0x7f4c365658b0> File "/home/xuewuzhang/miniconda3/envs/model_angelo/lib/python3.9/site-packages/model_angelo-0.2.2-py3.9.egg/model_angelo/gnn/inference.py", line 243, in infer protein = get_lm_embeddings_for_protein(lang_model, batch_converter, protein) \u2502 \u2502 \u2502 \u2514 Protein(atom_positions=None, atom14_positions=None, aatype=None, atom_mask=None, atom14_mask=None, residueindex=None, chain... \u2502 \u2502 \u2514 <esm.data.BatchConverter object at 0x7f4c206bd070> \u2502 \u2514 ProteinBertModel( \u2502 (embed_tokens): Embedding(33, 1280, padding_idx=1) \u2502 (layers): ModuleList( \u2502 (0): TransformerLayer( \u2502 ... \u2514 <function get_lm_embeddings_for_protein at 0x7f4c372daca0> File "/home/xuewuzhang/miniconda3/envs/model_angelo/lib/python3.9/site-packages/model_angelo-0.2.2-py3.9.egg/model_angelo/data/generate_complete_prot_files.py", line 32, in get_lm_embeddings_for_protein [result[s]["representations"][33].cpu().numpy() for s in seq_names], \u2502 \u2514 ['0'] \u2514 {} File "/home/xuewuzhang/miniconda3/envs/model_angelo/lib/python3.9/site-packages/model_angelo-0.2.2-py3.9.egg/model_angelo/data/generate_complete_prot_files.py", line 32, in [result[s]["representations"][33].cpu().numpy() for s in seq_names], \u2502 \u2502 \u2514 '0' \u2502 \u2514 '0' \u2514 {}

KeyError: '0'

I am not sure whether my installation was corrupt, or there is a bug in the package. Can you please help? Thanks, Xuewu

jamaliki commented 1 year ago

Hi Xuewu,

This indicates there is something perhaps off about your FASTA file. Could you share this file here? Alternatively, if you are more comfortable you could email it to me.

jamaliki commented 1 year ago

This was an issue with FASTA formatting