Conversation
TWAS weights released on Synapse use the legacy list layout, which pecotmr 0.8.x does not read. This adds a protocol-level conversion layer, as agreed, rather than a backwards-compatibility loader in pecotmr. - twas_weights_conversion.R: convert legacy weight RDS (univariate and multicontext) into one pecotmr TwasWeights per gene. Weights and CV metrics are copied unchanged; carries traitPos (gene TSS) for cTWAS block placement; writes the xqtl_meta row and the context -> data type rows. - twas_ctwas.ipynb: new optional twas_weights_conversion workflow (skip it for weights already in TwasWeights format), with Input/Output/MWE docs and the Overview updated; MWE commands now use the converted example tables. - ctwas_1: --gwas_study now selects the GWAS (cTWAS takes one per LD block) and the run fails early if several remain; new --ctwas_method (weights with several methods and no ensemble); pass the chromosome's genotype prefix as --ld-sketch so ctwasPipeline sees a real LD file rather than a "<chrom-meta>" placeholder. - ctwas_assemble.R: drop study elements and LD blocks with no GWAS variants (they carry no genome build and broke combineGwasSumStats). Tested: conversion is exact for eQTL, pQTL and sQTL weights (weights compared element by element); TWAS runs on converted weights for 8 studies in the APOE region; cTWAS assemble passes. cTWAS parameter estimation and fine-mapping are not yet tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Csueazw8VDi9a3mhLvgjQg
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.
TWAS weights released on Synapse use the legacy list layout, which pecotmr 0.8.2 does not read. This adds a protocol-level conversion layer, as agreed, rather than a backwards-compatibility loader in pecotmr.
twas_weights_conversion.R: convert legacy weight RDS (univariate and multicontext) into one pecotmr TwasWeights per gene. Weights and CV metrics are copied unchanged; carries traitPos (gene TSS) for cTWAS block placement; writes the xqtl_meta row and the context -> data type rows.twas_ctwas.ipynb: new optional twas_weights_conversion workflow (skip it for weights already in TwasWeights format), with Input/Output/MWE docs and the Overview updated; MWE commands now use the converted example tables.ctwas_1: --gwas_study now selects the GWAS (cTWAS takes one per LD block) and the run fails early if several remain; new --ctwas_method (weights with several methods and no ensemble); pass the chromosome's genotype prefix as --ld-sketch so ctwasPipeline sees a real LD file rather than a "" placeholder.ctwas_assemble.R: drop study elements and LD blocks with no GWAS variants (they carry no genome build and broke combineGwasSumStats).Tested: conversion is exact for eQTL, pQTL and sQTL weights (weights compared element by element); TWAS runs on converted weights for 8 studies in the APOE region; cTWAS assemble passes. cTWAS parameter estimation and fine-mapping are not yet tested.