Closed jmichel80 closed 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.
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.
Formatting according to names using a simple sort(node_list).
commit: ea1754d addresses this.
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']))
Can we add to the API a clean way to print formatted output?
The compounds order keeps changing upon repeating the script (dictionary). It would be good to have the compounds ordered by ID when printed?