From 17c290ef52c03329ce4c6748841336ae4f1e9ad1 Mon Sep 17 00:00:00 2001 From: Koen Swaerts <66127564+koen-swaerts@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:49:05 +0200 Subject: [PATCH 1/4] Update overall_tools.py fix TypeError: ufunc 'isnan' not supported for the input types. error --- src/wisecondorx/overall_tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wisecondorx/overall_tools.py b/src/wisecondorx/overall_tools.py index cc3ee11..7a45b6f 100644 --- a/src/wisecondorx/overall_tools.py +++ b/src/wisecondorx/overall_tools.py @@ -8,6 +8,7 @@ import math import numpy as np +import pandas as pd """ Scales the bin size of a sample.npz to the one @@ -104,7 +105,7 @@ def get_z_score(results_c, results): segment_w = results_w[segment[0]][segment[1] : segment[2]] segment_w = [segment_w[i] for i in range(len(segment_w)) if segment_rr[i] != 0] null_segments = [ - np.ma.average(np.ma.masked_array(x, np.isnan(x)), weights=segment_w) + np.ma.average(np.ma.masked_array(x, pd.isnull(x)), weights=segment_w) for x in np.transpose(segment_nr) ] null_mean = np.ma.mean([x for x in null_segments if np.isfinite(x)]) From 3f6c385760e95ce3bdf4efe5e1c54524a94133c3 Mon Sep 17 00:00:00 2001 From: Koen Swaerts <66127564+koen-swaerts@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:49:47 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2449018..4fcad60 100755 --- a/README.md +++ b/README.md @@ -193,5 +193,6 @@ the 'ID_segments.bed'. Particularly interesting for NIPT. - pysam (v0.22.0) - numpy (v1.26.4) - matplotlib (v3.8.4) + - pandas And of course, other versions are very likely to work as well. From afb4263c86c143e5658909042d69cab3c2685e0f Mon Sep 17 00:00:00 2001 From: Koen Swaerts <66127564+koen-swaerts@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:55:57 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fcad60..0b546e8 100755 --- a/README.md +++ b/README.md @@ -193,6 +193,6 @@ the 'ID_segments.bed'. Particularly interesting for NIPT. - pysam (v0.22.0) - numpy (v1.26.4) - matplotlib (v3.8.4) - - pandas + - pandas (2.2.2) And of course, other versions are very likely to work as well. From 7c5d8a5afa46be4725fab2776bef40dd00b5852e Mon Sep 17 00:00:00 2001 From: Koen Swaerts <66127564+koen-swaerts@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:56:26 +0200 Subject: [PATCH 4/4] Update setup.cfg --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 823476a..5cbd79f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,6 +42,7 @@ install_requires = scikit-learn pysam numpy + pandas zip_safe = False [options.entry_points]