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.
Regional fSuSiE results need both reusable fine-mapping summaries for colocalization and the fitted functional effects for plotting. The existing workflow only declares the regional RDS, and trimmed fSuSiE fits have discarded the curve fields needed for an effect export. This PR adds the combined top-loci/effect table to the existing workflow, paired with pecotmr #600, which retains those fields and stores each joint fit once.
fine_mapping.RAfter writing a regional fSuSiE result, export the retained grid curves, native uncertainty bands, probe names/positions, and interpolated probe effects alongside credible-set variants. The table follows the existing 19-column bulk epigenetic export schema and appends
grid_band_halfwidth, a semicolon-packed vector aligned withgrid_positions. The saved native bands can be reconstructed asgrid_effects -/+ grid_band_halfwidth; the column is not a standard error. Symmetry is checked before reducing the two band rows to half-widths.Probe effects use linear interpolation with constant endpoint extrapolation, matching the existing epigenetic exporter. A variant belonging to multiple credible sets has one row per effect. A region with no credible sets writes the same header with no data rows. The RDS still retains all fitted effects.
The QTL region argument is converted from its CLI string into
GenomicRanges::GRangesat the wrapper boundary. This uses pecotmr's supported region type and fixes the overlap-selection failure exposed by regional calls. Gene-ID and GWAS input modes do not use this branch.The exporter selects a one-row collection and calls the public
getSusieFit(),getVariantIds(), andgetTopLoci()accessors. The original draft directly readx$entry[[i]], which works on 0.6.12 but returns NULL on the current GRangesList-based result. CI exposed that reader defect asgetSusieFit(NULL). The fit had been saved; it was the lookup that failed.The exporter runs only for regional fSuSiE calls and fails clearly if an old fit lacks the required functional fields. Existing trimmed files cannot regenerate discarded curves; they need refitting. Successful RDS serialization alone did not demonstrate that plotting information was available: this is an output-contract gap, not a file-format artifact.
mnm_regression.ipynband the shared Snakemake targetfsusie_2declares both the RDS and regional BED.fsusie_3combines regional BEDs into one sorted, bgzipped, tabix-indexed table per configured name. It uses the same notebook and scripts as the fit; there is no separate exporter workflow.The existing local shared fSuSiE rule module and its small phenotype-manifest builder are included here so the upstream shared Snakefile can declare the complete target, including the final table/index. This accounts for most of the added workflow lines. The rule builds the QtlDataset once per context, selects TADs, and invokes the canonical notebook. It forwards chromosome scope, memory, walltime, PC count, and post-processing. TI remains the default; the application configs now state TI explicitly. This path does not invoke TWAS-weight training.
Validation and compatibility
qtl_dataset_construct+fsusieSoS test passed on the committed chr22 fixture with TI and one PC per context, using both patched pecotmr 0.6.12 and patched 0.8.2. It produced four result rows (one joint fSuSiE fit and one PC fit per context), a nonempty 20-column table, aligned effects/positive band widths, and a tabix index that answered a regional query.Protocol CI installs the immutable companion pecotmr revision from PR #600 before running its existing tests. The released 0.8.2 package lacks the retained curves; testing against that release cannot validate the new export. The source pin can be replaced with a released dependency after the package change ships.
The five pipeline-level assertions in the companion package PR retain the old per-probe row expectations at the author's request. They deliberately expose the output-contract difference; this exporter repair does not change those test expectations.