Closed JacksonBurns closed 4 months ago
Hi @JacksonBurns, thanks for bringing this to my attention. It looks like either the node name or the node path is incorrect:
from global_chem.food.fruits.mango.mango_phytocompounds import MangoPhytoCompounds
@Nickspizza001 This is the mango node and we need to keep testing that. I think I know what the error is.
Hi @JacksonBurns, Thank you for this. The init function is missing in the constituents_of_mango.py
file. Also, a similar error will be noticed when you try to import the mango_amino_acids.
def __init__(self): self.name = 'mango_fatty_acids'
This is currently being fixed.
@Nickspizza001 and @JacksonBurns I hot fixed it and now updated in version 1.8.5.1. Please reinstall.
The issue was the file path node wasn't set correctly or the file was missing:
class MangoPhytocompounds(object):
def __init__(self):
self.name = 'mango_phytocompounds'
As well as the node name for amino acids was off:
class MangoAminoAcids(object):
def __init__(self):
self.name = 'mango_amino_acids'
@Nickspizza001 I seem to be missing some phytocompounds:
'alpha phellandrene': '',
'alpha humulene': '',
'gamma terpinene': '',
'alpha pinene': '',
'trans caryophyllene': '',
'sabinene': '',
'carene': '',
'cis-caryophyllene': '',
'αlpha humulene': '',
'germacrene d': '',
'aromadendrene': '',
'beta ubebene': '',
'alpha cubebene': '',
'alpha bourbonene': '',
'beta elemene': '',
@thedevp and @ANUGAMAGE can you help him get the SMILES using STOUT?
@Sulstice thanks for the quick response! The original problem is resolved, but now this happens in cell 7:
# Fetch All the Data
gc = GlobalChem()
print(len(gc.get_all_smiles()))
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[<ipython-input-7-be708f3a449d>](https://localhost:8080/#) in <cell line: 4>()
2
3 gc = GlobalChem()
----> 4 print(len(gc.get_all_smiles()))
5 print(len(gc.get_all_smarts()))
6 print(len(gc.get_all_names()))
[/usr/local/lib/python3.10/dist-packages/global_chem/global_chem.py](https://localhost:8080/#) in get_all_smiles(self)
1075 if node_key != 'global_chem' and node_key != 'common_regex_patterns':
1076
-> 1077 smiles.append(list(node_value.get_smiles().values()))
1078
1079 smiles = sum(smiles, [])
AttributeError: type object 'MangoPhytocompounds' has no attribute 'get_smiles'
@JacksonBurns I had to restore a previous version. I'm getting this back up and running.
Hi! I got the same error, thakns for any help:
smiles_list = list(gc.get_node_smiles('emerging_perfluoroalkyls').values())
sunburster = cheminformatics.sunburst_chemical_list(
smiles_list
)
sunburster.sunburst()
The error code:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[23], line 7
4 # smiles_list = pd.read_csv('Tables/Perov_table_raw.csv')['Spacer_smiles'].to_list()
6 smiles_list = list(gc.get_node_smiles('emerging_perfluoroalkyls').values())
----> 7 sunburster = cheminformatics.sunburst_chemical_list(
8 smiles_list
9 )
10 sunburster.sunburst()
File ~/.local/lib/python3.8/site-packages/global_chem_extensions/cheminformatics/cheminformatics.py:46, in ChemInformatics.sunburst_chemical_list(smiles_list, save_file)
30 '''
31
32
(...)
41
42 '''
44 from global_chem_extensions.cheminformatics.applications.sunburster import Sunburster
---> 46 sunburster_object = Sunburster(smiles_list, save_file)
48 return sunburster_object
File ~/.local/lib/python3.8/site-packages/global_chem_extensions/cheminformatics/applications/sunburster.py:63, in Sunburster.__init__(self, smiles_list, save_file, verbose)
59 self.second_values = []
61 # Controller
---> 63 self._mine_global_chem()
64 self._prepare_object()
65 self.determine_first_layer()
File ~/.local/lib/python3.8/site-packages/global_chem_extensions/cheminformatics/applications/sunburster.py:87, in Sunburster._mine_global_chem(self)
84 if node_name == 'common_regex_patterns': # Skip this
85 continue
---> 87 node_smarts = node.get_smarts()
89 self.patterns.append(node_smarts)
AttributeError: 'MangoPhytocompounds' object has no attribute 'get_smarts'
Hi it should be fixed now! In version 1.9.4
The google colab demo linked in the README does not run, with the first cell raising this error: