Pairs
Protein and Peptide pairs.
GroupedEntity
Entity that are part of a group with connections to other entities.
Attributes:
Name | Type | Description |
---|---|---|
group_id |
int
|
ID of the large connected component entity is a part of |
subgroup_id |
int
|
ID of the unique subgroup entity is a part of |
in_group |
bool
|
True if entity has been assigned a group |
prioritization_status |
PrioritizationStatus
|
status of the entity during prioritization |
connections |
set[str]
|
List of other grouped entities this entity is connected to. Values are connection IDs. |
Source code in src/xlranker/bio/pairs.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 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 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 |
|
__init__()
Initialize a grouped entity.
add_connection(entity)
Add a connection to a different entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity
|
str
|
String representation of the entity to add |
required |
connectivity_id()
get_group()
Get the group id of this entity.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
group ID this entity is a part of |
get_group_string()
Return a string representation of the group this entity is in.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
String of in the format of group_id.subgroup_id |
n_connections()
Get number of connections to this entity.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
number of entity connected to this entity |
overlap(entities)
Overlap of connections to a set of other entities.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entities
|
set[str]
|
list of entities to compare to |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
number of entities in input set also connected to this entity |
Source code in src/xlranker/bio/pairs.py
remove_connections(entities)
Remove multiple connections from this entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entities
|
set
|
set of entities to remove connections to |
required |
same_connectivity(grouped_entity)
Determine if another GroupedEntity has the same connection as this entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grouped_entity
|
GroupedEntity
|
entity to compare to |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if this entity and input entity have identical connections |
Source code in src/xlranker/bio/pairs.py
set_group(group_id)
Set the group this entity is a part of.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group_id
|
int
|
ID of the group to set this entity to. |
required |
set_prioritization_status(status)
Set the prioritization status of this entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
status
|
PrioritizationStatus
|
prioritization status to assign to this entity. |
required |
Source code in src/xlranker/bio/pairs.py
set_subgroup(subgroup_id)
Set the subgroup ID for this entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
subgroup_id
|
int
|
ID of the subgroup |
required |
PeptidePair
Bases: GroupedEntity
Pair of two peptide sequences. Order of a and b does not matter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peptide_a
|
Peptide
|
Peptide A |
required |
peptide_b
|
Peptide
|
Peptide B |
required |
Attributes:
Name | Type | Description |
---|---|---|
a |
Peptide
|
Peptide a |
b |
Peptide
|
Peptide b |
pair_id |
str
|
String representation of this peptide pair. |
Source code in src/xlranker/bio/pairs.py
__hash__()
Get hash of this PeptidePair.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
hash generated from pair id |
__init__(peptide_a, peptide_b)
Peptide sequence pairs. Used for parsimonious selection.
Input order does not matter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peptide_a
|
Peptide
|
first peptide object |
required |
peptide_b
|
Peptide
|
second peptide object |
required |
Source code in src/xlranker/bio/pairs.py
ProteinPair
Bases: GroupedEntity
ProteinPair class that tracks the required data for the pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_a
|
Protein
|
First protein in the pair |
required |
protein_b
|
Protein
|
Second protein in the pair |
required |
Attributes:
Name | Type | Description |
---|---|---|
a |
Protein
|
Protein A |
b |
Protein
|
Protein B |
score |
float
|
Prioritization score |
is_selected |
bool
|
True if this pair is selected as a representative pair |
pair_id |
str
|
str representation of this protein pair |
is_intra |
bool
|
True if protein a and b are the same |
report_status |
ReportStatus
|
status of what report group this pair belongs to |
Source code in src/xlranker/bio/pairs.py
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 257 258 259 |
|
__eq__(value)
Checks if ProteinPairs are equivalent, without caring for order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
object | ProteinPair
|
protein pair to compare to |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if protein pairs are equivalent, regardless of a and b order |
Source code in src/xlranker/bio/pairs.py
__hash__()
Generate a hash representing this protein pair.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
hash generated from the pair_id of this protein pair. |
__init__(protein_a, protein_b)
Initialize the protein pair.
Order of proteins does not matter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein_a
|
Protein
|
the first protein object |
required |
protein_b
|
Protein
|
the second protein object |
required |
Source code in src/xlranker/bio/pairs.py
abundance_dict()
Convert ProteinPair into dictionary of abundances, making abundances ending in a being the larger value.
Returns:
Type | Description |
---|---|
dict[str, str | float | None]
|
dict[str, str | float | None]: dictionary where keys are the abundance name and the values being the abundance value |
Source code in src/xlranker/bio/pairs.py
select()
set_report_status(status)
Set the report status of the protein pair.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
status
|
ReportStatus
|
ReportStatus enum value to set the pair to |
required |
set_score(score)
Set the score of the protein pair.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
score
|
float
|
float of the score given to the pair |
required |
to_tsv()
Converts object into a TSV string.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
TSV representation of the protein pair, including id and status |