8000 Error in reading amber energy files · Issue #287 · alchemistry/alchemlyb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Error in reading amber energy files #287

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

Closed
xiki-tempula opened this issue Dec 9, 2022 · 6 comments
Closed

Error in reading amber energy files #287

xiki-tempula opened this issue Dec 9, 2022 · 6 comments
Labels

Comments

@xiki-tempula
Copy link
Collaborator

@pablo-arantes reported an issue where the current amber parser cannot read the energy output file.
@DrDomenicoMarson many thanks for your contribution to the amber parser. I wonder if you have any thoughts on why this file cannot be parsed. Thank you.

In [1]: from alchemlyb.parsing.amber import extract_u_nk
In [2]: df = extract_u_nk('mdnvt_prod_8.out', 300)
11962 MBAR energies are > 0.0 kcal/mol
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 df = extract_u_nk('mdnvt_prod_8.out', 300)

File ~/miniconda3_x86/envs/alchemlyb/lib/python3.8/site-packages/alchemlyb/parsing/amber.py:419, in extract_u_nk(outfile, T)
    397 def extract_u_nk(outfile, T):
    398     """Return reduced potentials `u_nk` from AMBER outputfile.
    399 
    400     Parameters
   (...)
    417 
    418     """
--> 419     extracted = extract(outfile, T)
    420     return extracted['u_nk']

File ~/miniconda3_x86/envs/alchemlyb/lib/python3.8/site-packages/alchemlyb/parsing/__init__.py:27, in _init_attrs_dict.<locals>.wrapper(outfile, T, *args, **kwargs)
     25 @wraps(func)
     26 def wrapper(outfile, T, *args, **kwargs):
---> 27     dict_with_df = func(outfile, T, *args, **kwargs)
     28     for k in dict_with_df.keys():
     29         if dict_with_df[k] is not None:

File ~/miniconda3_x86/envs/alchemlyb/lib/python3.8/site-packages/alchemlyb/parsing/amber.py:347, in extract(outfile, T)
    344     logger.warning('WARNING: file %s is a prematurely terminated run', outfile)
    346 if file_datum.have_mbar:
--> 347     mbar_time = [
    348         file_datum.t0 + (frame_index + 1) * file_datum.dt * file_datum.ntpr
    349         for frame_index in range(len(file_datum.mbar_energies[0]))]
    351     mbar_df = pd.DataFrame(
    352         file_datum.mbar_energies,
    353         index=np.array(file_datum.mbar_lambdas, dtype=np.float64),
    354         columns=pd.MultiIndex.from_arrays(
    355             [mbar_time, np.repeat(file_datum.clambda, len(mbar_time))], names=['time', 'lambdas'])
    356             ).T
    357 else:

File ~/miniconda3_x86/envs/alchemlyb/lib/python3.8/site-packages/alchemlyb/parsing/amber.py:348, in <listcomp>(.0)
    344     logger.warning('WARNING: file %s is a prematurely terminated run', outfile)
    346 if file_datum.have_mbar:
    347     mbar_time = [
--> 348         file_datum.t0 + (frame_index + 1) * file_datum.dt * file_datum.ntpr
    349         for frame_index in range(len(file_datum.mbar_energies[0]))]
    351     mbar_df = pd.DataFrame(
    352         file_datum.mbar_energies,
    353         index=np.array(file_datum.mbar_lambdas, dtype=np.float64),
    354         columns=pd.MultiIndex.from_arrays(
    355             [mbar_time, np.repeat(file_datum.clambda, len(mbar_time))], names=['time', 'lambdas'])
    356             ).T
    357 else:

TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

mdnvt_prod_8.out.zip

@DrDomenicoMarson
Copy link
Contributor

Hi, I'll have a look at it tomorrow morning! I hope it will be nothing serious ;)

@DrDomenicoMarson
Copy link
Contributor

I'm out at the pub but I was curious and spent a couple of minutes in the file, just two quick comments, also as a reference for "tomorrow morning me":

  • maybe the fact that a detailed output of all the TI energies components was requested somehow broke the parser, as there aren't tests for that option (and I haven't tested it)

  • it seems that you are making disappear some atoms, but I see that the unperturbed charge for the TIregion2 is 10, while is around 0 for region1, as far as I understand it is better to equalize the disappearing/appearing charges with proper appearing/disappearing of counterions

@xiki-tempula
Copy link
Collaborator Author

@DrDomenicoMarson There is the output for another window as well, which seems to be working fine.
mdnvt_prod_1.out.zip

@DrDomenicoMarson
Copy link
Contributor

@xiki-tempula @pablo-arantes I tried on the current git version of alchemlyb and it all seems fine, with both files.

This is the same problem as the one that was r A54B ecently addressed (#272)!

@xiki-tempula
Copy link
Collaborator Author

I can confirm that this is solved. Thanks @DrDomenicoMarson .

@pablo-arantes
Copy link

Hi @xiki-tempula,

Thank you so much for the help. It's working now. :-)

Thank you.

Best,

Pablo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0