SKETCH-2631: Provide ability to mutate monomers from toolbar#254
SKETCH-2631: Provide ability to mutate monomers from toolbar#254JarrettSJohnson merged 1 commit intomainfrom
Conversation
e24d72e to
9ecb6e3
Compare
9ecb6e3 to
0bee87e
Compare
KevKeating
left a comment
There was a problem hiding this comment.
Looks good to me. I just had a few very minor comments.
ethan-schrodinger
left a comment
There was a problem hiding this comment.
As long as @KevKeating's comments are addressed, this LGTM.
| { | ||
| #ifdef __EMSCRIPTEN__ | ||
| throw std::logic_error("Monomers are not yet supported in WASM Sketcher"); | ||
| return std::nullopt; |
There was a problem hiding this comment.
Why this change?
There was a problem hiding this comment.
This was in response to Rachel's comment about using the MonomerDB to verify if a helm symbol is a standard monomer. For wasm-sketcher, since there's no DB, throws this exception and upstream catches the wrong exception type. Upstream call converts nullopt to using the default monomer DB (which is what the else part does..We could just drop this ifdef altogether probably...but maybe I don't have enough background knowledge as to why the monomer DB was kept out of wasm-sketcher in the first place).
I assume since we're now supporting monomers for wasm-sketcher, we probably want to support a monomer DB for it? Lemme know if that's not the case.
There was a problem hiding this comment.
Conferred with Rachel; change is fine for default monomers. Custom monomers for sketcher will be supported in another ticket.
There was a problem hiding this comment.
You could also get rid of the catch block here here, since it shouldn't have any effect any more.
There was a problem hiding this comment.
This might be the relevant case for enabling custom monomers in wasm sketcher https://schrodinger.atlassian.net/browse/SKETCH-2655
0bee87e to
5713b37
Compare
5713b37 to
8a054b3
Compare
| { | ||
| #ifdef __EMSCRIPTEN__ | ||
| throw std::logic_error("Monomers are not yet supported in WASM Sketcher"); | ||
| return std::nullopt; |
There was a problem hiding this comment.
You could also get rid of the catch block here here, since it shouldn't have any effect any more.
8a054b3 to
41e3287
Compare
| @@ -216,9 +216,6 @@ QColor get_color_for_monomer( | |||
| try { | |||
There was a problem hiding this comment.
You could get rid of lines 216 and 219 as well.
13b635b to
8054386
Compare
e8390e6 to
825ca40
Compare
oops not sure how I did that |
8054386 to
6d0e1cf
Compare
f0c91a9 to
d3a6614
Compare
6d0e1cf to
0caeaa3
Compare
…nger#254) * Linked Case: SKETCH-2631 ### Description This revision supports the mutation of monomers from the sketcher monomer toolbar. Each of the following criteria from the jira ticket was addressed: 1. Mutation by clicking on monomer button 2. Toolbar button background changes for compatible changes (similar to what the atomistic tools do) 3. Mixed-selections (selecting amino-acid and peptides) will enable buttons that are compatible with any individual monomer type, but performing the selection will only mutate similar monomer types (e.g. you can't mutate a peptide to a nucleic acid even when other nucleic acids are in the mixed selection) 4. Selections disable the "full" nucleic acid buttons. I'm not too comfortable with HELM/SMILES, so the the changes w.r.t. `bool is_smiles` (which didn't seem to be monomer-friendly) might need extra scrutiny. Without this change, the monomer's display would show '***' (`SMILES_PLACEHOLDER_TEXT`). ### Testing Done Added some boost tests and e2e tests (which this PR is diff'd against) to validate the criteria above.
…sing (#266) * Linked Case: NOJIRAID ### Description This might be more of a discussion than a proposal if this is controversial. It's something that will affect how my tests should be made for SKETCH-2707. If this revision is agreed on, I'll file a JIRA ticket for it. Currently, molecules with undefined monomers could be imported from helm strings, but AFAICT, this doesn't serve much value and should be treated as an error when imported into the sketcher instead? This PR proposes to enforce validation of monomers in a helm string against an available monomer database, and invalid monomers will prevent importing a molecule. For tests, we can bypass validation with `helm::helm_to_rdkit`, if we're just checking for things like attachment points, etc. (This is a stacked PR on top #254 since this requires the monomer database to be available in the wasm sketcher.) ### Testing Done Added new tests which ensures proper exception is thrown with invalid monomers.
…nger#254) * Linked Case: SKETCH-2631 ### Description This revision supports the mutation of monomers from the sketcher monomer toolbar. Each of the following criteria from the jira ticket was addressed: 1. Mutation by clicking on monomer button 2. Toolbar button background changes for compatible changes (similar to what the atomistic tools do) 3. Mixed-selections (selecting amino-acid and peptides) will enable buttons that are compatible with any individual monomer type, but performing the selection will only mutate similar monomer types (e.g. you can't mutate a peptide to a nucleic acid even when other nucleic acids are in the mixed selection) 4. Selections disable the "full" nucleic acid buttons. I'm not too comfortable with HELM/SMILES, so the the changes w.r.t. `bool is_smiles` (which didn't seem to be monomer-friendly) might need extra scrutiny. Without this change, the monomer's display would show '***' (`SMILES_PLACEHOLDER_TEXT`). ### Testing Done Added some boost tests and e2e tests (which this PR is diff'd against) to validate the criteria above.
Description
This revision supports the mutation of monomers from the sketcher monomer toolbar. Each of the following criteria from the jira ticket was addressed:
I'm not too comfortable with HELM/SMILES, so the the changes w.r.t.
bool is_smiles(which didn't seem to be monomer-friendly) might need extra scrutiny. Without this change, the monomer's display would show '***' (SMILES_PLACEHOLDER_TEXT).Testing Done
Added some boost tests and e2e tests (which this PR is diff'd against) to validate the criteria above.