Skip to content

Fix broken network cookbook with newest konnektor updates - #324

Open
hannahbaumann wants to merge 17 commits into
mainfrom
fix-broken-network-new-konnektor
Open

hannahbaumann wants to merge 17 commits into
mainfrom
fix-broken-network-new-konnektor

Conversation

@hannahbaumann

Copy link
Copy Markdown
Contributor

No description provided.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Colab 👈 Launch a Colab session on branch fix-broken-network-new-konnektor

@hannahbaumann hannahbaumann changed the title [WIP] Adapt fix broken network cookbook with newest konnektor updates [WIP] Fix broken network cookbook with newest konnektor updates Sep 10, 2026
@hannahbaumann
hannahbaumann changed the base branch from fix-broken-networks to main September 10, 2026 12:23
@hannahbaumann hannahbaumann changed the title [WIP] Fix broken network cookbook with newest konnektor updates Fix broken network cookbook with newest konnektor updates Sep 10, 2026
@jthorton jthorton self-assigned this Sep 23, 2026
@jthorton
jthorton requested a review from IAlibay September 23, 2026 14:12
@@ -0,0 +1,853 @@
{

@IAlibay IAlibay Sep 24, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These lines read a little bit "robotic" - it might be worth rephrasing them.


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rephrased this!

@@ -0,0 +1,853 @@
{

@IAlibay IAlibay Sep 24, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A little bit more prose here would be good, i.e. "we start by loading our LigandNetwork, which can be found in mst_network_tyk2.json..."


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this!

@@ -0,0 +1,853 @@
{

@IAlibay IAlibay Sep 24, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Line #7.    plot_atommapping_network(planned_network)

If you capture the figure, I think it'll only plot the output once


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, I changed this!

@IAlibay IAlibay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I mostly reviewed for content - overrall looks good to me, just a couple of small comments on the amount of details that are in the text.

Comment thread environment.yaml Outdated
@@ -0,0 +1,812 @@
{

@jthorton jthorton Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make it clear this is specific to the hybrid topology protocol currently (the way we get the protocol and build the transformations) but the process of identifying missing results and creating new transformations should apply to other RBFE protocols?


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this!

Comment thread cookbook/repairing_broken_networks.ipynb
@@ -0,0 +1,812 @@
{

@jthorton jthorton Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"A transformation counts as successful only when both its complex and solvent legs are completed successfully." We should make it clear that this is specific to the Hybrid Topology Protocol and that the settings helper function below is specific for that one as well or consider making it general?


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I changed this. I think since this is just an example notebook and we'll be working on the API version soon, it's not necessary to make this general here.

Comment thread cookbook/repairing_broken_networks.ipynb
@@ -0,0 +1,812 @@
{

@jthorton jthorton Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line #4.        mapper: AtomMapper,

To consider, should this have the same API as the network generators if this would eventually go into Konnektor and support multiple mappers and a scorer?


Reply via ReviewNB

@@ -0,0 +1,812 @@
{

@jthorton jthorton Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line #5.            ("lig_ejm_31", "lig_ejm_46"),

Is it intentional to generate the same edges again that we faked failing? We also don't do anything with new edges by name should we check this matches what we intened?


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, I think I had just picked these from the order in the network, but you're right, it's better to intentionally take edges that were not the ones that we said failed. Changed this!

Comment thread cookbook/repairing_broken_networks.ipynb
Comment thread cookbook/repairing_broken_networks.ipynb
Comment thread cookbook/repairing_broken_networks.ipynb
@@ -0,0 +1,812 @@
{

@jthorton jthorton Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line #39.        cofactors = {

For cofactors, we could also use get_components_of_type SmallMoleculeComponent and then remove those in the mapping, this feels a little safer than going on the cofactor label?


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, changed this!

@@ -0,0 +1,808 @@
{

@atravitz atravitz Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] I'd prefer using "broken" instead of "damaged" just for consistent language everywhere.


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed this!

@@ -0,0 +1,808 @@
{

@atravitz atravitz Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we're not using colab for notebooks right now, you can remove the colab hacks!


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed this!

@@ -0,0 +1,808 @@
{

@atravitz atravitz Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe it makes sense to move the reading of the reference chemical system to later, at the point where you actually need it?


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That would also be possible, I'm just not sure if it would help the users since we'd have to parse through the results again. If you have a srong preference, I'm happy to change it, but I think I would slightly prefer opening the files only once.

@@ -0,0 +1,808 @@
{

@atravitz atravitz Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm tempted to make load_result_json a public method, but maybe we discuss that for v1.14/15.

_units() needs a docstring. Personally, I would find type-hints helpful for these functions, but I'm not sure if that's true for our targeted audience here.


Reply via ReviewNB

@@ -0,0 +1,808 @@
{

@atravitz atravitz Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a few more inline comments could make this more digestible for users wanting to augment this code.


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added some more inline comments.

@@ -0,0 +1,808 @@
{

@atravitz atravitz Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this header needs to be one level lower (add one #)


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, changed this!

@@ -0,0 +1,808 @@
{

@atravitz atravitz Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think parallel structure with the beginning would help here, something like:

Identify failures: campaign results -> broken ligand network

Repair the ligand network: broken ligand network -> new repair edges

Build replacement transformations: new repair edges -> runnable transformations.


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, changed this!

@atravitz atravitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

overall this looks great (and makes me excited to see how much simpler I can make it using ResultsNetwork).

requesting changes to improve consistency & clarity.

@@ -0,0 +1,810 @@
{

@IAlibay IAlibay Sep 29, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nit] Can you put backticks around objects, e.g. Transformations -> Transformations ?


Reply via ReviewNB

@@ -0,0 +1,810 @@
{

@IAlibay IAlibay Sep 29, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Line #21.        if not any(a in path.name and b in path.name for a, b in DROP_EDGES)

[nit] I wonder if this woulld be more readable to readers if we just didn't have to drop results, i.e. if the files were just missing to begin with? Could just move this to an rm call at the same time you open up the tarball?


Reply via ReviewNB

@@ -0,0 +1,810 @@
{

@IAlibay IAlibay Sep 29, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nit] because the imports were so long ago, it might be good to remind readers of where MstConcatenator comes from.


Reply via ReviewNB

@@ -0,0 +1,810 @@
{

@IAlibay IAlibay Sep 29, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Line #1.    def repair_network_by_score(

[nit] Is this method being re-used later? If not, it might be nicerr for the reader to not have these four lines in a separate method but rather just in-line on the same cell.


Reply via ReviewNB

@@ -0,0 +1,810 @@
{

@IAlibay IAlibay Sep 29, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe add some kind of text blurb about next steps? Maybe a link to the quickrun tutorial?


Reply via ReviewNB

@IAlibay IAlibay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Couple of comments, nothing blocking. Will approve early.

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.

4 participants