Skip to content

Analysis

benchmark_directory(results_dir_and_input, score_order, output_prefix, threshold, gene_analysis, variant_analysis, disease_analysis, plot_type)

Benchmark prioritisation performance for a single run.

Parameters:

Name Type Description Default
results_dir_and_input TrackInputOutputDirectories

Input and output directories for tracking results.

required
score_order str

The order in which scores are arranged, this can be either ascending or descending.

required
output_prefix str

Prefix for the benchmark output file names.

required
threshold float

The threshold for benchmark evaluation.

required
gene_analysis bool

Boolean flag indicating whether to benchmark gene results.

required
variant_analysis bool

Boolean flag indicating whether to benchmark variant results.

required
disease_analysis bool

Boolean flag indicating whether to benchmark disease results.

required
plot_type str

Type of plot for benchmark visualisation.

required
Source code in src/pheval/analyse/analysis.py
 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
def benchmark_directory(
    results_dir_and_input: TrackInputOutputDirectories,
    score_order: str,
    output_prefix: str,
    threshold: float,
    gene_analysis: bool,
    variant_analysis: bool,
    disease_analysis: bool,
    plot_type: str,
) -> None:
    """
    Benchmark prioritisation performance for a single run.

    Args:
        results_dir_and_input (TrackInputOutputDirectories): Input and output directories for tracking results.
        score_order (str): The order in which scores are arranged, this can be either ascending or descending.
        output_prefix (str): Prefix for the benchmark output file names.
        threshold (float): The threshold for benchmark evaluation.
        gene_analysis (bool): Boolean flag indicating whether to benchmark gene results.
        variant_analysis (bool): Boolean flag indicating whether to benchmark variant results.
        disease_analysis (bool): Boolean flag indicating whether to benchmark disease results.
        plot_type (str): Type of plot for benchmark visualisation.
    """
    if gene_analysis:
        _run_benchmark(
            results_dir_and_input=results_dir_and_input,
            score_order=score_order,
            output_prefix=output_prefix,
            threshold=threshold,
            plot_type=plot_type,
            benchmark_generator=GeneBenchmarkRunOutputGenerator(),
        )
    if variant_analysis:
        _run_benchmark(
            results_dir_and_input=results_dir_and_input,
            score_order=score_order,
            output_prefix=output_prefix,
            threshold=threshold,
            plot_type=plot_type,
            benchmark_generator=VariantBenchmarkRunOutputGenerator(),
        )
    if disease_analysis:
        _run_benchmark(
            results_dir_and_input=results_dir_and_input,
            score_order=score_order,
            output_prefix=output_prefix,
            threshold=threshold,
            plot_type=plot_type,
            benchmark_generator=DiseaseBenchmarkRunOutputGenerator(),
        )

benchmark_run_comparisons(results_directories, score_order, output_prefix, threshold, gene_analysis, variant_analysis, disease_analysis, plot_type)

Benchmark prioritisation performance for several runs.

Parameters:

Name Type Description Default
results_directories List[TrackInputOutputDirectories]

Input and output directories for tracking results.

required
score_order str

The order in which scores are arranged, this can be either ascending or descending.

required
output_prefix str

Prefix for the benchmark output file names.

required
threshold float

The threshold for benchmark evaluation.

required
gene_analysis bool

Boolean flag indicating whether to benchmark gene results.

required
variant_analysis bool

Boolean flag indicating whether to benchmark variant results.

required
disease_analysis bool

Boolean flag indicating whether to benchmark disease results.

required
plot_type str

Type of plot for benchmark visualisation.

required
Source code in src/pheval/analyse/analysis.py
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
def benchmark_run_comparisons(
    results_directories: List[TrackInputOutputDirectories],
    score_order: str,
    output_prefix: str,
    threshold: float,
    gene_analysis: bool,
    variant_analysis: bool,
    disease_analysis: bool,
    plot_type: str,
) -> None:
    """
    Benchmark prioritisation performance for several runs.

    Args:
        results_directories (List[TrackInputOutputDirectories]): Input and output directories for tracking results.
        score_order (str): The order in which scores are arranged, this can be either ascending or descending.
        output_prefix (str): Prefix for the benchmark output file names.
        threshold (float): The threshold for benchmark evaluation.
        gene_analysis (bool): Boolean flag indicating whether to benchmark gene results.
        variant_analysis (bool): Boolean flag indicating whether to benchmark variant results.
        disease_analysis (bool): Boolean flag indicating whether to benchmark disease results.
        plot_type (str): Type of plot for benchmark visualisation.
    """
    if gene_analysis:
        _run_benchmark_comparison(
            results_directories=results_directories,
            score_order=score_order,
            output_prefix=output_prefix,
            threshold=threshold,
            plot_type=plot_type,
            benchmark_generator=GeneBenchmarkRunOutputGenerator(),
        )
    if variant_analysis:
        _run_benchmark_comparison(
            results_directories=results_directories,
            score_order=score_order,
            output_prefix=output_prefix,
            threshold=threshold,
            plot_type=plot_type,
            benchmark_generator=VariantBenchmarkRunOutputGenerator(),
        )
    if disease_analysis:
        _run_benchmark_comparison(
            results_directories=results_directories,
            score_order=score_order,
            output_prefix=output_prefix,
            threshold=threshold,
            plot_type=plot_type,
            benchmark_generator=DiseaseBenchmarkRunOutputGenerator(),
        )