Skip to content

Fix missing FUN.VALUE in vapply call when resuming ped2com checkpoint#139

Merged
smasongarrison merged 2 commits intodev_mainfrom
copilot/fix-vapply-argument-missing
Mar 24, 2026
Merged

Fix missing FUN.VALUE in vapply call when resuming ped2com checkpoint#139
smasongarrison merged 2 commits intodev_mainfrom
copilot/fix-vapply-argument-missing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

When calling ped2com() with resume = TRUE, the .loadOrComputeParList function crashes because vapply is called without the required FUN.VALUE argument.

Change

R/buildComponent.R — add logical(1) as the FUN.VALUE template to vapply:

# Before
computed_indices <- which(!vapply(parList, is.null))

# After
computed_indices <- which(!vapply(parList, is.null, logical(1)))

This code path is only hit on resume (loading a saved parList checkpoint), which is why normal runs succeed while resumed runs fail.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug] can you help with Error in vapply(parList, is.null) : argument "FUN.VALUE" is missing, with no default</issue_title>
<issue_description> biggestPed <- BGmisc::ped2com(df_ped,
component = "additive",
verbose=run_verbose,gc=TRUE,
saveable = TRUE, resume=F,
save_rate_gen=3,
save_rate_parlist=25000000,
update_rate = 200,
sparse = TRUE,
adjacency_method="direct",
max.gen = max.gen,
save_path=paste0(outcome_name,'slimmed',slim_tree,'_add/'),
isChild_method="partialparent"
)

Family Size = 4020067
Building parent adjacency matrix...
Computing parent-child adjacency matrix...

Constructed sparse matrix
Initializing adjacency matrix...
Completed first degree relatives (adjacency)
Preparing checkpointing...
Creating save path...
Standardizing column names...
Family Size = 4020067
Building parent adjacency matrix...
Computing parent-child adjacency matrix...
Final checkpoint saved for adjacency matrix.
Constructed sparse matrix
Initializing adjacency matrix...
Completed first degree relatives (adjacency)
Computing isChild matrix...
About to do RAM path tracing
Completed 0 degree relatives
Completed 1 degree relatives
Completed 2 degree relatives
Completed 3 degree relatives
Completed 4 degree relatives
Completed 5 degree relatives
Completed 6 degree relatives
Completed 7 degree relatives
Completed 8 degree relatives
Completed 9 degree relatives
Completed 10 degree relatives
Completed 11 degree relatives
Completed 12 degree relatives
Completed 13 degree relatives
Completed 14 degree relatives
Completed RAM path tracing
Doing I-A inverse times diagonal multiplication
Doing tcrossprod
Error in .local(x, y = y, ...) :
CHOLMOD error 'out of memory' at file 'Utility/t_cholmod_realloc.c', line 80

biggestPed <- BGmisc::ped2com(df_ped,

  •                             component = "additive", 
    
  •                             verbose=run_verbose,gc=TRUE,
    
  •                             saveable = TRUE, resume=T,
    
  •                             save_rate_gen=3,
    
  •                             save_rate_parlist=25000000,
    
  •                             update_rate = 200,
    
  •                             sparse = TRUE,
    
  •                             adjacency_method="direct",
    
  •                             max.gen = max.gen,
    
  •                             save_path=paste0(outcome_name,'_slimmed_',slim_tree,'_add/'),
    
  •                             isChild_method="partialparent"
    
  • )
    Preparing checkpointing...

Standardizing column names...
Family Size = 4020067
Resuming: Loading parent-child adjacency data...

Error in vapply(parList, is.null) :
argument "FUN.VALUE" is missing, with no default</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix error in vapply with missing FUN.VALUE argument Fix missing FUN.VALUE in vapply call when resuming ped2com checkpoint Mar 24, 2026
Copilot AI requested a review from smasongarrison March 24, 2026 15:27
@smasongarrison smasongarrison changed the base branch from main to dev_main March 24, 2026 16:14
@smasongarrison smasongarrison marked this pull request as ready for review March 24, 2026 16:14
@smasongarrison smasongarrison merged commit f669457 into dev_main Mar 24, 2026
8 checks passed
smasongarrison added a commit that referenced this pull request Mar 24, 2026
…kpoint (#139)

* Initial plan

* Fix vapply missing FUN.VALUE argument in .loadOrComputeParList

Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/R-Computing-Lab/BGmisc/sessions/93bb6734-9e37-4cd1-b415-9d67049126ca

---------

Co-Authored-By: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-Authored-By: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.47%. Comparing base (8a7ce30) to head (7178c20).
⚠️ Report is 2 commits behind head on dev_main.

Files with missing lines Patch % Lines
R/buildComponent.R 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           dev_main     #139   +/-   ##
=========================================
  Coverage     84.47%   84.47%           
=========================================
  Files            30       30           
  Lines          4973     4973           
=========================================
  Hits           4201     4201           
  Misses          772      772           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@smasongarrison smasongarrison deleted the copilot/fix-vapply-argument-missing branch March 27, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] can you help with Error in vapply(parList, is.null) : argument "FUN.VALUE" is missing, with no default

2 participants