Prioritize
Classes and methods for the main prioritization for the parsimonious selection step.
ParsimonyGroup
dataclass
Group of protein pairs and peptide pairs in the bipartite graph.
Attributes:
Name | Type | Description |
---|---|---|
protein_pairs |
list[ProteinPair]
|
list of the protein pairs on the right side of the graph. |
peptide_pairs |
list[PeptidePair]
|
list of the peptide pairs on the left side of the graph. |
Source code in src/xlranker/parsimony/prioritize.py
ParsimonySelector
Selector for the parsimonious selection step.
Attributes:
Name | Type | Description |
---|---|---|
data_set |
XLDataSet
|
The cross-linking dataset requiring selection. |
protein_groups |
dict[int, list[ProteinPair]]
|
dictionary of the protein groups where the key is the group ID. |
peptide_groups |
dict[int, list[PeptidePair]]
|
dictionary of the peptide groups where the key is the group ID. |
can_prioritize |
bool
|
True if the dataset has groups assigned and is ready for prioritization. |
Source code in src/xlranker/parsimony/prioritize.py
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 |
|
__init__(data_set)
Initialize the ParsimonySelector object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_set
|
XLDataSet
|
cross-linking dataset |
required |
Source code in src/xlranker/parsimony/prioritize.py
assign_peptide_pair(peptide_pair, group_id)
Assign a group id to a peptide pair and propagate the group to connected components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peptide_pair
|
PeptidePair
|
Peptide pair requiring assignment. |
required |
group_id
|
int
|
group ID to assign to this pair and other pairs connected to it. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
Raised if a different group ID has been assigned to this peptide pair. |
Source code in src/xlranker/parsimony/prioritize.py
assign_protein_pair(protein_pair, group_id)
Assign a group id to a protein pair and propagate the group to connected components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_pair
|
ProteinPair
|
Protein pair requiring assignment. |
required |
group_id
|
int
|
group ID to assign to this pair and other pairs connected to it. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
Raised if a different group ID has been assigned to this protein pair. |
Source code in src/xlranker/parsimony/prioritize.py
create_groups()
Assign group IDs to all pairs in the dataset.
Source code in src/xlranker/parsimony/prioritize.py
prioritize()
Start the parsimonious prioritization of each group.
Source code in src/xlranker/parsimony/prioritize.py
prioritize_group(group_id)
Perform parsimonious selection for the larged connected component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group_id
|
int
|
group ID to prioritize. |
required |
Source code in src/xlranker/parsimony/prioritize.py
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 |
|
select_random(data_set)
Resolve ambiguous groups by selected a random pair.
This is normally done by the machine learning model. However, if training data is not available, use this function to resolve the remaining ambiguity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_set
|
XLDataSet
|
data set to resolve ambiguity |
required |