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
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | |
navis.nbl.ablast_funcs.nblast_preflight #
Run preflight checks for NBLAST.
Source code in navis/nbl/nblast_funcs.py
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 1037 1038 1039 1040 1041 1042 1043 1044 1045 | |
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
1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 | |