-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix networks #155
base: main
Are you sure you want to change the base?
Fix networks #155
Conversation
removing copy past artefact :)
Saving transformations to json
Co-authored-by: Hannah Baumann <[email protected]>
Co-authored-by: Hannah Baumann <[email protected]>
Co-authored-by: Hannah Baumann <[email protected]>
…hmarks2024 into fix_networks
# build alchemical sub-networks | ||
g = ligand_network.graph | ||
all_edges = list(ligand_network.edges) | ||
sub_network_nodes = list(nx.connected_components(g)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing because it's a multidigraph I think - we can just create a digraph from g and it should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now first creating an undirected graph from g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will start addressing the comments I've raised.
|
||
transform_list.append(t_list[0]) | ||
|
||
return AlchemicalNetwork(transform_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AlchemicalNetwork may not have "complete" cycles, i.e. could only have the solvent or complex leg. When generating the LigandNetwork from this, this information gets lost and broken networks are not recognized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fixed in commit 8f7131f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If instead the user should remove result .json files from edges where only one leg finished, these two lines can be removed, though at least a warning should be thrown.
stateB = ChemicalSystem.from_dict(units[0]["inputs"]["stateB"]) | ||
ligmap = LigandAtomMapping.from_dict(units[0]["inputs"]["ligandmapping"]) | ||
|
||
if any([isinstance(comp, gufe.ProteinComponent) for comp in stateA.components.values()]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToDo: Test if this would still work for files that have been cleaned up, i.e. where components have partially been removed.
# build alchemical sub-networks | ||
g = ligand_network.graph | ||
all_edges = list(ligand_network.edges) | ||
sub_network_nodes = list(nx.connected_components(g)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now first creating an undirected graph from g
ToDo:
|
ToDo
|
return ru | ||
|
||
|
||
def get_transformation_alternate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From today: we could possibly get solvent/complex from the names.
for transform in taped_alchemical_network.edges: | ||
transform.dump(transforms_dir / f"{transform.name}.json") | ||
|
||
full_ligand_network = get_full_ligand_network(input_ligand_network, res_ligand_network, network_connections) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to be only the additional edges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in commit 31c2ac1
Supplements #144
This needs: