Skip to content

mecfs_bio.analysis.portas_sleep_analysis

Script to analyze the device-measured sleep GWAS of Portas et al. (2026).

Functions:

  • run_portas_sleep_analysis –

    Apply the standard analysis pipeline to the sleep duration, sleep efficiency, REM sleep duration,

run_portas_sleep_analysis

run_portas_sleep_analysis() -> None

Apply the standard analysis pipeline to the sleep duration, sleep efficiency, REM sleep duration, and non-REM sleep duration GWAS of Portas et al. (2026). Analysis includes: - Extraction of lead variants. - Application of MAGMA to GTEx data to identify possible key tissues. - Application of MAGMA to human brain atlas to identify key brain tissue - Use of S-LDSC to investigate key cell and tissue types - Estimation of SNP heritability via LDSC

Source code in mecfs_bio/analysis/portas_sleep_analysis.py
def run_portas_sleep_analysis() -> None:
    """
    Apply the standard analysis pipeline to the sleep duration, sleep efficiency, REM sleep duration,
    and non-REM sleep duration GWAS of Portas et al. (2026).
    Analysis includes:
    - Extraction of lead variants.
    - Application of MAGMA to GTEx data to identify possible key tissues.
    - Application of MAGMA to human brain atlas to identify key brain tissue
    - Use of S-LDSC to investigate key cell and tissue types
    - Estimation of SNP heritability via LDSC
    """
    DEFAULT_RUNNER.run(
        PORTAS_SLEEP_DURATION_STANDARD_ANALYSIS.get_terminal_tasks()
        + PORTAS_SLEEP_EFFICIENCY_STANDARD_ANALYSIS.get_terminal_tasks()
        + PORTAS_REM_SLEEP_DURATION_STANDARD_ANALYSIS.get_terminal_tasks()
        + PORTAS_NREM_SLEEP_DURATION_STANDARD_ANALYSIS.get_terminal_tasks(),
        incremental_save=True,
        must_rebuild_transitive=[],
    )