PoPS predicts gene scores from pathway features. Here gsea fits each model after excluding the chromosome of the genes it predicts. Features, optional marginal selection and posterior fitting use the training chromosomes.

Gene-association statistics are computed once upstream. The example below retrieves saved scores; the BLR stage reuses those responses. Chromosome-held-out fitting repeats feature selection, model fitting and prediction for each target chromosome, without recomputing gene associations.

Prepare gene scores and sets

library(gact)
library(gsea)

GAlist <- readRDS("C:/Users/gact/hsa.0.0.1/GAlist_hsa.0.0.1.rds")
scores <- getVEGAS(GAlist=GAlist, studyID="GWAS1")
annotation <- readRDS(file.path(GAlist$dirs["gsets"], "genesplus_annotation.rds"))
stat <- data.frame(gene=rownames(scores),
  chromosome=as.character(annotation$chr[match(rownames(scores), annotation$EnsemblID)]),
  score=scores[,1])
sets <- getFeatureSets(GAlist=GAlist, feature="Pathways", minsets=50)

Fit the models

fit <- pops(stat=stat, sets=sets, method="rr", threshold=0.05)
head(fit$predictions)

fit <- pops(stat=stat, sets=sets, method="bayesC",
  pi=0.001, nit=5000, nburn=1000, nrun=2,
  control=list(maximum_preparation_bytes=1536*1024^2))
head(fit$predictions)
fit$folds

fit <- pops(stat=stat, sets=sets, method="bayesR",
  pi=0.001, nit=5000, nburn=1000, nrun=2,
  control=list(maximum_preparation_bytes=1536*1024^2))
head(fit$predictions)
head(fit$features)

Bayesian PoPS reuses the native gsea/gbayes sampler. BayesC has a point mass and one nonzero variance; BayesR uses three nonzero variance scales. The defaults learn effect variance, residual variance and mixture weights. Inspect each chromosome’s posterior and chain diagnostics in fit$fits.

These calls use independent genes as a working covariance. Supply sampling=list(gene_covariance=blocks) for chromosome-contained covariance blocks. Bayesian threshold is optional; when omitted all features that vary in the training fold are fitted. Scores use training-centered features and posterior mean coefficients. They are gene priorities, not causal probabilities or individual polygenic scores. The chromosome-held-out prediction rule differs from qgg’s ordinary full-data pops() fit.

Recorded computational workload

The benchmark overview records preparation and one full-data BayesC/BayesR fit separately from the 22-fold validation calls above. All reruns use 17,955 saved gene scores and 1,324 Reactome sets. Gene-association statistics are reused, not recomputed in each fold.

With independent genes, no extra covariates and no screening, set-based Bayesian PoPS now computes training cross-products and held-out predictions directly from memberships. Adjusted and screened models retain general preparation. fit$timing$folds separates preparation, native BLR, posterior summaries and prediction for each fold. fit$timing$gene_statistics$seconds is NA because upstream gene-statistic computation is not measured by this call.

The full-data comparison uses two chains and the same PoPS prior and learning settings as validation, with 1,000 burn-in plus 5,000 sampling sweeps. The dated rerun report contains exact phase clocks and provenance. A direct R interface is also available as gsea::blr(); the earlier one-chain qgg-oriented native probe uses different controls and is retained only as historical evidence. Timings do not establish convergence or prediction accuracy.