File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
chebifier/prediction_models Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -16,21 +16,15 @@ def __init__(
1616 chebi_version : int = 241 ,
1717 ** kwargs ,
1818 ):
19+ from chebifier .utils import load_chebi_graph
20+
1921 super ().__init__ (model_name , ** kwargs )
2022 self ._description = (
2123 description
2224 or "ChEBI Lookup: If the SMILES is equivalent to a ChEBI entry, retrieve the classification of that entry."
2325 )
2426 self .chebi_version = chebi_version
25- self .chebi_graph = kwargs .get ("chebi_graph" , None )
26- if self .chebi_graph is None :
27- from chebai .preprocessing .datasets .chebi import ChEBIOver50
28-
29- self .chebi_dataset = ChEBIOver50 (chebi_version = self .chebi_version )
30- self .chebi_dataset ._download_required_data ()
31- self .chebi_graph = self .chebi_dataset ._extract_class_hierarchy (
32- os .path .join (self .chebi_dataset .raw_dir , "chebi.obo" )
33- )
27+ self .chebi_graph = kwargs .get ("chebi_graph" , load_chebi_graph ())
3428 self .lookup_table = self .get_smiles_lookup ()
3529
3630 def get_smiles_lookup (self ):
You can’t perform that action at this time.
0 commit comments