Skip to content

Fetch Rhea for 2,3-butanediol dehydrogenase fails #94

@danolson1

Description

@danolson1

I'm trying to get the RHEA:75423 reaction, 2,3-butanediol dehydrogenase.
https://www.rhea-db.org/rhea/75423

This code:
pe.fetch_rhea("RHEA:75423", vessel_id='v0')

Gives this error:

---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
File [~\AppData\Local\miniconda3\envs\pyenzyme\Lib\site-packages\pyenzyme\fetcher\chebi.py:146](http://localhost:8926/lab/tree/~/AppData/Local/miniconda3/envs/pyenzyme/Lib/site-packages/pyenzyme/fetcher/chebi.py#line=145), in ChEBIClient.get_entry_by_id(self, chebi_id)
    144     raise ChEBIError(f"No data found for ChEBI ID {chebi_id}")
--> 146 chebi_response = ChEBIApiResponse(raw_response_data)
    148 entry = list(chebi_response.root.values())[0]

File [~\AppData\Local\miniconda3\envs\pyenzyme\Lib\site-packages\pydantic\root_model.py:68](http://localhost:8926/lab/tree/~/AppData/Local/miniconda3/envs/pyenzyme/Lib/site-packages/pydantic/root_model.py#line=67), in RootModel.__init__(self, root, **data)
     67     root = data  # type: ignore
---> 68 self.__pydantic_validator__.validate_python(root, self_instance=self)

ValidationError: 1 validation error for ChEBIApiResponse
CHEBI:15686.data.definition
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.12/v/string_type

During handling of the above exception, another exception occurred:

ChEBIError                                Traceback (most recent call last)
File [~\AppData\Local\miniconda3\envs\pyenzyme\Lib\site-packages\pyenzyme\fetcher\chebi.py:322](http://localhost:8926/lab/tree/~/AppData/Local/miniconda3/envs/pyenzyme/Lib/site-packages/pyenzyme/fetcher/chebi.py#line=321), in fetch_chebi(chebi_id, smallmol_id, vessel_id)
    321 client = ChEBIClient()
--> 322 chebi_entry = client.get_entry_by_id(chebi_id)
    324 small_molecule = process_chebi_entry(chebi_entry)

File [~\AppData\Local\miniconda3\envs\pyenzyme\Lib\site-packages\pyenzyme\fetcher\chebi.py:154](http://localhost:8926/lab/tree/~/AppData/Local/miniconda3/envs/pyenzyme/Lib/site-packages/pyenzyme/fetcher/chebi.py#line=153), in ChEBIClient.get_entry_by_id(self, chebi_id)
    153             raise e
--> 154         raise ChEBIError(f"Failed to parse ChEBI response: {str(e)}", e)
    155 else:

ChEBIError: Failed to parse ChEBI response: 1 validation error for ChEBIApiResponse
CHEBI:15686.data.definition
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.12/v/string_type

The above exception was the direct cause of the following exception:

ValueError                                Traceback (most recent call last)
Cell In[61], line 1
----> 1 pe.fetch_rhea("RHEA:75423", vessel_id='v0')

File [~\AppData\Local\miniconda3\envs\pyenzyme\Lib\site-packages\pyenzyme\fetcher\rhea.py:184](http://localhost:8926/lab/tree/~/AppData/Local/miniconda3/envs/pyenzyme/Lib/site-packages/pyenzyme/fetcher/rhea.py#line=183), in fetch_rhea(rhea_id, vessel_id)
    182 # Process each chemical species in the reaction
    183 for i in range(n_reactants + n_products):
--> 184     small_molecule = fetch_chebi(
    185         client.chebi_ids[i],
    186         vessel_id=vessel_id,
    187     )
    188     small_molecules.append(small_molecule)
    190     if i < n_reactants:

File [~\AppData\Local\miniconda3\envs\pyenzyme\Lib\site-packages\pyenzyme\fetcher\chebi.py:336](http://localhost:8926/lab/tree/~/AppData/Local/miniconda3/envs/pyenzyme/Lib/site-packages/pyenzyme/fetcher/chebi.py#line=335), in fetch_chebi(chebi_id, smallmol_id, vessel_id)
    334     raise ConnectionError(str(e)) from e
    335 else:
--> 336     raise ValueError(str(e)) from e

ValueError: Failed to parse ChEBI response: 1 validation error for ChEBIApiResponse
CHEBI:15686.data.definition
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.12/v/string_type

It looks like the problem is with the CHEBI import for CHEBI:15686 (R-acetoin)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions