File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
chebifier/prediction_models Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 66import networkx as nx
77from rdkit import Chem
88import json
9+ from chebifier .utils import load_chebi_graph
910
1011
1112class ChEBILookupPredictor (BasePredictor ):
@@ -23,15 +24,7 @@ def __init__(
2324 or "ChEBI Lookup: If the SMILES is equivalent to a ChEBI entry, retrieve the classification of that entry."
2425 )
2526 self .chebi_version = chebi_version
26- self .chebi_graph = kwargs .get ("chebi_graph" , None )
27- if self .chebi_graph is None :
28- from chebai .preprocessing .datasets .chebi import ChEBIOver50
29-
30- self .chebi_dataset = ChEBIOver50 (chebi_version = self .chebi_version )
31- self .chebi_dataset ._download_required_data ()
32- self .chebi_graph = self .chebi_dataset ._extract_class_hierarchy (
33- os .path .join (self .chebi_dataset .raw_dir , "chebi.obo" )
34- )
27+ self .chebi_graph = kwargs .get ("chebi_graph" , load_chebi_graph ())
3528 self .lookup_table = self .get_smiles_lookup ()
3629
3730 def get_smiles_lookup (self ):
You can’t perform that action at this time.
0 commit comments