Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error generating sdf files with --export_sdf_path #68

Open
ralphtehuserofit opened this issue Feb 7, 2025 · 3 comments · Fixed by #69
Open

Error generating sdf files with --export_sdf_path #68

ralphtehuserofit opened this issue Feb 7, 2025 · 3 comments · Fixed by #69
Assignees
Labels
bug Something isn't working

Comments

@ralphtehuserofit
Copy link

Ringtail community,
All attempts to generate sdf files gives me the same error. I am using the following command line from within Jupiter Lab

!rt_process_vs read --input_db output.db --bookmark_name ep50_HB --export_sdf_path .

OUTPUT
ERROR - storagemanager.py:114 - the JSON object must be str, bytes or bytearray, not NoneType
Traceback (most recent call last):
File "/Users/ralph/anaconda3/lib/python3.11/site-packages/ringtail/ringtailcore.py", line 1669, in ligands_rdkit_mol
flexible_residues = json.loads(flexible_residues)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralph/anaconda3/lib/python3.11/json/init.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
CRITICAL - rt_process_vs.py:102 - ERROR: the JSON object must be str, bytes or bytearray, not NoneType
Traceback (most recent call last):
File "/Users/ralph/anaconda3/lib/python3.11/site-packages/ringtail/cli/rt_process_vs.py", line 70, in main
rtcore.write_molecule_sdfs(sdf_path = outopts.export_sdf_path,
File "/Users/ralph/anaconda3/lib/python3.11/site-packages/ringtail/ringtailcore.py", line 1562, in write_molecule_sdfs
all_mols = self.ligands_rdkit_mol(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralph/anaconda3/lib/python3.11/site-packages/ringtail/ringtailcore.py", line 1614, in ligands_rdkit_mol
with self.storageman:
File "/Users/ralph/anaconda3/lib/python3.11/site-packages/ringtail/storagemanager.py", line 115, in exit
raise exc_value from None
File "/Users/ralph/anaconda3/lib/python3.11/site-packages/ringtail/ringtailcore.py", line 1669, in ligands_rdkit_mol
flexible_residues = json.loads(flexible_residues)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralph/anaconda3/lib/python3.11/json/init.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

@ralphtehuserofit ralphtehuserofit changed the title Error generating pdf files with --export_sdf_path Error generating sdf files with --export_sdf_path Feb 7, 2025
@maylinnp
Copy link
Contributor

Hi @ralphtehuserofit , did you save the receptor to the database when you ran the rt_process_vs write command?
This would include explicitly setting save receptor and specifying the receptor file: -sr -rf <receptor>.pdbqt

@DaniDelHoyo
Copy link
Contributor

DaniDelHoyo commented Feb 19, 2025

Hello May, I think this is related to the issue I commented regarding the self.storageman.fetch_flexres_info() function of ringtaicore.py.
As for today, if no flexible residues are defined, the output of this function is None, None (for flexible_residues, flexres_atomnames variables).
However, after using this function, you check whether there is any flexible residue with the following line:

if flexible_residues != []:

which turns out to be True when flexible_residues is None, entering the if and yielding the error in the next line when trying to read the flexible_residues JSON (there you got the JSON NoneType error -> flexible_residues = json.loads(flexible_residues) )

I'd say the "if flexible_residues != []: " should be changed to "if flexible_residues is not None: ", or something similar.
The change should be made for lines 1501, 1668 and 1882, where the "if flexible_residues != []: " appears.

Hope this helps!
Dani

@maylinnp
Copy link
Contributor

@ralphtehuserofit A bug fix for the problem @DaniDelHoyo describes has been pushed to the develop branch of ringtail. If you install and use ringtail from source code you should be able to test out the fix now.
The bug fix will be published to pypi and conda-forge in the next few weeks, I'll put a comment here once that happens!

@maylinnp maylinnp self-assigned this Mar 10, 2025
@maylinnp maylinnp added the bug Something isn't working label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants