ablast_funcs
navis.nbl.ablast_funcs.Blaster
#
Base class for blasting.
Source code in navis/nbl/base.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
dtype
property
writable
#
Data type used for scores.
__init__
#
Initialize class.
Source code in navis/nbl/base.py
37 38 39 40 41 42 43 44 |
|
all_by_all
#
BLAST all-by-all neurons.
Source code in navis/nbl/base.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
append
abstractmethod
#
Append neurons.
Source code in navis/nbl/base.py
49 50 51 52 |
|
calc_self_hit
abstractmethod
#
Non-normalized value for self hit.
Source code in navis/nbl/base.py
54 55 56 57 |
|
multi_query_target
#
BLAST multiple queries against multiple targets.
PARAMETER | DESCRIPTION |
---|---|
q_idx |
|
scores |
TYPE: |
Source code in navis/nbl/base.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
pair_query_target
#
BLAST multiple pairs.
PARAMETER | DESCRIPTION |
---|---|
pairs |
TYPE: |
scores |
TYPE: |
Source code in navis/nbl/base.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
single_query_target
abstractmethod
#
Query single target against single target.
Source code in navis/nbl/base.py
59 60 61 62 |
|
navis.nbl.ablast_funcs.Lookup2d
#
Convenience class inheriting from LookupNd for the common 2D float case. Provides IO with pandas DataFrames.
Source code in navis/nbl/smat.py
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 |
|
__init__
#
2D lookup table for convert NBLAST matches to scores.
Commonly read from a pandas.DataFrame
or trained on data using a LookupDistDotBuilder
.
PARAMETER | DESCRIPTION |
---|---|
axis0 | How to convert continuous values into an index for the first axis. TYPE: |
axis1 | How to convert continuous values into an index for the second axis. TYPE: |
cells | Values to look up in the table. |
Source code in navis/nbl/smat.py
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 |
|
from_dataframe
classmethod
#
Parse score matrix from a dataframe with string index and column labels.
Expects the index and column labels to specify an interval like f"[{{lower}},{{upper}})"
. Will replace the lowermost and uppermost bound with -inf and inf if they are not already.
Source code in navis/nbl/smat.py
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 |
|
to_dataframe
#
Convert the lookup table into a pandas.DataFrame
.
From there, it can be shared, saved, and so on.
The index and column labels describe the intervals represented by that axis.
RETURNS | DESCRIPTION |
---|---|
pd.DataFrame | |
Source code in navis/nbl/smat.py
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 |
|
navis.nbl.ablast_funcs.NBlasterAlign
#
Implements a version of NBLAST were neurons are first aligned.
Please note that some properties are computed on initialization and changing parameters (e.g. use_alpha
) at a later stage will mess things up!
PARAMETER | DESCRIPTION |
---|---|
use_alpha |
TYPE: |
normalized |
TYPE: |
smat |
TYPE: |
smat_kwargs |
DEFAULT: |
limit_dist |
TYPE: |
progress |
TYPE: |
Source code in navis/nbl/ablast_funcs.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
__init__
#
Initialize class.
Source code in navis/nbl/ablast_funcs.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
append
#
Append neurons.
Returns the numerical index appended neurons. If neurons is a (possibly nested) sequence of neurons, return a (possibly nested) list of indices.
Note that self_hit
is ignored (and hence calculated from scratch) when neurons
is a nested list of dotprops.
Source code in navis/nbl/ablast_funcs.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
calc_self_hit
#
Non-normalized value for self hit.
Source code in navis/nbl/ablast_funcs.py
180 181 182 183 184 185 186 187 188 |
|
score_single
#
Calculate score for single query/target dotprop pair.
Source code in navis/nbl/ablast_funcs.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
single_query_target
#
Query single query against single target.
Source code in navis/nbl/ablast_funcs.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
navis.nbl.ablast_funcs.find_optimal_partition
#
Find an optimal partition for given NBLAST query.
PARAMETER | DESCRIPTION |
---|---|
N_cores |
TYPE: |
q |
|
RETURNS | DESCRIPTION |
---|---|
(n_rows, n_cols) | |
Source code in navis/nbl/nblast_funcs.py
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 |
|
navis.nbl.ablast_funcs.nblast_preflight
#
Run preflight checks for NBLAST.
Source code in navis/nbl/nblast_funcs.py
1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 |
|
navis.nbl.ablast_funcs.set_omp_flag
#
Set OMP_NUM_THREADS flag to given value.
This is to avoid pykdtree causing multiple layers of concurrency which will over-subcribe and slow down NBLAST on multi-core systems.
Use as context manager!
Source code in navis/nbl/nblast_funcs.py
1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 |
|