NTS (Non-Target Screening) Module¶
Screening
¶
calc_overlaping_stats
¶
calc_overlaping_stats(motif, overlaping_fragments, overlaping_losses)
calculates the number of overlaping features and their cumulative intensity
Parameters:
Name | Type | Description | Default |
---|---|---|---|
motif
|
matchms spectrum object |
required | |
overlaping_fragments
|
list
|
list of floats of mz values for fragments |
required |
overlaping_losses
|
list
|
list of float of mz values for losses |
required |
Returns:
Name | Type | Description |
---|---|---|
n_overlaping_features |
int
|
number of features that did overlap between motif and query spectrum |
sum_overlaping_features_intensities |
float
|
consensus intensity for all features that overlap between motif and query spectrum |
Source code in MS2LDA/Add_On/NTS/Screening.py
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 |
|
match_spectral_overlap
¶
match_spectral_overlap(
spectrum_1, spectrum_2, margin_fragments=0.005, margin_losses=0.01
)
calculates the overlap of two spectra considering the fragments and losses
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spectrum_1
|
matchms spectrum object |
required | |
spectrum_2
|
matchms spectrum object |
required | |
margin_fragments
|
float
|
margin of error for fragments for a match |
0.005
|
margin_losses
|
float
|
margin of error for losses for a match |
0.01
|
Returns:
Name | Type | Description |
---|---|---|
overlaping_fragments |
list
|
list for overlaping mz values of fragments |
overlaping_losses |
list
|
list for overlaping mz values of losses |
pearson_score |
float
|
pearson score for spectra with more than 1 overlaping feature |
Source code in MS2LDA/Add_On/NTS/Screening.py
29 30 31 32 33 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 |
|
run_screen
¶
run_screen(motif, spectra)
runs the screening for a given set of spectra against a motif spectrum
Parameters:
Name | Type | Description | Default |
---|---|---|---|
motif
|
matchms spectrum object |
required | |
spectra
|
list
|
list of matchms spectrum objects |
required |
Returns:
Type | Description |
---|---|
A,B,C,D (list): list of matchms spectra objects; A are the best matches D the worst matches |
Source code in MS2LDA/Add_On/NTS/Screening.py
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 |
|
save_as_csv
¶
save_as_csv(spectra, smiles)
saves information about the matching spectra in comparison to the annotated compound/spectrum
Source code in MS2LDA/Add_On/NTS/Screening.py
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 257 258 259 260 261 262 263 264 265 266 |
|
screen_score
¶
screen_score(
n_overlaping_features, sum_overlaping_features_intensities, pearson_score
)
based on degree of query spectra-motif spectra overlapp the spectrum gets assigned to a certain level of similarity
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_overlaping_features
|
int
|
number of features that did overlap between motif and query spectrum |
required |
sum_overlaping_features_intensities
|
float
|
consensus intensity for all features that overlap between motif and query spectrum |
required |
Returns:
Type | Description |
---|---|
character
|
A, B, C or D if it fits one of the categories else None |
Source code in MS2LDA/Add_On/NTS/Screening.py
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 |
|