Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error handling when one of the pileup fails #179

Closed
teng-gao opened this issue Mar 17, 2024 · 0 comments
Closed

Better error handling when one of the pileup fails #179

teng-gao opened this issue Mar 17, 2024 · 0 comments

Comments

@teng-gao
Copy link
Collaborator

In multi-sample mode of pileup_and_phase.R, pileup produces empty VCF in one of the samples (because the BAM is truncated), but script was not interrupted. Phasing did not happen and gives below error. When run on single-sample mode the script correctly stops.

character(0)
Creating VCFs
Error in `mutate()`:
ℹ In argument: `snp_index = 1:n()`.
Caused by error:
! `snp_index` must be size 0 or 1, not 2.
Backtrace:
   ▆
 1. ├─numbat:::genotype(...)
 2. │ ├─... %>% arrange(CHROM, POS)
 3. │ └─base::lapply(...)
 4. │  └─numbat (local) FUN(X[[i]], ...)
 5. │   └─numbat:::get_snps(vcf)
 6. │    └─... %>% filter(!is.na(AR))
 7. ├─dplyr::arrange(., CHROM, POS)
 8. ├─dplyr::mutate(., AR = AD/DP)
 9. ├─dplyr::summarise(...)
 10. ├─dplyr::group_by(., CHROM, POS, REF, ALT, snp_id)
 11. ├─dplyr::bind_rows(.)
 12. │ └─rlang::list2(...)
 13. ├─dplyr::filter(., !is.na(AR))
 14. ├─dplyr::mutate(., AR = AD/DP)
 15. ├─dplyr::mutate(., snp_index = 1:n())
 16. ├─dplyr:::mutate.data.frame(., snp_index = 1:n())
 17. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
 18. │  ├─base::withCallingHandlers(...)
 19. │  └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
 20. │   └─mask$eval_all_mutate(quo)
 21. │    └─dplyr (local) eval()
 22. ├─dplyr:::dplyr_internal_error(...)
 23. │ └─rlang::abort(class = c(class, "dplyr:::internal_error"), dplyr_error_data = data)
 24. │  └─rlang:::signal_abort(cnd, .file)
 25. │   └─base::signalCondition(cnd)
 26. └─dplyr (local) `<fn>`(`<dpl:::__>`)
 27.  └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
Execution halted
@teng-gao teng-gao changed the title snp_index must be size 0 or 1, not 2. Better error handling when one of the pileup fails Mar 17, 2024
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

No branches or pull requests

1 participant