grisoniFr / scaffold_hopping_whales

Code to perform scaffold hopping and virtual screening using WHALES descriptors.
MIT License
31 stars 17 forks source link

Error running do_whales #2

Open Pantelispanka opened 2 years ago

Pantelispanka commented 2 years ago

Hello! I am trying to get the whales descriptors for a molecule and i am getting the following error!

../do_whales.py:40: in whales_from_mol x, lab = do_lcd(coords, w, charge_threshold) ../do_whales.py:87: in do_lcd x_all, lab_all = extract_lcm(res) # MDs and labels ../do_whales.py:132: in extract_lcm x = np.percentile(data, list(perc), axis=0)

<__array_function__ internals>:180: in percentile ??? ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4134: in percentile return _quantile_unchecked( ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4383: in _quantile_unchecked r, k = _ureduce(a, ../../lib/python3.8/site-packages/numpy/lib/function_base.py:3702: in _ureduce r = func(a, **kwargs) ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4552: in _quantile_ureduce_func result = _quantile(arr, ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4669: in _quantile result = _lerp(previous, ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4488: in _lerp lerp_interpolation = asanyarray(add(a, diff_b_a * t, out=out)) ../../lib/python3.8/site-packages/numpy/matrixlib/defmatrix.py:218: in __mul__ return N.dot(self, asmatrix(other)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (matrix([[1.50161452, 0.22319484, 0.02019909], [0.3237369 , 0.0342176 , 0.00889134], [0.07545908, 0.02... [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [21.]])) kwargs = {} relevant_args = (matrix([[1.50161452, 0.22319484, 0.02019909], [0.3237369 , 0.0342176 , 0.00889134], [0.07545908, 0.02...[ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [21.]]), None) > ??? E ValueError: shapes (11,3) and (11,1) not aligned: 3 (dim 1) != 11 (dim 0)
NannylikePHP commented 2 years ago

Hello! I am trying to get the whales descriptors for a molecule and i am getting the following error!

../do_whales.py:40: in whales_from_mol x, lab = do_lcd(coords, w, charge_threshold) ../do_whales.py:87: in do_lcd x_all, lab_all = extract_lcm(res) # MDs and labels ../do_whales.py:132: in extract_lcm x = np.percentile(data, list(perc), axis=0) <array_function internals>:180: in percentile ??? ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4134: in percentile return _quantile_unchecked( ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4383: in _quantile_unchecked r, k = _ureduce(a, ../../lib/python3.8/site-packages/numpy/lib/function_base.py:3702: in _ureduce r = func(a, *kwargs) ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4552: in _quantile_ureduce_func result = _quantile(arr, ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4669: in _quantile result = _lerp(previous, ../../lib/python3.8/site-packages/numpy/lib/function_base.py:4488: in _lerp lerp_interpolation = asanyarray(add(a, diff_b_a t, out=out)) ../../lib/python3.8/site-packages/numpy/matrixlib/defmatrix.py:218: in mul return N.dot(self, asmatrix(other))

args = (matrix([[1.50161452, 0.22319484, 0.02019909], [0.3237369 , 0.0342176 , 0.00889134], [0.07545908, 0.02... [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [21.]])) kwargs = {} relevant_args = (matrix([[1.50161452, 0.22319484, 0.02019909], [0.3237369 , 0.0342176 , 0.00889134], [0.07545908, 0.02...[ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [21.]]), None)

??? E ValueError: shapes (11,3) and (11,1) not aligned: 3 (dim 1) != 11 (dim 0)

hello, I have the same problem. Did you solve it?

davidzqhuang commented 1 year ago

Not ideal, but if you convert to list first it will work. Unsure if this is intended.

# Calculates percentiles according to the specified settings
perc = list(range(start, end + 1, step))
data = data.tolist()
x = np.percentile(data, perc, axis=0)
vsboijlfkh8566 commented 1 year ago

i have the same problem i dont know why but python 3.6.10 work and python 3.10 not work hope it help