-
Notifications
You must be signed in to change notification settings - Fork 3
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
Framework example for non-star shaped analysis #55
base: master
Are you sure you want to change the base?
Conversation
I don't propose that this gets merged until it's in solid python, rather than in a notebook, but adding it here for version control/feedback
To use this code, you will have to checkout the appropriate Arsenic branch until it is merged into master |
Addressing #52 |
I'm not sure how best to return stuff from these functions, wether it should be the graph object itself (for plotting) or just a dictionary of {titles: (free_energy, estimate)} |
TODO
|
I'm having trouble running the interactive networkx graph at: for node in net.nodes:
if node['title'] in has_expt: Looks like |
Hmmm I have dict_keys(['title', 'id', 'label', 'shape', 'font']) What version of pyvis do you have? |
Using |
covid_moonshot/analysis/diffnet.py
Outdated
node[1]['df_i'] = dg_err | ||
|
||
# not sure how to best return from this script | ||
return graphs |
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.
I think we'll want to return both the graph (for plotting purposes) and updated key entries to a .json
for easy manipulation later.
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.
(or a ".json
like" object e.g a list
or dict
)
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.
Agreed that it would be useful to return both the graph and some json-compatible structure for inclusion in the analysis.json!
For the latter, I've been following the convention of describing the structure as a dataclass, e.g. like https://github.com/choderalab/covid-moonshot-infra/blob/266612d6ceef234ad6b77840f7e23cb65700dc64/covid_moonshot/core.py#L34-L40
This is nice as a form of documentation and also allows using something like mypy to check that we're not accessing fields incorrectly in downstream code.
For this case, would something like the following work?
@dataclass_json
@dataclass
class MoleculeAnalysis:
molecule_id: str
absolute_free_energy: FreeEnergy
def combine_relative_free_energies(results: Analysis) -> List[MoleculeAnalysis]:
# ...
covid_moonshot/analysis/diffnet.py
Outdated
Returns | ||
------- | ||
type | ||
Description of returned object. |
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 returns a float (?), need to update the docstring here
Nice, this works for me up until the last step, where I'm also having the issue @WG150 mentioned:
I'm also seeing this with |
covid_moonshot/analysis/diffnet.py
Outdated
return new_g | ||
|
||
|
||
def combine_relative_free_energies(results): |
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.
I think we'll eventually want to transition this to taking a List[Run]
or Analysis
object rather than a dictionary (but this can be done later)
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.
(I think we will want to merge #65 before doing this anyway)
af58b8a
to
8072617
Compare
I don't propose that this gets merged until it's in solid python, rather than in a notebook, but adding it here for version control/feedback.
This required changes to
Arsenic
, that I will open a PR for now