Selection
Methods and classes for the final selection of protein pairs after Parsimony and ML processing.
BestSelector
Bases: PairSelector
PairSelector that only keeps the best score. Optionally can allow secondary selections for ties.
Attributes:
Name | Type | Description |
---|---|---|
with_secondary |
bool
|
if True, assign secondary selections to tied protein pairs. |
Source code in src/xlranker/selection.py
__init__(with_secondary=False)
Select the pair with the highest score.
For pairs tied for best score, pair alphabetically first is selected. If with_secondary is True, assign pairs with best score but not alphabetically first as secondary selections.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
with_secondary
|
bool
|
Flag to keep tied pairs. Defaults to False. |
False
|
Source code in src/xlranker/selection.py
process(protein_pairs)
Process and assign all protein pairs a status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pairs
|
list[ProteinPair]
|
protein pairs to process. |
required |
Source code in src/xlranker/selection.py
PairSelector
Bases: ABC
Abstract class describing methods for a protein pair selector.
Source code in src/xlranker/selection.py
__init__()
abstractmethod
assign_subgroups_and_get_best(protein_pairs)
Assign subgroups to pairs and get the best score for each subgroup.
Returns:
Type | Description |
---|---|
dict[str, float]
|
dict[str, float]: dict where key is the connectivity ID (str) and the values are the highest score (float) |
Source code in src/xlranker/selection.py
process(protein_pairs)
abstractmethod
Process and assign all protein pairs a status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pairs
|
list[ProteinPair]
|
protein pairs to process. |
required |
ThresholdSelector
Bases: PairSelector
PairSelector that selects all pairs that pass a scoring threshold.
Attributes:
Name | Type | Description |
---|---|---|
threshold |
float
|
minimum scoring threshold for pair to be selected. |
top_n |
int | None
|
if not None, only keep top_n pairs in a group above threshold. |
Source code in src/xlranker/selection.py
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 257 258 259 260 261 262 263 264 265 |
|
__init__(threshold, top_n=None)
Initialize the ThresholdSelector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold
|
float
|
minimum scoring threshold for pair to be selected. |
required |
top_n
|
int | None
|
if not None, only keep top_n pairs in a group above threshold. Defaults to None. |
None
|
Source code in src/xlranker/selection.py
process(protein_pairs)
Process and assign all protein pairs a status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pairs
|
list[ProteinPair]
|
protein pairs to process. |
required |
Source code in src/xlranker/selection.py
assign_not_selected_status(protein_pair)
Assign the correct not selected status to protein pair.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pair
|
ProteinPair
|
protein pair needing status assignment. |
required |
Source code in src/xlranker/selection.py
assign_primary_selected_status(protein_pair)
Assign the correct primary selected status to protein pair.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pair
|
ProteinPair
|
protein pair needing status assignment. |
required |
Source code in src/xlranker/selection.py
assign_secondary_selected_status(protein_pair)
Assign the correct secondary selected status to protein pair.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pair
|
ProteinPair
|
protein pair needing status assignment. |
required |
Source code in src/xlranker/selection.py
filter_for_undecided_pairs(protein_pairs)
Only get pairs that don't have any selected status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pairs
|
list[ProteinPair]
|
list of protein pairs to filter. |
required |
Returns:
Type | Description |
---|---|
list[ProteinPair]
|
list[ProteinPair]: list of all protein pairs still needing a selection status. |