Giter VIP home page Giter VIP logo

flamel's Introduction

Flamel

GitHub Actions Build Status codecov

The aim of the project is to develop a command line interface (CLI) to alchemlyb, the well-tested and actively developed library for alchemical free energy calculations. It is supposed to become the successor of the now unsupported alchemical-analysis script.

Installation

The package containing flamel is called alchemistry-flamel. The latest release can be installed with pip or alternatively, install from source. Both methods are explained below.

pip

flamel is available from the Python Package index (PyPi) under the name alchemistry-flamel and can be installed with

pip install alchemistry-flamel

The installed package makes the flamel script available.

From sources

Clone the flamel repository https://github.com/alchemistry/flamel and install with pip

git clone [email protected]:alchemistry/flamel.git
pip install flamel/

Uninstalling

If you want to remove flamel after having it installed with pip, run

pip uninstall alchemistry-flamel

to delete flamel and its associated files.

Usage

The analysis can be invoked with the following command

flamel -a GROMACS -d dhdl_data -f 10 -g -i 50 -j result.csv -m TI,BAR,MBAR -n dE -o out_data -p dhdl -q xvg -r 3 -s 50 -t 298 -v  -w

Run flamel -h to see the full description of the options.

Output

This script is a wrapper around the ABFE workflow in alchemlyb. The script will generate the output from ABFE workflow, including O_MBAR.pdf, dF_t.pdf, dF_state.pdf, dF_t.pdf, dhdl_TI.pdf.

The script will also generate the result.csv and result.p, which is a pandas DataFrame summarising the results. ::

                  TI  TI_Error    BAR  BAR_Error   MBAR  MBAR_Error
States 0 -- 1  0.962     0.007  0.956      0.007  0.964       0.006
       1 -- 2  0.567     0.006  0.558      0.006  0.558       0.004
       2 -- 3  0.264     0.005  0.258      0.005  0.254       0.004
       3 -- 4  0.035     0.004  0.035      0.004  0.030       0.003
Stages fep     1.828     0.014  1.806      0.016  1.807       0.014
       TOTAL   1.828     0.014  1.806      0.011  1.807       0.014

Name

In the tradition to associate free energy estimations with alchemistry it's named after Nicolas Flamel

Copyright

Copyright (c) 2022, the AUTHORS.

Acknowledgements

@harlor started flamel as a replacement for the original alchemical-analyis.py script.

Project template based on the Computational Molecular Science Python Cookiecutter version 1.1.

flamel's People

Contributors

dominikwille avatar harlor avatar hejamu avatar orbeckst avatar schlaicha avatar xiki-tempula avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flamel's Issues

`flamel` fails the first time I ran it

Hi flamel team,

I just tried this tool for the first time today, but it fails with the following error:

