Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement isomerism bug fixes plus tests #20

Merged
merged 8 commits into from
Oct 7, 2024
Merged

implement isomerism bug fixes plus tests #20

merged 8 commits into from
Oct 7, 2024

Conversation

fgrunewald
Copy link
Collaborator

No description provided.

@fgrunewald fgrunewald requested a review from pckroon September 12, 2024 13:26
Copy link
Collaborator

@pckroon pckroon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need do the relative accounting for rs_isomers?

Comment on lines +73 to +79
relative_attr: tuple(str, bool)
a list of attributes that are sensetive
to the ordering of nodes (i.e. refer to
other nodes). The second element indicates
the depth. If False the value of attr are
node keys. If True we expect the value to
be an itertable with node keys.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of faffing around with this bool, you could see if you can do iter(thingy), and check that it's not a string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I condiered that but then wasn't worth it ^^

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The downside of doing it the "clever" way is that there will be cases it gets it wrong (deeper nesting, for example). The downside of using the bool in the argument is that it complicates the api

cgsmiles/graph_utils.py Outdated Show resolved Hide resolved
cgsmiles/pysmiles_utils.py Outdated Show resolved Hide resolved
cgsmiles/tests/test_molecule_resolve.py Outdated Show resolved Hide resolved
cgsmiles/tests/test_molecule_resolve.py Outdated Show resolved Hide resolved
@fgrunewald
Copy link
Collaborator Author

@pckroon at the moment is is not required for the rs_isomer as the nodes only get annotated with '@' or '@@'. However, in the current code it is not possible to have the chiral center using the ring bond accounting. That's why it is not needed at the moment.

The ring thing is a bit tricky because we just strip the smiles string of these characters. Doing the ring thing would actually require looking up the index belonging to a ring atom and matching it.

Copy link
Collaborator

@pckroon pckroon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the chiral ring things, is it possible to at least detect it and issue a warning?

cgsmiles/graph_utils.py Outdated Show resolved Hide resolved
@fgrunewald
Copy link
Collaborator Author

rings are fixed as long as they are within a fragment; chirality split between fragments remains a fragile thing

@fgrunewald fgrunewald requested a review from pckroon October 1, 2024 15:36
Copy link
Collaborator

@pckroon pckroon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some small nitpicks

cgsmiles/pysmiles_utils.py Outdated Show resolved Hide resolved
cgsmiles/read_fragments.py Outdated Show resolved Hide resolved
@fgrunewald fgrunewald merged commit 4430b6b into master Oct 7, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants