Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export(MrmashOptions)
export(MrmashPriorParam)
export(MrmashRssOptions)
export(MultiStudyQtlDataset)
export(MvsusieMixturePriorOptions)
export(MvsusieOptions)
export(MvsusieRssOptions)
export(NcvregOptions)
Expand Down Expand Up @@ -157,6 +158,7 @@ export(blockMetadata)
export(buildLdEigen)
export(buildLdScore)
export(buildMrmashPriorMatrices)
export(buildMvsusieMixturePrior)
export(buildTopLoci)
export(calculateFeatureScores)
export(causalInferencePipeline)
Expand Down Expand Up @@ -220,19 +222,18 @@ export(fineMappingResult)
export(fineMappingRow)
export(finemapCtwasRegions)
export(fitFsusie)
export(fitGlmnetCv)
export(fitMashContrast)
export(fitMvsusie)
export(fitMvsusieRss)
export(fitRetention)
export(fitSusieInfThenSusieRss)
export(flattenTupleRanges)
export(formatFinemappingOutput)
export(frqData)
export(fsusieAffectedRegions)
export(fsusieCredibleBand)
export(fsusieGetCs)
export(fsusieWeights)
export(fsusieWrapper)
export(fullFit)
export(genomicRegion)
export(genotypeCovariates)
Expand Down
30 changes: 30 additions & 0 deletions R/MethodOptions.R
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,36 @@ setClass("MethodOptions", contains = "SimpleList")
))
}

# Refuse names for a reason OTHER than pecotmr supplying them -- a name the
# engine does not have, or one it has that pecotmr will not expose. Those
# cannot go through .configRefuseOwned(), whose message promises the value
# would be overwritten and names where to set it instead; here there is no
# such place, so the reason is stated outright. `unavailable` is a named
# character vector, name = the refused argument, value = why, read as
# "`<name>` cannot be set here: <why>".
#
# This exists for engines taking `...`, where an unknown name is accepted and
# silently ignored instead of reported (see .engineAcceptedNames). Everywhere
# else the engine's own formals are the check.
# @noRd
.configRefuseUnavailable <- function(extra, unavailable, label) {
clash <- intersect(names(extra), names(unavailable))
if (length(clash) == 0L) {
return(invisible(NULL))
}
why <- str_flatten(
sprintf(
"`%s` cannot be set here: %s",
clash,
unname(
unavailable[clash]
)
),
collapse = "; "
)
abort(glue("{label}: {why}."))
}

# TRUE for a record a constructor produced. Used by the pipelines to refuse a
# bare list, which is the whole point of requiring constructors.
# @noRd
Expand Down
22 changes: 14 additions & 8 deletions R/fineMappingPipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ combineFineMappingResults <- function(..., ldSketch = NULL) {
return(.fmFoldWeightsMv(Xtr, Ytr, coverage, userArgs, mvPrior))
}
if (token == "fsusie") {
return(.fmFoldWeightsFsusie(Xtr, Ytr, pos, userArgs))
return(.fmFoldWeightsFsusie(Xtr, Ytr, pos, coverage, userArgs))
}
NULL
}
Expand Down Expand Up @@ -1971,9 +1971,11 @@ combineFineMappingResults <- function(..., ldSketch = NULL) {

# Per-fold fsusie weights.
# @noRd
.fmFoldWeightsFsusie <- function(Xtr, Ytr, pos, userArgs) {
.fmFoldWeightsFsusie <- function(Xtr, Ytr, pos, coverage, userArgs) {
# coverage reaches the fold fit here for the same reason it does in the
# susie and mvsusie fold paths; L is left to susiF's default there too.
fsArgs <- .fmMergeUserArgs(
list(X = Xtr, Y = Ytr, pos = pos),
list(X = Xtr, Y = Ytr, pos = pos, covLev = coverage),
"fsusie",
userArgs
)
Expand Down Expand Up @@ -3501,14 +3503,18 @@ setMethod(
),
csHome["coverage"]
),
# Only what the pipeline ACTUALLY supplies. `prior`, `max_scale` and
# `max_SNP_EM` used to be listed here because this row described the
# retired fsusieWrapper(), which passed them; the pipeline calls
# fitFsusie() and never did, so refusing them closed the only path to
# setting them at all -- the same trap the `residual_variance` note
# above records.
"fsusieR::susiF" = c(
set_names(rep(fromData, 4L), c("X", "Y", "pos", "prior")),
set_names(rep(fromData, 3L), c("X", "Y", "pos")),
c(
L = "`maxNumSingleEffects()` on CredibleSetParam",
min_purity = "the wrapper's `minPurity`",
max_SNP_EM = "the wrapper's `maxSnpEm`",
cov_lev = "the wrapper's `covLev`",
max_scale = "the wrapper's `maxScale`"
cov_lev = "`csCoverage()` on CredibleSetParam",
min_purity = "`minAbsCorr()` on CredibleSetParam"
)
),
character(0)
Expand Down
Loading
Loading