Skip to content

bind_rows() type-mismatch crash in OncoKB MAF processing (v2.3.1) #300

Closed

Description

@sigven

Summary

pcgr v2.3.1 can crash during report generation when OncoKB web-API annotation is enabled, with an error like:

Error in `dplyr::bind_rows()`:
! Can't combine `..1$MUTATION_EFFECT_CITATIONS` <character> and `..2$MUTATION_EFFECT_CITATIONS` <double>.
  • Version of PCGR: 2.3.1
  • Genome build: grch38
  • Full error / traceback: see below
  • Occurs during: pcgrr::generate_report() → load_somatic_snv_indel() → load_dna_variants() → process_oncokb_maf()

Observed frequency: in a batch run of ~300 WES tumor-control sarcoma samples, this affected roughly 1–2% of samples — consistent with the root cause below, since it depends on the specific mix of OncoKB annotation values present in each sample's MAF output rather than being deterministic.

Full traceback
Error in `dplyr::bind_rows()`:
! Can't combine `..1$MUTATION_EFFECT_CITATIONS` <character> and `..2$MUTATION_EFFECT_CITATIONS` <double>.
Backtrace:
     ▆
  1. ├─pcgrr::generate_report(yaml_fname = yaml_fname)
  2. │ └─pcgrr::load_somatic_snv_indel(...)
  3. │   └─pcgrr::load_dna_variants(...)
  4. │     └─pcgrr::process_oncokb_maf(...)
  5. │       └─dplyr::bind_rows(all_variant_annotations, var)
  6. │         └─vctrs::vec_rbind(!!!dots, .names_to = .id, .error_call = current_env())
  7. └─vctrs (local) `<fn>`() at work/R/bind.R:194:3
  8.   └─vctrs::vec_default_ptype2(...)
  9.     ├─base::withRestarts(...) at work/R/type2.R:178:3
 10.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
 11.     │   └─base (local) doWithOneRestart(return(expr), restart)
 12.     └─vctrs::stop_incompatible_type(...) at work/R/type2.R:178:3
 13.       └─vctrs:::stop_incompatible(...) at work/R/conditions.R:146:3
 14.         └─vctrs:::stop_vctrs(...) at work/R/conditions.R:95:3
 15.           └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call) at work/R/conditions.R:65:3
Execution halted

Root cause

process_oncokb_maf() reads the OncoKB-annotated HGVSp and HGVSg MAF files as two separate readr::read_tsv() calls without explicit col_types. readr guesses each column's type independently per file by sampling rows. Sparsely-populated pass-through columns from the OncoKB annotator (e.g. MUTATION_EFFECT_CITATIONS) can therefore be guessed as different types (character vs. double/logical) between the two files. Rows from both files are later combined into a single accumulator via dplyr::bind_rows(), which fails once a type mismatch is present — this only surfaces for the subset of samples/variants where the divergence actually occurs, which is why it only hit ~1-2% of samples rather than every run.

Fix

A fix is in place on the dev branch (not yet released): both read_tsv() calls in process_oncokb_maf() now force col_types = readr::cols(.default = readr::col_character()), so column types are stable and identical across both files regardless of what readr's per-file sampling would otherwise guess.

This will be included in the next release. Until then, users hitting this error can work around it by disabling OncoKB web-API annotation, or by building pcgrr from the dev branch.

Activity

  1. sigven commented on Aug 10, 2026

    @sigven
    OwnerAuthor

    Fixed in version 2.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions