Config
Config related classes and methods. Contains the global config object.
AdvancedConfig
dataclass
Advanced config options for XLRanker.
Attributes:
Name | Type | Description |
---|---|---|
intra_in_training |
bool
|
Default to False. If True, intra pairs are included in the positive set for model training. # TODO: May remove this option in future versions |
Source code in src/xlranker/config.py
Config
dataclass
Config for XLRanker.
Attributes:
Name | Type | Description |
---|---|---|
fragile |
bool
|
Default to False. If True, throw error on any warning |
detailed |
bool
|
Default to False. If True, perform more analysis about dataset |
reduce_fasta |
bool
|
Default to True. If True, when a gene has multiple sequences, only accept longest sequence as the canonical sequence. |
human_only |
bool
|
True if all data is human only. |
output |
str
|
Default to "xlranker_output/". Directory where output files are saved. |
additional_null_values |
list[str]
|
Default to []. Additional null values to consider when reading data files. |
advanced |
AdvancedConfig
|
Advanced configuration options |
primary_column |
str | None
|
Column name of which omic file should be the representative. If None, default to the first file alphabetically. |
mapping |
MappingConfig
|
Configuration related to peptide sequence mapping. |
Source code in src/xlranker/config.py
MappingConfig
dataclass
Mapping configuration object.
Attributes:
Name | Type | Description |
---|---|---|
reduce_fasta |
bool
|
If True, only keep longest sequence for duplicated protein entries |
custom_table |
str | None
|
Path to custom table for peptide mapping. If None use default FASTA file. |
is_fasta |
bool
|
True if custom table is in FASTA format |
split_by |
str | None
|
string to split FASTA file for gene symbol extraction |
split_index |
int | None
|
0-based index of section containing gene symbol after string splitting |
fasta_type |
str | None
|
UNIPROT or GENCODE fasta type. If None, will default to UNIPROT |
Source code in src/xlranker/config.py
config_to_dict(config_obj)
Convert Config object to a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_obj
|
config
|
config to convert to dictionary like object. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any] | list[dict[str, Any]]
|
dict[str, Any] | list[dict[str, Any]]: JSON/YAML serializable object representing the input config |
Source code in src/xlranker/config.py
load_from_json(json_file)
Set config to settings in JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json_file
|
str
|
path to JSON file |
required |
set_config_from_dict(config_dict)
Set config from a dict object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_dict
|
dict[str, Any]
|
dictionary with config settings |
required |