Add fgseaBatch: batch preranked GSEA over multiple stats vectors in o…#1
Merged
Conversation
…ne C++ call
- fgsea_batch_cpp() (src/rcpp_glue.cpp): Rcpp export that accepts H sorted
stats vectors and precomputed pathway positions, builds
std::vector<FgseaInput> at the R->C++ boundary, then dispatches:
GPU path: sequential for-loop (each HOG fully saturates the device)
CPU path: std::for_each(par_unseq) over HOG indices via TBB
Returns flat List with hog_idx (1-based), pathway, pval, padj, ES, NES,
nMoreExtreme, size, leadingEdge (1-based gene indices), pi0.
- fgseaBatch() (R/fgsea.R): R wrapper; precomputes sorted stats and pathway
positions on the R side (reuses .prepareStats / .pathwayPositions),
calls fgsea_batch_cpp, converts leading-edge indices back to gene names,
returns data.table with extra hog_idx column plus standard fgsea columns.
- NAMESPACE: export(fgseaBatch)
- README.md: document fgseaBatch in usage example and entry-points table
Motivation: eliminates per-query R dispatch overhead; on CPU enables TBB
parallel processing of queries rather than a sequential R for-loop; on GPU
ensures the device is kept busy across many independent queries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ne C++ call
fgsea_batch_cpp() (src/rcpp_glue.cpp): Rcpp export that accepts H sorted stats vectors and precomputed pathway positions, builds std::vector at the R->C++ boundary, then dispatches: GPU path: sequential for-loop (each HOG fully saturates the device) CPU path: std::for_each(par_unseq) over HOG indices via TBB Returns flat List with hog_idx (1-based), pathway, pval, padj, ES, NES, nMoreExtreme, size, leadingEdge (1-based gene indices), pi0.
fgseaBatch() (R/fgsea.R): R wrapper; precomputes sorted stats and pathway positions on the R side (reuses .prepareStats / .pathwayPositions), calls fgsea_batch_cpp, converts leading-edge indices back to gene names, returns data.table with extra hog_idx column plus standard fgsea columns.
NAMESPACE: export(fgseaBatch)
README.md: document fgseaBatch in usage example and entry-points table
Motivation: eliminates per-query R dispatch overhead; on CPU enables TBB parallel processing of queries rather than a sequential R for-loop; on GPU ensures the device is kept busy across many independent queries.