Lucy-Forrest-Lab / Lucy-Forrest-Lab/HDXer

reweighting error

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
21
Forks
9
PR merge metrics
No merged PRs in 30d

Description

I have been running this function with the correct paramters
reweight_object.run(gamma=basegamma, data_folders=folders, kint_file=rates, exp_file=expt, times=times, restart_interval=100, out_prefix=f'reweighting_gamma_1x10^{exponent}_')_
and I keep getting this error.
Traceback (most recent call last):
File "/Users/ragarwal/Downloads/HDXer/HDXer/reweighting_functions.py", line 49, in files_to_array
return np.stack(datalist, axis=0)
File "<__array_function__ internals>", line 180, in stack
File "/Users/ragarwal/miniconda3/envs/HDXER_ENV/lib/python3.8/site-packages/numpy/core/shape_base.py", line 426, in stack
raise ValueError('all input arrays must have the same shape')
ValueError: all input arrays must have the same shape

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/Users/ragarwal/Downloads/HDXer/HDXer/reweighting.py", line 970, in run
self.setup_no_runobj(self.runparams['data_folders'],
File "/Users/ragarwal/Downloads/HDXer/HDXer/reweighting.py", line 96, in setup_no_runobj
_contacts, _hbonds, _sorted_resids = read_contacts_hbonds(folderlist,
File "/Users/ragarwal/Downloads/HDXer/HDXer/reweighting_functions.py", line 118, in read_contacts_hbonds
map(lambda x, y: x[y], [files_to_array(curr_cfiles) for curr_cfiles in contactfiles], filters))
File "/Users/ragarwal/Downloads/HDXer/HDXer/reweighting_functions.py", line 118, in
map(lambda x, y: x[y], [files_to_array(curr_cfiles) for curr_cfiles in contactfiles], filters))
File "/Users/ragarwal/Downloads/HDXer/HDXer/reweighting_functions.py", line 54, in files_to_array
raise ValueError("Error in stacking files read with np.loadtxt - are they all the same length?")
ValueError: Error in stacking files read with np.loadtxt - are they all the same length?

I checked the files and they all are of the same length.

Contributor guide

Open the contributing guide

Research direction

Reproduce the call to reweight_object.run and trace into HDXer/reweighting.py: setup_no_runobj, then HDXer/reweighting_functions.py: read_contacts_hbonds and files_to_array. Inspect the arrays loaded from the contact files and compare their shapes and lengths. Done means identifying why the reported inputs cannot be stacked or improving the error handling so the cause is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
bioinformatics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.