2024-07-03 11:22:23.361 | INFO     | alchemlyb.workflows.abfe:plot_ti_dhdl:661 - Plot TI dHdl.
Traceback (most recent call last):
  File "/Users/sid/mambaforge/envs/pymbar/bin/flamel", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/flamel/flamel.py", line 200, in main
    workflow.run(
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/alchemlyb/workflows/abfe.py", line 284, in run
    ax = self.plot_ti_dhdl()
         ^^^^^^^^^^^^^^^^^^^
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/alchemlyb/workflows/abfe.py", line 663, in plot_ti_dhdl
    ax = plot_ti_dhdl(
         ^^^^^^^^^^^^^
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/alchemlyb/visualisation/ti_dhdl.py", line 225, in plot_ti_dhdl
    for l in lege.legendHandles:
             ^^^^^^^^^^^^^^^^^^
AttributeError: 'Legend' object has no attribute 'legendHandles'. Did you mean: 'legend_handles'?

I just installed everything today, so all packages should be up-to-date:

# Name                    Version                   Build  Channel
alchemistry-flamel        0.3.1                    pypi_0    pypi
alchemlyb                 2.3.0              pyhd8ed1ab_0    conda-forge
{...snip...}
pymbar                    4.0.3                h1f38498_1    conda-forge
pymbar-core               4.0.3           py312hf635c46_1    conda-forge
...
python                    3.12.4          h30c5eda_0_cpython    conda-forge

And this is the command line:
$ flamel -d flamel -g -j res.txt -o flamel/results -p Ethanol -q dhdl.xvg -s 1000 -t 298 -u 'kJ/mol' -v

Thank you in advance for your help!

Visualization/Plotting

I am thinking about how different plotting methods could be implemented (overlap matrix, dF/dt,...). On one hand, they all depend on the output of estimators so they could be implemented as additional plugins of type output. On the other hand, I see them as something ceonceptually separate, so maybe it should be a new type of plugins, i.e. visualizers. What do you thing @orbeckst @xiki-tempula ?

IndexError: list index out of range

Hi flamel team,

Thank you for your work on flamel, it's a great tool. We are trying to use for our system, and we are getting the following issue:

Traceback (most recent call last):
File "/home/aakash/anaconda3/envs/afe/bin/flamel", line 8, in
sys.exit(main())
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/flamel/flamel.py", line 109, in main
workflow.run(skiptime=args.equiltime, uncorr=args.uncorr,
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/workflows/abfe.py", line 235, in run
self.read(use_FEP, use_TI)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/workflows/abfe.py", line 144, in read
column_names = u_nk_list[0].columns.values.tolist()
IndexError: list index out of range

Following the command line that we are using to run the alchemical free energy calculations:

flamel -a AMBER -p mdnvt_prod_ -f 10 -g -j result.csv -m MBAR -n dE -o out_data -q csv -r 3 -s 0 -t 298 -v -w

Can you, please, help us in this issue?

Thank you.

Best,

Pablo

Change number of iterations in mbar

Hi,

I am using flamel to analyse FEP results (solvation free energy of acetate performed with Gromacs). With pymbar3.0.5 I encounter this issue choderalab/pymbar#320. After switching to pymbar3.0.3, flamel works for switching off the charges, but not when I switch off van der waals (I still have the same issue). I have read here choderalab/pymbar#419 a workaround (from Michael Shirts on March 22nd). Can you please guide me on where I should add these three lines in flamel to check if it works?

Thank you

Nicolas

PS : BTW, thank you for this tool, it is very useful

The future direction of the flamel

@orbeckst @harlor @danijoo
I think it might be good to have a discussion about the future of flamel and its relationship with alchemlyb, before committing to it.

My vision of the alchemlyb would be that it would have two parts, the library part and the workflow part.
The workflow part currently only have the ABFE workflow (alchemistry/alchemlyb#114), which provides the same interface as the alchemical-analysis.

>>> workflow = ABFE(units='kT', software='Gromacs', dir=dir,
>>>                 prefix='dhdl', suffix='xvg', T=298, skiptime=10,
>>>                 uncorr='dhdl', threshold=50,
>>>                 methods=('mbar', 'bar', 'ti'), out='./',
>>>                 resultfilename='result.out', overlap='O_MBAR.pdf',
>>>                 breakdown=True, forwrev=10, log='result.log')

The goal of Flamel will be to transform this python interface into CLI.

There are obviously reasons against this assignment as it would be a departure from the alchemlyb philosophy & principles

It includes functions for parsing data from formats common to existing MD engines, subsampling these data, and fitting these data with an estimator to obtain free energies.
These functions are simple in usage and pure in scope, and can be chained together to build customized analyses of data.

alchemlyb seeks to be as boring and simple as possible to enable more complex work.

However, there are also reasons for this assignment.

The first would be to avoid code duplication. From what I can see, the decorrelation part will be a duplication of the alchemistry/alchemlyb#98.

The second is that when more workflows are available, it will be easier to move part of the code that is used by many workflow (e.g. the unit conversion) from the workflow part to the library part, instead of moving the code from one Github repo to another repo.

The third reason is that it will be easier to release Flamel. The current Flamel has a plugin structure that mimics alchemlyb. So there are two questions, do we want to write the doc for each plugins and do we want to test these plugins? Once alchemistry/alchemlyb#114 is merged, the Flamel could be refactored into a simple CLI and we might not need tests and dedicated docs to release it.

add tests

There need to be CI with standard testing in place.

The basic components in alchemlyb are already tested but at a minimum integration tests are needed for flamel that show that the components work together and that the documented options work.

release 0.3.0

First release of the thin-CLI architecture (as described in discussion #12).

This release is backwards incompatible to the previous releases (the original plugin-based architecture). It will be pip installable.

Value Error

Hi Flamel developers,
Have started uisng alchemlyb but due to sheer complexity have resorted to using flamel. However, with every BAR data I use I get a error like this Traceback (most recent call last):
`Traceback (most recent call last):
File "/home/pallav/anaconda3/envs/alchemlyb/bin/flamel", line 8, in
sys.exit(main())
^^^^^^
File "/home/pallav/anaconda3/envs/alchemlyb/lib/python3.11/site-packages/flamel/flamel.py", line 200, in main
workflow.run(
File "/home/pallav/anaconda3/envs/alchemlyb/lib/python3.11/site-packages/alchemlyb/workflows/abfe.py", line 270, in run
self.read(use_FEP, use_TI)
File "/home/pallav/anaconda3/envs/alchemlyb/lib/python3.11/site-packages/alchemlyb/workflows/abfe.py", line 166, in read
index_list = sorted(
^^^^^^^
File "/home/pallav/anaconda3/envs/alchemlyb/lib/python3.11/site-packages/alchemlyb/workflows/abfe.py", line 168, in
key=lambda x: column_names.index(
^^^^^^^^^^^^^^^^^^^

`
Following is the command:

flamel -a GROMACS -d lambdas/ -f 10 -g -i 50 -j result.csv -m BAR -n dE -o out_data -p lambda -q xvg -r 3 -s 1000 -t 310 -v -w

Can you, please, help us in this issue?

Thank you.

add deployment workflow

Add workflow/action to automate deployment

  • check package
  • testpypi on release tag
  • pypi on GH release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.