Skip to contents

summarize_batch() extracts aggregate statistics from a batch_evaluate() result tibble. Returns a named list with verdict distribution, score distribution, per-component averages, the lowest-scoring proteins, and a heuristic set of enzyme-switch candidates.

Usage

summarize_batch(batch_result)

Arguments

batch_result

A tibble returned by batch_evaluate(). If NULL or empty, raises an error.

Value

A named list with five elements:

verdict_counts

A tibble with columns verdict, n, and pct covering the three verdict categories.

score_distribution

A named numeric vector with mean, median, sd, q25, q75, min, and max of composite scores.

component_summary

A named numeric vector of per-component mean scores. The lowest values identify the weakest scoring dimension across the proteome.

problem_proteins

A tibble of proteins in the bottom 10% by composite score, ordered ascending, with all score and flag columns.

enzyme_switch_candidates

A tibble of Moderate or Poor proteins where flag_hydrophobic or flag_short_protein is TRUE. These rows are candidates for direct comparison with another enzyme or preset.

Details

enzyme_switch_candidates is a heuristic flag list derived from sequence-level difficulty flags, not from running alternative enzymes. Use compare_digests() to confirm whether a specific alternative enzyme improves the verdict for a flagged protein.

Limitations

The enzyme_switch_candidates are heuristic flags based on sequence difficulty, not actual re-evaluation with alternative enzymes. Use compare_digests() to confirm whether a switch improves the verdict.

Examples

small_path <- system.file(
  "extdata", "small_proteome_50_proteins.fasta",
  package = "pepVet"
)
batch <- batch_evaluate(small_path, enzyme = "trypsin")
summary <- summarize_batch(batch)
summary$verdict_counts
#> # A tibble: 3 × 3
#>   verdict      n   pct
#>   <chr>    <int> <dbl>
#> 1 Good        40    80
#> 2 Moderate     9    18
#> 3 Poor         1     2
summary$component_summary
#>   S_length S_coverage    S_count    S_hydro   S_charge 
#>  0.4850442  0.6888812  0.9188799  0.6323869  0.7019852