djmaity / md-davis

MD DaVis: A python package to analyze molecular dynamics trajectories of proteins
https://md-davis.readthedocs.io
MIT License
14 stars 4 forks source link

collate #4

Closed mesdaghi closed 2 years ago

mesdaghi commented 2 years ago

Description

Trying to make the .h5 file (HDF) on command line for the tutorial example 2VH7.

Throws error: "ValueError: could not convert string to float: 'rmsf_files'"

What I Did

**Paste the command(s) you ran and the output.**
md-davis collate ./2VH7/2VH7_input.toml

**If there was a crash, please include the traceback here.**
Collecting data into 2VH7_data.h5:
RMSD from 2VH7/2VH7_rmsd_full.xvg
Radius of gyration from 2VH7/2VH7_rg_full.xvg

ValueError: could not convert string to float: 'rmsf_files'

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

Traceback (most recent call last):
  File "/home/mesdaghi/miniconda3/envs/md-davis/bin/md-davis", line 8, in <module>
    sys.exit(main())
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/md_davis/collate.py", line 506, in main
    create_hdf(data)
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/md_davis/collate.py", line 423, in create_hdf
    add_rmsf(hdf_file=hdf_file, rmsf=residue['rmsf'])
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/md_davis/collate.py", line 118, in add_rmsf
    rmsf_data = numpy.loadtxt(rmsf, comments=('#', '@'),
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/numpy/lib/npyio.py", line 1313, in loadtxt
    arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
  File "/home/mesdaghi/miniconda3/envs/md-davis/lib/python3.10/site-packages/numpy/lib/npyio.py", line 979, in _read
    arr = _load_from_filelike(
ValueError: could not convert string 'rmsf_files' to float32 at row 0, column 1.
djmaity commented 2 years ago

@mesdaghi The rmsf key in the input TOML file was changed from

[residue_property]
    [residue_property.rmsf]
        rmsf_files = '2VH7_rmsf.xvg'
        start = 0
        end = 100

to

[residue_property]
    rmsf = '2VH7_rmsf.xvg'

However, I forgot to reflect that in the documentation, which has been updated now.