File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -139,10 +139,13 @@ def load_metabolites_from_df(
139
139
if cpd_id in structures :
140
140
if "SMILE" in structures [cpd_id ]:
141
141
smiles = structures [cpd_id ]["SMILE" ]
142
+ aliases_annotation ['SMILE' ] = smiles
142
143
if "InChI" in structures [cpd_id ]:
143
144
inchi = structures [cpd_id ]["InChI" ]
145
+ aliases_annotation ['InChI' ] = inchi
144
146
if "InChIKey" in structures [cpd_id ]:
145
147
inchi_key = structures [cpd_id ]["InChIKey" ]
148
+ aliases_annotation ['InChIKey' ] = inchi_key
146
149
inchi_key = None if pd .isna (inchi_key ) or len (inchi_key ) == 0 else inchi_key
147
150
other_names = set ()
148
151
if cpd_id in names :
@@ -158,9 +161,6 @@ def load_metabolites_from_df(
158
161
mass ,
159
162
delta_g ,
160
163
delta_g_err ,
161
- smiles ,
162
- inchi_key ,
163
- inchi ,
164
164
is_core ,
165
165
is_obsolete ,
166
166
is_cofactor ,
@@ -763,6 +763,10 @@ def from_local_old(path):
763
763
764
764
765
765
def from_local (database_path : str ):
766
+ contents = os .listdir (f'{ database_path } /Biochemistry/' )
767
+ if 'compounds.tsv' in contents :
768
+ return from_local_old (database_path )
769
+
766
770
compound_aliases_url = f'{ database_path } /Biochemistry/Aliases/Unique_ModelSEED_Compound_Aliases.txt'
767
771
reaction_aliases_url = f'{ database_path } /Biochemistry/Aliases/Unique_ModelSEED_Reaction_Aliases.txt'
768
772
compound_aliases = _load_aliases_df (pd .read_csv (compound_aliases_url , index_col = None , sep = '\t ' ))
You can’t perform that action at this time.
0 commit comments