Open rupeshagarwal opened 2 years ago
Hi @rupeshagarwal that error can arise for a number of reasons, but fundamentally is linked to the reading-in of the contacts & H-bond files generated by the initial calc_hdx
step. Here are a few things to check:
folders
variable you provide a list of strings, rates
a string, and expt
a string, as per the tutorial?np.loadtxt(os.path.join(folders[0], reweight_object.runparams['contacts_prefix'] + "1.tmp"))
return an array with the contacts for residue 1 in your topology? (Replace "1.tmp"
with another number to test other residues)If that doesn't fix it and you're able to share a minimal example of your data that reproduces the problem I'd be happy to take a look, just let me know?
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_gamma1x10^{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.