question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Atomium and big pdb file?

See original GitHub issue

Hello Brady 😃

Long time ago I made a video on VMD of my Norovirus Capsid, and I thought that it could be a good test for your tool (Since I have 600K+ atom in the PDB). Here it is (just 1 state) morph_state001-capsid.zip

The problem is that only one part seems to be read since the numbering stop at 99999 (cf. Screenshot 1). I tried different format (convertion with Pymol to mmtf, mmcif, cif, pdb.gz, cif.gz) and it fails for other format (But here the problem seems to come from the atomium library for reading mmtf or mmcif when the output comme from Pymol maybe ?)

For this issue maybe the problem come from the atomium library itself ? But I wanted to repport it since with this new render system it seems possible to load very big systems, and unfortunatly the “assembly” coming from the PDB is splitted into different models (so your addon think it’s a trajectory)

Anyway, here’s some extra information ⤵️ and thank you again for this already great piece of work =D Thibault.

Screenshot 1: image

traceback for loading when it’s mmtf

Python: Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 80, in execute
    sna_func_import_structure_EE5B6(bpy.context.scene.sna_pdb_code,
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1137, in sna_func_import_structure_EE5B6
    pdb = atomium.open(pdb_path)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 41, in open
    return parse_string(filestring, path, *args, **kwargs)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 122, in parse_string
    parsed = file_func(filestring)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 18, in mmtf_bytes_to_mmtf_dict
    return decode_dict(raw)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 40, in decode_dict
    new_value = [decode_dict(x) for x in new_value]
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 40, in <listcomp>
    new_value = [decode_dict(x) for x in new_value]
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 37, in decode_dict
    new_value = parse_binary_field(new_value)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 56, in parse_binary_field
    codec, length, params = struct.unpack(">iii", b[:12])
struct.error: unpack requires a buffer of 12 bytes

location: <unknown location>:-1

Traceback for loading when it’s mmcif

Python: Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 506, in add_atom_to_non_polymer
    ] = atom_line_to_dict(line, aniso_dict)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 530, in atom_line_to_dict
    a["x"] = float(line[30:38].strip())
ValueError: could not convert string to float: '9 ? -57.'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 80, in execute
    sna_func_import_structure_EE5B6(bpy.context.scene.sna_pdb_code,
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1137, in sna_func_import_structure_EE5B6
    pdb = atomium.open(pdb_path)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 41, in open
    return parse_string(filestring, path, *args, **kwargs)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 124, in parse_string
    parsed = data_func(parsed)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 86, in pdb_dict_to_data_dict
    update_models_list(pdb_dict, data_dict)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 158, in update_models_list
    add_atom_to_non_polymer(line, model, res_id, aniso, full_names)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 512, in add_atom_to_non_polymer
    "atoms": {int(line[6:11]): atom_line_to_dict(line, aniso_dict)}
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 530, in atom_line_to_dict
    a["x"] = float(line[30:38].strip())
ValueError: could not convert string to float: '9 ? -57.'

location: <unknown location>:-1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tubianacommented, May 3, 2022

Hey 😃 Since it is an issue from atomium I didn’t try it again XD I will try to make a file with my morphing states and paste the REMARK350 lines to check if it can works ^^ In the meantime I guess this issue can be closed since the issue is coming from Atomium 😃

0reactions
BradyAJohnstoncommented, May 6, 2022

Thanks @RodenLuo for the feedback! Good to know that it builds OK from .mmcif format. Seems like the problem might be resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview — atomium 1.0.11 documentation
atomium is a Python library for opening and saving .pdb, .cif and .mmtf files, and presenting and manipulating the information contained within.
Read more >
atomium—a Python structure parser | Bioinformatics
Here we present atomium, a modern, lightweight, Python library for parsing, manipulating and saving PDB, mmCIF and MMTF file formats.
Read more >
(PDF) atomium - A Python structure parser - ResearchGate
Here we present atomium, a modern, lightweight, Python library for parsing, manipulating, and saving PDB, mmCIF and MMTF file formats.
Read more >
PDB‐tools web: A user‐friendly interface for the manipulation ...
The Protein Data Bank (PDB) file format remains a popular format used and supported by many software to represent coordinates of ...
Read more >
Large PDB Files in FGiJ - Proteopedia
As of October, 2005, there were only about 30 files in the PDB that are larger than 1JJ2 (information thanks to Jaime Prilusky,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found