Skip to content

Config parser

InputDirConfig dataclass

Class for defining the fields within the input directory config.

Parameters:

Name Type Description Default
tool str

Name of the tool implementation (e.g. exomiser/phen2gene)

required
tool_version str

Version of the tool implementation

required
variant_analysis bool

Whether to extract prioritised variants from results.

required
gene_analysis bool

Whether to extract prioritised genes from results.

required
disease_analysis bool

Whether to extract prioritised diseases from results.

required
tool_specific_configuration_options Any

Tool specific configurations

required
Source code in src/pheval/config_parser.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@serde
@dataclass
class InputDirConfig:
    """
    Class for defining the fields within the input directory config.

    Args:
        tool (str): Name of the tool implementation (e.g. exomiser/phen2gene)
        tool_version (str): Version of the tool implementation
        variant_analysis (bool): Whether to extract prioritised variants from results.
        gene_analysis (bool): Whether to extract prioritised genes from results.
        disease_analysis (bool): Whether to extract prioritised diseases from results.
        tool_specific_configuration_options (Any): Tool specific configurations


    """

    tool: str
    tool_version: str
    variant_analysis: bool
    gene_analysis: bool
    disease_analysis: bool
    tool_specific_configuration_options: Any

parse_input_dir_config(input_dir)

Reads the config file.

Source code in src/pheval/config_parser.py
35
36
37
38
39
40
def parse_input_dir_config(input_dir: Path) -> InputDirConfig:
    """Reads the config file."""
    with open(Path(input_dir).joinpath("config.yaml"), "r") as config_file:
        config = yaml.safe_load(config_file)
    config_file.close()
    return from_yaml(InputDirConfig, yaml.dump(config))