michellab / FreeEnergyNetworkAnalysis

Software for automated processing of alchemical free energy calculations
10 stars 6 forks source link

Better formatted print options #7

Closed jmichel80 closed 7 years ago

jmichel80 commented 7 years ago

I wrote the following driver code

import sys from networkanalysis.networkanalysis import PerturbationGraph

try: refnode=sys.argv[1] except IndexError: print ("USAGE IS SCRIPT REFNODE") sys.exit(-1)

graph = PerturbationGraph() graph.populate_pert_graph("summary.csv")

graph.compute_weighted_avg_paths(refnode)

print ("# FREE ENERGY ") for mol in graph.freeEnergyInKcal: keys = list(mol.keys()) keys.remove('error') print ("%s %5.2f +/- %5.2f kcal/mol" % (keys[0], mol[keys[0]], mol['error']))

ppxasjsm commented 7 years ago

I'll add these. I don't think this is a proper API at the moment. The API does have a function to save the free energies. At the moment its called save_average_paths. This is not intuitive, so I can change that to save free energies or something along those lines. I guess at the moment the 'API' is anything but restful, and probably could do with some refactoring still.

ppxasjsm commented 7 years ago

Also there is a driver code available I have written, though I was not sure what fuctionalities it should really contain. This will need tinkering over time, but the script is currently found in run_networkanalysis.py, which automatically also gets installed as part of the pip install.

ppxasjsm commented 7 years ago

Formatting according to names using a simple sort(node_list).

ppxasjsm commented 7 years ago

commit: ea1754d addresses this.