Skip to contents

digest_report() formats the output of evaluate_digest() or compare_digests() as a human-readable console summary. Reports use ASCII-safe labels and score profiles, wrap long protein identifiers, and simplify comparison tables in narrow terminals. The function returns its input invisibly so it can be used in pipelines. Use it when you want a compact review of component scores during interactive enzyme selection or package-level demonstrations.

Usage

digest_report(x, title = NULL)

Arguments

x

The object to report on. Accepts:

Named list from evaluate_digest()

Prints a single-protein component-score summary for the evaluated enzyme.

Tibble from compare_digests()

Prints a multi-enzyme ranking table with the highest-scoring enzyme highlighted.

If NULL or an unrecognised type, raises an error.

title

Optional character string printed as a section header above the report. When NULL (default), a report-type heading is used. A non-NULL value must be a single character string.

Value

x, invisibly.

Limitations

Output is printed to the console only. File output is not supported.

Examples

bsa_path <- system.file("extdata", "P02769.fasta", package = "pepVet")
ev <- evaluate_digest(bsa_path)
digest_report(ev)
#> pepVet digest check
#> -------------------
#> Protein            sp|P02769|ALBU_BOVIN Albumin OS=Bos taurus OX=9913 GN=ALB
#>                    PE=1 SV=4
#> Enzyme             trypsin
#> Preset             standard
#> Missed cleavages   Up to 1
#> Peptides           157 total; 108 within 7-25 aa
#> Verdict            Good
#> Composite          0.885
#> Component        Score  Profile
#> S_length         0.688  [#######---]
#> S_coverage       0.997  [##########]
#> S_count          1.000  [##########]
#> S_hydro          0.769  [########--]
#> S_charge         0.778  [########--]

comp <- compare_digests(bsa_path, enzymes = c("trypsin", "lysc"))
digest_report(comp)
#> pepVet enzyme comparison
#> ------------------------
#> Protein            sp|P02769|ALBU_BOVIN Albumin OS=Bos taurus OX=9913 GN=ALB
#>                    PE=1 SV=4
#> Best score         trypsin (0.885, Good)
#> Rank Enzyme             S_len S_cov S_cnt S_hyd S_chg Score Verdict
#> -------------------------------------------------------------------
#>    1 trypsin            0.688 0.997 1.000 0.769 0.778 0.885 Good
#>    2 lysc               0.628 0.857 1.000 0.763 0.776 0.823 Good