From 92cda91e107403728399ccab926a00242273d9a1 Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 10 Aug 2023 09:47:20 +0200 Subject: [PATCH 1/5] feature: add support for Power2013 coordinates --- junifer/data/VOIs/meta/Power2013_MNI_VOIs.tsv | 264 ++++++++++++++++++ junifer/data/coordinates.py | 1 + 2 files changed, 265 insertions(+) create mode 100644 junifer/data/VOIs/meta/Power2013_MNI_VOIs.tsv diff --git a/junifer/data/VOIs/meta/Power2013_MNI_VOIs.tsv b/junifer/data/VOIs/meta/Power2013_MNI_VOIs.tsv new file mode 100644 index 0000000000..088a08a262 --- /dev/null +++ b/junifer/data/VOIs/meta/Power2013_MNI_VOIs.tsv @@ -0,0 +1,264 @@ +22 -65 48 1 +25 -58 60 2 +-35 20 0 3 +12 36 20 4 +40 18 40 5 +54 -28 34 6 +36 22 3 7 +59 -17 29 8 +-45 0 9 9 +46 -59 4 10 +-32 -1 54 11 +32 14 56 12 +-42 -60 -9 13 +-34 3 4 14 +37 1 -4 15 +29 -5 54 16 +11 -39 50 17 +37 -65 40 18 +-34 -38 -16 19 +-52 -63 5 20 +-10 11 67 21 +-44 2 46 22 +-3 26 44 23 +49 8 -1 24 +-33 -46 47 25 +-27 -71 37 26 +55 -45 37 27 +7 8 51 28 +36 10 1 29 +-39 51 17 30 +10 -62 61 31 +-16 -5 71 32 +43 49 -2 33 +37 32 -2 34 +10 -2 45 35 +47 -30 49 36 +36 -9 14 37 +-3 2 53 38 +-51 8 -2 39 +-1 15 44 40 +31 -14 2 41 +19 -8 64 42 +-10 -2 42 43 +65 -33 20 44 +-30 -27 12 45 +6 -72 24 46 +-7 -52 61 47 +-49 -42 1 48 +-49 25 -1 49 +-5 18 34 50 +-23 11 64 51 +31 33 26 52 +-0 30 27 53 +-53 -22 23 54 +-42 -55 45 55 +-50 -34 26 56 +48 22 10 57 +31 56 14 58 +44 -8 57 59 +49 35 -12 60 +-56 -50 10 61 +2 -24 30 62 +29 -39 59 63 +-42 -74 0 64 +-34 55 4 65 +13 -1 70 66 +42 -0 47 67 +-3 42 16 68 +5 23 37 69 +51 -29 -4 70 +0 -15 47 71 +52 -33 8 72 +34 16 -8 73 +-7 -71 42 74 +-29 -43 61 75 +33 -53 44 76 +-55 -40 14 77 +-17 -59 64 78 +56 -5 13 79 +46 -47 -17 80 +-11 26 25 81 +22 -42 69 82 +-13 -40 1 83 +43 -23 20 84 +-53 -49 43 85 +-47 11 23 86 +54 -43 22 87 +53 33 1 88 +10 22 27 89 +-55 -9 12 90 +-58 -30 -4 91 +-42 45 -2 92 +56 -46 11 93 +-45 -32 47 94 +11 -66 42 95 +-28 -79 19 96 +-47 -76 -10 97 +-2 38 36 98 +-54 -23 43 99 +-28 52 21 100 +47 -50 29 101 +-2 -35 31 102 +50 -20 42 103 +-42 38 21 104 +26 50 27 105 +58 -53 -14 106 +47 10 33 107 +32 -26 13 108 +-46 31 -13 109 +10 -46 73 110 +27 -37 -13 111 +43 -72 28 112 +52 -2 -16 113 +-2 -37 44 114 +38 43 15 115 +-60 -25 14 116 +-41 6 33 117 +-2 -13 12 118 +42 -66 -8 119 +9 -4 6 120 +29 1 4 121 +15 5 7 122 +-42 25 30 123 +-26 -40 -8 124 +65 -31 -9 125 +44 -53 47 126 +-18 -76 -24 127 +-35 20 51 128 +-28 -58 48 129 +-49 -26 5 130 +-53 -10 24 131 +-47 -51 -21 132 +58 -16 7 133 +49 -42 45 134 +40 -72 14 135 +-32 -55 -25 136 +-14 -18 40 137 +-41 -75 26 138 +-16 -77 34 139 +4 -48 51 140 +-68 -41 -5 141 +35 -67 -34 142 +22 39 39 143 +-56 -13 -10 144 +15 -63 26 145 +-15 4 8 146 +29 -77 25 147 +38 -17 45 148 +23 10 1 149 +66 -8 25 150 +51 -6 32 151 +-39 -75 44 152 +-11 45 8 153 +52 7 -30 154 +-21 41 -20 155 +-12 -95 -13 156 +8 42 -5 157 +34 38 -12 158 +-16 -46 73 159 +37 -84 13 160 +18 -47 -10 161 +-11 -56 16 162 +48 25 27 163 +-53 3 -27 164 +46 16 -30 165 +-31 19 -19 166 +37 -81 1 167 +52 -59 36 168 +27 16 -17 169 +24 45 -15 170 +-44 12 -34 171 +-46 -61 21 172 +-49 -11 35 173 +-25 -98 -12 174 +-33 -79 -13 175 +11 -54 17 176 +23 33 48 177 +-3 -49 13 178 +12 -17 8 179 +-38 -33 17 180 +8 48 -15 181 +-10 39 52 182 +43 -78 -12 183 +20 -29 60 184 +-40 -19 54 185 +-20 45 39 186 +13 30 59 187 +-24 -91 19 188 +-16 29 53 189 +8 -91 -7 190 +-21 -31 61 191 +6 67 -4 192 +17 -80 -34 193 +-23 -30 72 194 +2 -28 60 195 +15 -77 31 196 +3 -17 58 197 +55 -31 -17 198 +-31 -10 -36 199 +-40 -88 -6 200 +-18 63 -9 201 +27 -59 -9 202 +49 -3 -38 203 +-31 -11 -0 204 +65 -24 -19 205 +17 -28 -17 206 +-7 51 -1 207 +24 32 -18 208 +9 54 3 209 +-7 -55 27 210 +-21 -22 -20 211 +34 54 -13 212 +-38 -15 69 213 +-38 -27 69 214 +65 -12 -19 215 +-16 -52 -1 216 +-8 48 23 217 +-3 44 -9 218 +-37 -29 -26 219 +27 -97 -13 220 +17 -91 -14 221 +6 54 16 222 +8 41 -24 223 +8 -48 31 224 +24 -87 24 225 +-58 -26 -15 226 +29 -17 71 227 +-68 -23 -16 228 +-10 -18 7 229 +-13 -17 75 230 +-7 -33 72 231 +15 -87 37 232 +-20 64 19 233 +42 -20 55 234 +26 -79 -16 235 +-10 55 39 236 +13 -33 75 237 +33 -12 -34 238 +-26 -90 3 239 +-7 -21 65 240 +10 -17 74 241 +-44 -65 35 242 +6 -59 35 243 +6 64 22 244 +-18 -68 5 245 +-16 -65 -20 246 +8 -72 11 247 +13 55 38 248 +-14 -91 31 249 +-3 -81 21 250 +20 -86 -2 251 +-50 -7 -39 252 +-56 -45 -24 253 +-8 -81 7 254 +20 -66 2 255 +6 -81 6 256 +52 -34 -27 257 +-15 -72 -8 258 +6 -24 -0 259 +28 -77 -32 260 +22 -58 -23 261 +1 -62 -18 262 +-22 7 -5 263 +-5 -28 -4 264 diff --git a/junifer/data/coordinates.py b/junifer/data/coordinates.py index ff6adc8c7a..fcd77e999e 100644 --- a/junifer/data/coordinates.py +++ b/junifer/data/coordinates.py @@ -46,6 +46,7 @@ "WM": _vois_meta_path / "WM_VOIs.txt", "Power": _vois_meta_path / "Power2011_MNI_VOIs.txt", "Dosenbach": _vois_meta_path / "Dosenbach2010_MNI_VOIs.txt", + "Power2013": _vois_meta_path / "Power2013_MNI_VOIs.tsv", } From 215c97339f995530f3527143352dc09485637dc3 Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 10 Aug 2023 09:47:42 +0200 Subject: [PATCH 2/5] update: rename Power to Power2011 in coordinates.py --- junifer/data/coordinates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junifer/data/coordinates.py b/junifer/data/coordinates.py index fcd77e999e..cb478d25da 100644 --- a/junifer/data/coordinates.py +++ b/junifer/data/coordinates.py @@ -44,7 +44,7 @@ "ToM": _vois_meta_path / "ToM_VOIs.txt", "VigAtt": _vois_meta_path / "VigAtt_VOIs.txt", "WM": _vois_meta_path / "WM_VOIs.txt", - "Power": _vois_meta_path / "Power2011_MNI_VOIs.txt", + "Power2011": _vois_meta_path / "Power2011_MNI_VOIs.txt", "Dosenbach": _vois_meta_path / "Dosenbach2010_MNI_VOIs.txt", "Power2013": _vois_meta_path / "Power2013_MNI_VOIs.tsv", } From 5a864695a55a0f8788b9045a39684a5df08c5f77 Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 10 Aug 2023 09:58:50 +0200 Subject: [PATCH 3/5] docs: update builtin.rst with Power2013 and rename Power to Power2011 --- docs/builtin.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/builtin.rst b/docs/builtin.rst index df6323a757..7cf1117faf 100644 --- a/docs/builtin.rst +++ b/docs/builtin.rst @@ -527,7 +527,7 @@ Available | NeuroImage, Volume 60, Pages 830-846 (2012). | https://doi.org/10.1016/j.neuroimage.2011.11.050. * - Areal functional network from Power et al. (2011) - - ``Power`` + - ``Power2011`` - 0.0.2 - | Power, J. D., Cohen, A. L., Nelson, S. M. et al. | Functional network organization of the human brain. @@ -540,6 +540,14 @@ Available | Prediction of Individual Brain Maturity Using fMRI | Science, Volume 329(5997), Pages 1358-1361 (2010). | https://doi.org/10.1126/science.1194144 + * - Areal functional network from Power et al. (2013) + - ``Power2013`` + - 0.0.4 + - | Power, J. D., Schlaggar, B. L., Lessov-Schlaggar, C. N., & + | Petersen, S. E. + | Evidence for hubs in human functional brain networks. + | Neuron, Volume 79(4), Pages 798–813 (2013). + | https://doi.org/10.1016/j.neuron.2013.07.035 Planned From 3dc68b097700308741ea5de14dbfc44735efcc8f Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 10 Aug 2023 10:03:37 +0200 Subject: [PATCH 4/5] chore: add changelogs 245.change and 245.feature --- docs/changes/newsfragments/245.change | 1 + docs/changes/newsfragments/245.feature | 1 + 2 files changed, 2 insertions(+) create mode 100644 docs/changes/newsfragments/245.change create mode 100644 docs/changes/newsfragments/245.feature diff --git a/docs/changes/newsfragments/245.change b/docs/changes/newsfragments/245.change new file mode 100644 index 0000000000..8a6ce9d23f --- /dev/null +++ b/docs/changes/newsfragments/245.change @@ -0,0 +1 @@ +Rename ``Power`` coordinates to ``Power2011`` by `Synchon Mandal`_ diff --git a/docs/changes/newsfragments/245.feature b/docs/changes/newsfragments/245.feature new file mode 100644 index 0000000000..8d1a6de325 --- /dev/null +++ b/docs/changes/newsfragments/245.feature @@ -0,0 +1 @@ +Add support for ``Power2013`` coordinates by `Synchon Mandal`_ From fbe18bca64d741c73fc168629f57b70ed48c92b4 Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Wed, 6 Sep 2023 11:34:01 +0200 Subject: [PATCH 5/5] chore: keep Power but with deprecation note in coordinates.py --- junifer/data/coordinates.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/junifer/data/coordinates.py b/junifer/data/coordinates.py index cb478d25da..8fe242392f 100644 --- a/junifer/data/coordinates.py +++ b/junifer/data/coordinates.py @@ -11,7 +11,7 @@ import pandas as pd from numpy.typing import ArrayLike -from ..utils.logging import logger, raise_error +from ..utils.logging import logger, raise_error, warn_with_log # Path to the VOIs @@ -44,6 +44,7 @@ "ToM": _vois_meta_path / "ToM_VOIs.txt", "VigAtt": _vois_meta_path / "VigAtt_VOIs.txt", "WM": _vois_meta_path / "WM_VOIs.txt", + "Power": _vois_meta_path / "Power2011_MNI_VOIs.txt", "Power2011": _vois_meta_path / "Power2011_MNI_VOIs.txt", "Dosenbach": _vois_meta_path / "Dosenbach2010_MNI_VOIs.txt", "Power2013": _vois_meta_path / "Power2013_MNI_VOIs.tsv", @@ -135,9 +136,27 @@ def load_coordinates(name: str) -> Tuple[ArrayLike, List[str]]: The coordinates. list of str The names of the VOIs. + + Warns + ----- + DeprecationWarning + If ``Power`` is provided as the ``name``. + """ if name not in _available_coordinates: raise_error(f"Coordinates {name} not found.") + + # Put up deprecation notice + if name == "Power": + warn_with_log( + msg=( + "`Power` has been replaced with `Power2011` and will be " + "removed in the next release. For now, it's available for " + "backward compatibility." + ), + category=DeprecationWarning, + ) + t_coord = _available_coordinates[name] if isinstance(t_coord, Path): df_coords = pd.read_csv(t_coord, sep="\t", header=None)