Skip to content
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

IndexError: list index out of range #24

Closed
pablo-arantes opened this issue Dec 8, 2022 · 10 comments
Closed

IndexError: list index out of range #24

pablo-arantes opened this issue Dec 8, 2022 · 10 comments

Comments

@pablo-arantes
Copy link

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

@xiki-tempula
Copy link
Contributor

xiki-tempula commented Dec 9, 2022

Many thanks for the issue. I wonder if I could have the input file so I could have a test? Thanks.
By the way, why is the amber file suffix -q csv? I thought that the amber output file is out?

@pablo-arantes
Copy link
Author

pablo-arantes commented Dec 9, 2022

Hi,

Thank you for your reply. Follow the file we are using.

Thank you.
mdnvt_prod_1.out.zip

@xiki-tempula
Copy link
Contributor

Ok, It would run if you change -q csv to -q out as the extension of your file is out, you would also need to change -t 298 to -t 300 as it is 300K.

@pablo-arantes
Copy link
Author

Hi, I've changed everything as you suggested and I'm having the following issue:

**11962 MBAR energies are > 0.0 kcal/mol
Error reading u_nk from ./mdnvt_prod_8.out.
Traceback (most recent call last):
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/workflows/abfe.py", line 121, in read
u_nk = self._extract_u_nk(file, T=self.T)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/parsing/amber.py", line 419, in extract_u_nk
extracted = extract(outfile, T)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/parsing/init.py", line 27, in wrapper
dict_with_df = func(outfile, T, *args, **kwargs)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/parsing/amber.py", line 347, in extract
mbar_time = [
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/parsing/amber.py", line 348, in
file_datum.t0 + (frame_index + 1) * file_datum.dt * file_datum.ntpr
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

The above exception was the direct cause of the following exception:

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 128, in read
raise OSError(msg) from exc
OSError: Error reading u_nk from ./mdnvt_prod_8.out.**

Thank you again.

@xiki-tempula
Copy link
Contributor

Interesting, I wonder if I can have this file mdnvt_prod_8.out? Thanks.

@pablo-arantes
Copy link
Author

Sure. Follow the file. Thank you!
mdnvt_prod_8.out.zip

@xiki-tempula
Copy link
Contributor

@pablo-arantes Thanks. Do you mind pull the latest version of alchemlyb? I think it should be fixed now.

@pablo-arantes
Copy link
Author

pablo-arantes commented Dec 10, 2022

Hi,

Thank you so much for the help. I've installed the last version of alchemlyb and now I'm getting the following issue:

11962 MBAR energies are > 0.0 kcal/mol
5923 MBAR energies are > 0.0 kcal/mol
11971 MBAR energies are > 0.0 kcal/mol
11968 MBAR energies are > 0.0 kcal/mol
11967 MBAR energies are > 0.0 kcal/mol
2642 MBAR energies are > 0.0 kcal/mol
4967 MBAR energies are > 0.0 kcal/mol
/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/scipy/optimize/_minimize.py:555: RuntimeWarning: Method BFGS does not use Hessian information (hess).
MBAR weights converged within tolerance, despite the SciPy Warnings. Please validate your results.
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 269, in run
ax = self.plot_overlap_matrix(overlap)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/alchemlyb/workflows/abfe.py", line 626, in plot_overlap_matrix
ax.figure.savefig(join(self.out, overlap))
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/matplotlib/figure.py", line 3274, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 2338, in print_figure
result = print_method(
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 2204, in
print_method = functools.wraps(meth)(lambda *args, **kwargs: meth(
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/matplotlib/backends/backend_pdf.py", line 2808, in print_pdf
file = PdfFile(filename, metadata=metadata)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/matplotlib/backends/backend_pdf.py", line 713, in init
fh, opened = cbook.to_filehandle(filename, "wb", return_opened=True)
File "/home/aakash/anaconda3/envs/afe/lib/python3.9/site-packages/matplotlib/cbook/init.py", line 492, in to_filehandle
fh = open(fname, flag, encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'out_data/O_MBAR.pdf'

Thank you.

@xiki-tempula
Copy link
Contributor

Ok, I think it just means that the folder out_data doesn't exist. I will make a fix. In the mean time, if you create the folder yourself, I think it would run.

orbeckst pushed a commit to alchemistry/alchemlyb that referenced this issue Dec 12, 2022
- Workflow base class will now create output folder if it doesn't exist (see also
   alchemistry/flamel#24 )
- add test
- update CHANGES
@xiki-tempula
Copy link
Contributor

I think all of the problems has been fixed in this issue.

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

No branches or pull requests

2 participants