Skip to contents

batch_evaluate() processes proteins in bulk, using one digest and score call per serial or parallel chunk, and returns a flat tibble with one row per protein. Columns include protein_id, protein_length, and all component scores, including composite_score, verdict, n_peptides, n_valid_peptides, and median_peptide_length, plus four sequence-level difficulty flags. Pass the result to summarize_batch() for aggregate statistics or to triage_proteins() for action labels.

Usage

batch_evaluate(
  sequences,
  enzyme = "trypsin",
  missed_cleavages = 1L,
  include_cleavage_efficiency = FALSE,
  proteome = NULL,
  weights = NULL,
  cores = 1L,
  ...
)

Arguments

sequences

Multi-protein input. Accepts the same forms as digest_protein(). Must resolve to at least one protein. If NULL or empty, raises an error.

enzyme

Enzyme name passed to digest_protein(). Defaults to "trypsin".

missed_cleavages

Maximum missed cleavages. Defaults to 1L.

include_cleavage_efficiency

Logical flag passed to digest_protein(). Defaults to FALSE. When TRUE, each per-protein peptide table includes a cleavage_efficiency column (does not affect the flat batch tibble columns).

proteome

Optional proteome digest tibble passed to score_peptides() for every protein evaluation. When NULL (default), no uniqueness scoring is performed and the S_unique column is omitted.

weights

Optional scoring weight vector passed to score_peptides(). When NULL (default), uses pepVet's default scoring weights.

cores

Number of parallel workers for protein-level chunking. 1L (default) runs sequentially with no extra dependencies. Values greater than 1L split the input into equal chunks and process each chunk with parallel::mclapply() on Unix or a parallel::parLapply() socket cluster on Windows.

...

Additional scoring arguments passed to score_peptides(), such as gravy_range and length_range.

Value

A tibble with one row per protein. Fixed columns: protein_id, protein_length, n_peptides, n_valid_peptides, all available component scores (S_length, S_coverage, S_count, S_hydro, S_charge; S_unique when proteome is provided), composite_score, verdict, median_peptide_length, flag_short_protein, flag_hydrophobic, flag_low_complexity, flag_no_valid_peptides.

Details

The returned tibble carries a scoring_config attribute containing the resolved ranges, weights, proteome-aware mode, and pI mode. Batch inputs must have unique protein identifiers. Difficulty flags use the active scoring ranges; flag_short_protein and flag_low_complexity remain sequence-level heuristics. Rows follow the supplied input-record order. Reordering uniquely named records changes row order but not the named per-protein results.

Limitations

Windows socket workers receive serialized copies of their input, while Unix fork workers use copy-on-write memory. If a worker or socket cluster fails, the affected chunks are retried sequentially with a warning.

Examples

small_proteome <- system.file(
  "extdata", "small_proteome_50_proteins.fasta",
  package = "pepVet"
)
batch <- batch_evaluate(small_proteome, enzyme = "trypsin")
nrow(batch)
#> [1] 50
batch[, c("protein_id", "composite_score", "verdict")]
#> # A tibble: 50 × 3
#>    protein_id                                            composite_score verdict
#>    <chr>                                                           <dbl> <chr>  
#>  1 sp|O15162|PLS1_HUMAN Phospholipid scramblase 1 OS=Ho…           0.624 Modera…
#>  2 sp|O15393|TMPS2_HUMAN Transmembrane protease serine …           0.683 Good   
#>  3 sp|O60502|OGA_HUMAN Protein O-GlcNAcase OS=Homo sapi…           0.746 Good   
#>  4 sp|O75475|PSIP1_HUMAN PC4 and SFRS1-interacting prot…           0.736 Good   
#>  5 sp|O75970|MPDZ_HUMAN Multiple PDZ domain protein OS=…           0.724 Good   
#>  6 sp|O95273|CCDB1_HUMAN Cyclin-D1-binding protein 1 OS…           0.563 Modera…
#>  7 sp|O95905|ECD_HUMAN Protein ecdysoneless homolog OS=…           0.709 Good   
#>  8 sp|P01889|HLAB_HUMAN HLA class I histocompatibility …           0.739 Good   
#>  9 sp|P01911|DRB1_HUMAN HLA class II histocompatibility…           0.742 Good   
#> 10 sp|P04439|HLAA_HUMAN HLA class I histocompatibility …           0.744 Good   
#> # ℹ 40 more rows