Unify compact top-loci export and SuSiE-Inf as the option for univaraite pipeline#504
Merged
Conversation
This update adds two fine-mapping output improvements while preserving existing default behavior. First, univariate fine-mapping can now bypass SuSiE-inf initialization when ordinary SuSiE fitting is explicitly requested. The SuSiE-inf path remains the default for compatibility, and TWAS-weight generation continues to require the existing SuSiE-inf workflow. Second, SuSiE wrapper output now includes a unified top-loci export table alongside the existing wrapper-facing summaries. The export keeps posterior effect summaries separate from marginal association fields, preserves credible-set membership including overlapping credible sets, and leaves existing top_loci and top_loci_long contracts unchanged. Focused regression tests cover the direct SuSiE path and the unified top-loci export contract.
Unify compact top-loci export at one wrapper boundary Major: - build_top_loci_long now emits the full annotated long: posterior conditional_effect / conditional_effect_se, cs_purity, per-fit n / variant_number / gene_id, and caller-supplied region / event_ID. - Adds build_top_loci_export(long): pure projection of the annotated long to the fixed 21-column compact export schema; stops on missing required columns rather than silently filling NA. Minor: - build_top_loci_long gains 3 default-NULL params (data_x, data_y, other_quantities); existing callers omitting them are unchanged. - .postprocess_finemapping_fit_common passes those through unchanged. - other_quantities reserves two subfield names for the unified export: region, condition_id (alongside the existing dropped_samples use). - .empty_top_loci_long extended with the new columns so empty and populated long share one schema. - Adds focused unit tests covering the new columns, the per-fit constants, the export helper schema, and the missing-column error. Loader, univariate_analysis_pipeline, and format_finemapping_output are unchanged. transMap-side adoption is out of scope of this commit.
gaow
reviewed
May 30, 2026
| coverage = c(0.95, 0.7, 0.5), | ||
| min_abs_corr = 0.8, | ||
| finemapping_extra_opts = list(refine = TRUE), | ||
| fit_susie_inf = TRUE, |
Contributor
There was a problem hiding this comment.
could you change this to add_susie_inf otherwise users might think we can only fit one model at a time not another.
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.
Unify SuSiE top-loci output: one helper, one table
Major
build_top_loci_long/_wide/_exporttrio with singlebuild_top_loci()returning one 22-column table.postprocess_finemapping_fits()runs one method for-loop and rbinds per-method rows;format_finemapping_output()exposes onlytop_loci.Minor
build_top_loci()keeps the old long-builder input shape;data_x/data_y/other_quantitiesstay default-NULL.other_quantitiesreservesregionandcondition_id(alongsidedropped_samples).FineMappingResultS4 slot keeps legacy shape via back-compat alias insidesusie_wrapper.R;AllClasses.R/AllMethods.R/vcf_writer.Runchanged.<method>_<idx>CS strings,<method>_0PIP-only, per-method independent CS numbering,cs_95_purity = 0rule, overlapping CS within/across methods, singletop_locifield, removed-trio absence.Final
top_loci(22 cols)#chr,start,end,a1,a2,variantgene,eventn,maf,beta,sepip,posterior_effect_mean,posterior_effect_se,cs_95,cs_70,cs_50,cs_95_puritymethod,grange_start,grange_endConventions
cs_95/cs_70/cs_50are character"<method>_<idx>"(e.g."susie_1","susie_inf_2"); PIP-only retained variants use"<method>_0". Each method numbers CS independently from 1.cs_95_purity= 0.95-coverage purity for the row's(method, cs_95);"<method>_0"rows carry0.(variant, gene, method, cs_membership)— overlapping CS within a method and the same variant across methods both produce separate rows.SuSiE-Inf as the option for univaraite pipeline
Univariate fine-mapping can now bypass SuSiE-inf initialization when ordinary SuSiE fitting is explicitly requested. The SuSiE-inf path remains the default for compatibility, and TWAS-weight generation continues to require the existing SuSiE-inf workflow.