Lib
Main module containing the core of the XLRanker tool.
XLDataSet
XLRanker cross-linking dataset object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peptide_pairs
|
dict[str, PeptidePair]
|
Dictionary of peptide pairs, where the key is a unique identifier for the pair. |
required |
omic_data
|
dict[str, DataFrame]
|
Dictionary of omic data, where the key is the file name and the value is a Polars DataFrame containing the data. |
required |
Attributes:
Name | Type | Description |
---|---|---|
peptide_pairs |
dict[str, PeptidePair]
|
Dictionary of peptide pairs, where the key is a unique identifier for the pair. |
omic_data |
dict[str, DataFrame]
|
Dictionary of omic data, where the key is the file name and the value is a Polars DataFrame containing the data. |
proteins |
dict[str, Protein]
|
Dictionary of proteins, where the key is a unique identifier for the protein. |
protein_pairs |
dict[str, ProteinPair]
|
Dictionary of protein pairs, where the key is a unique identifier for the pair. |
Source code in src/xlranker/lib.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 |
|
__init__(peptide_pairs, omic_data)
XLRanker cross-linking dataset object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peptide_pairs
|
dict[str, PeptidePair]
|
Dictionary of peptide pairs, where the key is a unique identifier for the pair. |
required |
omic_data
|
dict[str, DataFrame]
|
Dictionary of omic data, where the key is the file name and the value is a Polars DataFrame containing the data. |
required |
Source code in src/xlranker/lib.py
build_proteins(remove_intra=False)
Build protein pairs of the XLDataSet network.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
remove_intra
|
bool
|
if true, only creates protein pairs between different proteins. Defaults to True. |
False
|
Source code in src/xlranker/lib.py
load_from_network(network_path, omics_data_folder, custom_mapper=None, custom_mapping_path=None, is_fasta=True, split_by='|', split_index=3, fasta_type='UNIPROT')
classmethod
Create a XLDataSet object from a network file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network_path
|
str
|
path to the peptide pairs |
required |
omics_data_folder
|
str
|
folder containing the omic data |
required |
custom_mapper
|
PeptideMapper | None
|
PeptideMapper object that should be used for mapping. If None, create peptide mapper using other parameters. Defaults to None. |
None
|
custom_mapping_path
|
str | None
|
If not using custom_mapper, path to mapping table. Defaults to None. |
None
|
is_fasta
|
bool
|
True if custom_mapping_path points to FASTA file. Defaults to True. |
True
|
split_by
|
str | None
|
character to split FASTA description by. Defaults to "|". |
'|'
|
split_index
|
int | None
|
0-based index to extract gene symbol from. Defaults to 3. |
3
|
fasta_type
|
str | FastaType
|
FASTA file type. str can be "UNIPROT" or "GENCODE". Defaults to "UNIPROT". |
'UNIPROT'
|
Returns:
Name | Type | Description |
---|---|---|
XLDataSet |
XLDataSet
|
XLDataSet with peptide pairs and omics data loaded |
Source code in src/xlranker/lib.py
get_final_network(data_set, pair_selector=BestSelector())
DEPRECIATED: USE REPORTS MODULE. Get the final network of all selected protein pairs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_set
|
XLDataSet
|
XL data set after prioritization |
required |
pair_selector
|
PairSelector
|
What kind of pair selector to use for selecting final pairs. Defaults to BestSelector(). |
BestSelector()
|
Returns:
Type | Description |
---|---|
list[ProteinPair]
|
list[ProteinPair]: list of selected protein pairs |
Source code in src/xlranker/lib.py
setup_logging(verbose=False, log_file=None, silent_all=False)
Set up logging for XLRanker.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verbose
|
bool
|
Use more verbose logging. Sets logging level to DEBUG. Defaults to False. |
False
|
log_file
|
str | None
|
Path to log file. If none, no log file is kept. Defaults to None. |
None
|
silent_all
|
bool
|
Disable all logging. Defaults to False. |
False
|
Source code in src/xlranker/lib.py
write_pair_to_network(pairs, output_file)
Write list of protein pairs to a TSV file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pairs
|
list[ProteinPair]
|
list of protein pairs to save to file. |
required |
output_file
|
str
|
path to write TSV file. Full path must be accessible. |
required |