enviPath / enviPath-python

MIT License
3 stars 3 forks source link

Creating Compound with specific SMILES does not work #5

Open j-schurke opened 11 months ago

j-schurke commented 11 months ago

The creation of a compound/node with this SMILES Cc1ccc(NC(=O)N(C)C)cc1Cl is neither possible via the WebApp nor via the API. Somehow the structure is not created, although it is rendered in the creation form.

Error message: image

lorsbach commented 11 months ago

Could you share a minimal working example?

j-schurke commented 10 months ago
res = eP.requester.post_request(INSTANCE_HOST+'package',
                                        payload= {
                                            "packageName": "packageName",
                                            "packageDescription": "desc"
                                            })
res.raise_for_status()
created_package = Package(eP.requester, id=res.url)
created_package = eP.get_package(created_package.id)

created_pathway = Pathway.create(created_package, smiles="C", name="newPw",description="desc", root_node_only=True)
# remove root node to create compound from scratch
substrate_node = created_pathway.get_nodes()[0]
eP.requester.delete_request(substrate_node.id)

new_node = Node.create(pathway=created_pathway, smiles="Cc1ccc(NC(=O)N(C)C)cc1Cl", name="someName", depth=0)

Using the smiles above returns a new_node object whose properties are not loaded, whereas when creating a Node with the same smiles except for the = character, the object is returned as "loaded" with all properties.

P.S. the "cannot read SVG" error seems to be unrelated to this (occurs only on envipath-t server)

anguera5 commented 10 months ago

Hi Jan,

I tried to replicate this issue using your code but everything seems to be working on my end. The variables eP and INSTANCE_HOST are missing on your template code but I assumed you initiated them as:

from enviPath_python import enviPath

INSTANCE_HOST = "https://envipath.org/"
eP = enviPath(INSTANCE_HOST)

Could you check again and see if this problem is still happening on your end?

image