jmborr / idpflex

Analysis of intrinsically disordered proteins by comparing MD simulations to Small Angle Scattering experiments
http://idpflex.readthedocs.io/en/latest/
MIT License
3 stars 4 forks source link

Incorrect recapitulation of weight clusters in notebook example #68

Closed jmborr closed 6 years ago

jmborr commented 6 years ago

When creating artificial experimental X-ray profile in the example notebooks, we select a particular level of the tree and then assign weights to the nodes. For instance, for file hiAPP_clustering.ipynb we have in cell 13:

weights = [0.00, 0.13, 0.0, 0.55, 0.0, 0.32, 0.00] # the weights add up to one

Then in after executing cell 18 we obtain

('n192_amplitude', '0.32')
('n189_amplitude', '0.00')
('n187_amplitude', '0.00')
('n181_amplitude', '0.00')
('n191_amplitude', '0.00')
('n188_amplitude', '0.13')
('n190_amplitude', '0.55')

Containing three nodes with non-zero weigths, as expected.

If instead we use

weights = [0.00, 0.13, 0.0, 0.55, 0.0, 0.00, 0.32] # the weights add up to one

The we obtain

('n192_amplitude', '0.00')
('n189_amplitude', '0.00')
('n187_amplitude', '0.00')
('n181_amplitude', '0.00')
('n191_amplitude', '0.00')
('n188_amplitude', '0.13')
('n190_amplitude', '0.55')

There's no node with weight 32 ! This happens allways when we assign a non-zero weight to the last item of list weights.