Conversation
This branch has not been deployed
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.
Functional SuSiE already fits all probes in a region jointly, but the joint engine post-processes and stores that same fit once per probe. Each entry carries the full variants-by-features coefficient matrix. This can make the serialized result grow far beyond the memory used to fit the model: the motivating regional output was approximately 277 GiB compressed. At the same time, default trimming removes the functional curves and uncertainty needed to plot the result.
This change keeps one ordinary trimmed fSuSiE entry per joint group, retains its functional summaries, and preserves the existing inputs for colocalization.
Joint fSuSiE output
R/jointEngine.Rcontinues to fit the complete X/Y matrices once. It calls the existing post-processing function forr = 1Land returnslist(entry), instead of post-processing the same joint fit once for every trait. All trait names and positions are recorded on the saved fit for functional export.This fixes duplication in the result assembly, not repeated model fitting. It also avoids repeated post-processing. Smaller regions can complete and serialize with the old code; many probes and a large coefficient matrix expose the storage cost. Ordinary R list sharing during fitting does not make repeated serialized payloads free.
Output-contract change: the retained row has the first trait's identity, conditional summary, and optional CV slice. Separate conditional summaries for the remaining probes are no longer emitted. Their names/positions and the full joint functional curves are retained. This does not assume that probe-specific conditional summaries are identical. PC SuSiE rows follow their existing path.
Trimming and functional accessors
The fSuSiE branch of
trimFinemappingFit()retainsfitted_func,cred_band,outing_grid,cs,csd_X, andlfsr_func, alongside the previously retainedcoef. The base trimmer still suppliesalpha,lbf_variable, credible sets, and the other colocalization summaries. Wavelet matrices and the full untrimmed object are discarded as before.The existing native band calculation runs while reconstruction fields are available. This is necessary even when
cred_bandexists: fsusieR 0.2.97 withpost_processing = "none"can initialize it with zero-filled placeholder matrices. After trimming, the existing curve/affected-region accessors reuse the saved bands. Previously these accessors required wavelet fields, so a successfully written trimmed fit could not provide its functional curve summaries. This is a retention/interface defect, independent of whether TI is enabled.No new storage class, shared environment, package injection, or trim flag is introduced. SuSiE, SuSiE-RSS, and mvSuSiE fitting/trimming branches are unchanged.
Validation
The equivalent 0.6.12 backport, 7dde6d3, was installed and tested in the existing analysis environment:
jointEngine,fineMappingWrappers,fsusieAccessors, andcolocPipelinetest files passed. Two missing-package tests skipped because those packages were installed; one existing zero-variance-column warning was expected.TIandnone: trimmed-fit serialization retains curves/bands, affected-region accessors work, log Bayes factors agree with the untrimmed fit, andcoloc::coloc.bf_bfruns successfully.This PR ports the same change to current upstream's
FineMappingRowand joint-group accessors. Follow-up validation passed the focusedfineMappingRowtests and the canonical xQTL SoS export fixture against the patched 0.8.2 package in an isolated R 4.5 library. The actual loaded package version and library path were verified. Old RDS files whose curves were already discarded require refitting to obtain those curves.The existing pipeline-level expectations are deliberately retained: they still expect two per-probe rows and therefore expose the intended one-row output-contract change as five assertion failures. They have not been rewritten to make CI green. The existing CI test command now sets
stop_on_failure = TRUE; previouslydevtools::test()printed failed assertions while exiting successfully on macOS/ARM, which skip the separate Linux coverage step.