3D-Beacons / 3d-beacons-client

Implementation of the 3D-Beacons client (local 3D model server)
Apache License 2.0
3 stars 6 forks source link

Error when trying to convert AFDB model .pdb & .json for indexing #25

Closed mvaradi closed 2 years ago

mvaradi commented 2 years ago
$ docker-compose exec cli snakemake --cores=2
Searching for models in data/cif ...
Searching for models in data/pdb ...
  ... found 1 model ids
Building DAG of jobs...
Using shell: /bin/bash
Provided cores: 2
Rules claiming more threads will be scaled down.
Job stats:
job          count    min threads    max threads
---------  -------  -------------  -------------
all              1              1              1
cif2index        1              1              1
loadindex        1              1              1
pdb2cif          1              1              1
total            4              1              1

Select jobs to execute...

[Wed Nov 24 10:41:43 2021]
rule pdb2cif:
    input: data/pdb/AF-P38398-F1-model_v1.pdb
    output: data/cif/AF-P38398-F1-model_v1.cif
    jobid: 3
    wildcards: model=AF-P38398-F1-model_v1
    resources: tmpdir=/tmp

2021-11-24 10:41:44 |   INFO | Converting PDB:data/pdb/AF-P38398-F1-model_v1.pdb to CIF:data/cif/AF-P38398-F1-model_v1.cif
2021-11-24 10:41:44 |   INFO | Converted data/pdb/AF-P38398-F1-model_v1.pdb to data/cif/AF-P38398-F1-model_v1.cif
[Wed Nov 24 10:41:44 2021]
Finished job 3.
1 of 4 steps (25%) done
Select jobs to execute...

[Wed Nov 24 10:41:44 2021]
rule cif2index:
    input: data/cif/AF-P38398-F1-model_v1.cif, data/metadata/AF-P38398-F1-model_v1.json
    output: data/index/AF-P38398-F1-model_v1.json
    jobid: 2
    wildcards: model=AF-P38398-F1-model_v1
    resources: tmpdir=/tmp

2021-11-24 10:41:44 |   INFO | Reading data/cif/AF-P38398-F1-model_v1.cif
2021-11-24 10:41:44 |   INFO | Reading data/metadata/AF-P38398-F1-model_v1.json
2021-11-24 10:41:45 |   INFO | Received https://www.uniprot.org/uniprot/P38398.xml
2021-11-24 10:41:45 |   INFO | Parsing XML for P38398
Traceback (most recent call last):
  File "/usr/local/bin/3dbeacons-cli", line 33, in <module>
    sys.exit(load_entry_point('bio3dbeacons', 'console_scripts', '3dbeacons-cli')())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/app/bio3dbeacons/cli/cli.py", line 69, in cif_to_json
    output_index_json_path=output_index_json,
  File "/app/bio3dbeacons/cli/ciftojson/ciftojson.py", line 204, in run
    cif2json.transform()
  File "/app/bio3dbeacons/cli/ciftojson/ciftojson.py", line 106, in transform
    "experimentalMethod"
AttributeError: 'NoneType' object has no attribute 'strip'
[Wed Nov 24 10:41:45 2021]
Error in rule cif2index:
    jobid: 2
    output: data/index/AF-P38398-F1-model_v1.json
    shell:
        3dbeacons-cli convert-cif2index -ic data/cif/AF-P38398-F1-model_v1.cif -im data/metadata/AF-P38398-F1-model_v1.json -o data/index/AF-P38398-F1-model_v1.json
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /app/.snakemake/log/2021-11-24T104143.542001.snakemake.log
sillitoe commented 2 years ago

Could you please attach the files you used (.pdb and .json) and I'll create a test

mvaradi commented 2 years ago

Sure, no problem! This was the AFDB PDB and the JSON file:

AF-P38398-F1-model_v1.zip

sillitoe commented 2 years ago

This was due to the field experimentalMethod not appearing in the CIF file that gets generated for the AF model.

26 makes this field optional and should fix this issue.

Thanks for reporting.