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

Problems running MaxEnt in the tutorial 03_reweighting notebook

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

Description

Hi,
I'm getting this error when running the 03_reweighting notebook

```
---------------------------------------------------------------------------
AxisError Traceback (most recent call last)
/tmp/ipykernel_27749/1894631224.py in
26
27 reweight_object = MaxEnt(do_reweight=True, do_params=False, stepfactor=0.00001)
---> 28 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}_')
29 print(f'Reweighting for gamma = 1x10^{exponent} completed')
30

~/tmp/HDX/hdxer/HDXer/HDXer/reweighting.py in run(self, gamma, resultsobj, analysisobj, restart, **run_params)
971 self.runparams['kint_file'],
972 self.runparams['exp_file'],
--> 973 self.runparams['times'])
974 except KeyError:
975 raise HDX_Error("Missing parameters to set up a reweighting run.\n"

~/tmp/HDX/hdxer/HDXer/HDXer/reweighting.py in setup_no_runobj(self, folderlist, kint_file, expt_file_path, times)
96 _contacts, _hbonds, _sorted_resids = read_contacts_hbonds(folderlist,
97 self.runparams['contacts_prefix'],
---> 98 self.runparams['hbonds_prefix'])
99 if self.runparams['do_subsample']:
100 _contacts, _hbonds = subsample_contacts_hbonds(_contacts, _hbonds,

~/tmp/HDX/hdxer/HDXer/HDXer/reweighting_functions.py in read_contacts_hbonds(folderlist, contacts_prefix, hbonds_prefix)
120 map(lambda x, y: x[y], [files_to_array(curr_hfiles) for curr_hfiles in hbondfiles], filters))
121
--> 122 contacts = np.concatenate(_contacts, axis=1)
123 print("Contacts read")
124 hbonds = np.concatenate(_hbonds, axis=1)

<__array_function__ internals> in concatenate(*args, **kwargs)

AxisError: axis 1 is out of bounds for array of dimension 1
```

My `_contacts` values are:

```
[array([22., 27., 32., 31., 23., 16., 26., 21., 28., 15., 7., 30., 19.,
20., 19., 16., 19., 20., 17., 15., 16., 32., 33., 28., 35., 30.,
24., 17., 24., 10., 9., 19., 17., 15., 16., 25., 26., 21., 13.,
26., 28., 19., 21., 3., 5., 14., 28., 30., 24., 22., 14., 42.,
37., 36., 34., 33., 15., 18., 13., 19., 36., 30., 20., 27., 29.,
23., 24., 26., 24., 12., 11., 13., 19., 14., 24., 35., 30., 28.,
30., 20., 9., 18., 17., 11., 9., 17., 32., 28., 22., 27., 27.,
23., 33., 32., 29., 27., 23., 19., 25., 23., 32., 38., 36., 47.,
39., 16., 12., 27., 24., 17., 23., 37., 21., 14., 18., 22., 30.,
31., 32., 40., 35., 34., 30., 33., 35., 19., 26., 32., 22., 32.,
33., 25., 20., 30., 33., 31., 24., 33., 49., 35., 19., 15., 20.,
18., 30., 31., 40., 36., 36., 34., 34., 30., 9., 14., 22., 20.,
14., 19., 24., 20., 21., 18., 17., 12., 13., 6., 11., 14., 11.,
22., 30., 22., 24., 30., 25., 19., 28., 29., 22., 22., 31., 27.,
22., 26., 27., 27., 18., 20., 19., 33., 32., 27., 23., 24., 24.,
26., 23., 16., 17., 22., 14., 0., 3., 13., 13., 6., 17., 6.,
7., 3., 10., 17., 11., 21., 17., 12., 33., 43., 36., 24., 31.,
35., 21., 18., 20., 19., 16., 13., 9., 9., 5., 1., 1., 2.,
0., 0., 4., 16., 22., 15., 31., 28., 24., 36., 32., 26., 29.,
27., 35., 35., 32., 26., 13., 20., 18., 20., 14., 22., 23., 20.,
12., 18., 24., 27., 34., 32., 40., 40., 25., 10., 15., 6., 5.,
18., 20., 9., 8., 14., 24., 14., 17., 5., 12., 29., 36., 26.,
31., 22., 5., 16., 27., 16., 16., 19., 30., 27., 30., 39., 30.,
24., 0., 0., 0., 0., 0., 1., 2., 2., 2., 2., 2., 0.,
0., 2., 2., 2., 2., 3., 2., 6., 19., 8., 10., 28., 31.,
20., 26., 35., 34., 26., 25., 26., 36., 38., 23., 10., 13., 15.,
15., 28., 28., 27., 31., 32., 30., 37., 37., 27., 16., 17., 21.,
21., 32., 39., 38., 32., 29., 37., 42., 23., 22., 16., 15., 19.,
20., 18., 26., 27., 27., 30., 34., 26., 18., 19., 33., 37., 46.,
37., 36., 34., 40., 19., 15., 11., 25., 29., 27., 22., 31., 29.,
23., 23., 30., 33., 19., 25., 20., 23., 41., 40., 22., 25., 26.,
15., 6., 10., 1., 1., 3., 17., 16., 15., 27., 35., 23., 17.,
19., 15., 24., 26., 29., 35., 36., 39., 35., 15., 14., 28., 25.,
13., 20., 16., 10., 15., 21., 26., 22., 25., 29., 19., 13., 14.,
28., 31., 33., 30., 37., 41., 38., 36., 24., 29., 23., 31., 36.,
42., 25., 21., 31., 26., 17., 22., 21., 7., 14., 29., 26., 14.,
21., 22., 20., 17., 23., 20., 17., 21., 7., 20., 31., 37., 35.,
38., 40., 37., 27., 24., 22., 17., 12., 23., 27., 22., 34., 31.,
17., 14., 20., 34., 39., 32., 16., 22., 16., 14., 1., 10., 6.,
2., 11., 15., 31., 35., 33., 30., 31., 12., 17., 35., 32., 18.,
21., 21., 18., 21., 39., 22., 11., 12., 9., 14., 13., 27., 19.,
24., 19., 28., 21., 7., 7., 24., 22., 5., 2., 2., 2., 2.,
2., 2., 2., 2., 2., 2., 0., 1., 1., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 1., 6., 2., 4., 5.,
6., 8., 9., 10., 7., 9., 13., 1., 0., 0., 2., 2., 2.,
1., 0., 2., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 2., 2., 2., 2., 2., 2., 0., 5., 13.,
8., 11., 18., 29., 20., 23., 32., 21., 19., 29., 27., 29., 25.,
26., 31., 17., 24., 27., 25., 20., 20., 31., 26., 15., 17., 15.,
20., 25., 15., 26., 32., 32., 33., 23., 22., 27., 28., 27., 31.,
40., 25., 23., 37., 37., 23., 10., 9., 24., 34., 27., 19., 26.,
20., 25., 33., 36., 28., 23., 32., 30., 23., 13., 23., 19., 19.,
21., 20., 17., 25., 28., 23., 24., 29., 21., 19., 18., 12., 15.,
13., 14., 24., 22., 9., 1., 0., 2., 2., 1., 2., 1., 2.])]
```

How can I fix this, please?

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in the 03_reweighting notebook, then inspect read_contacts_hbonds in HDXer/reweighting_functions.py and its call from HDXer/reweighting.py. Check the shape returned for _contacts before np.concatenate is called. Done means the notebook runs past setup without the AxisError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
34/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.