Examples Module

ideal_genom.get_examples.get_bmi_japanese_gwas_sex_dependent() Path

Download and process sex-dependent BMI GWAS data from the Japanese Biobank (BBJ).

This function: 1. Downloads a supplementary Excel file from a 2017 Nature Genetics paper 2. Extracts relevant SNP information including sex-specific associations 3. Filters for SNPs with rs IDs 4. Converts the data to CSV format with columns: SNP, Sex, CHR, POS 5. Removes the original Excel file after processing

The study is the BioBank Japan GWAS which analyzed sex-dependent genetic effects on BMI.

Returns:

Path – GWAS results

Return type:

Path to the processed CSV file containing the sex-dependent BMI

Note

If the CSV file already exists, it will not be re-downloaded or processed.

ideal_genom.get_examples.get_height_japanese_gwas() tuple

Downloads and prepares Japanese GWAS (Genome-Wide Association Studies) data for height.

This function retrieves data from the Japanese Biobank (BBJ) for both female and male subjects. If the data files already exist locally, it returns their paths without downloading. Otherwise, it downloads the zip archive, extracts the relevant files, and decompresses them.

Returns:

tuple

  • Path to the female height GWAS data file

  • Path to the male height GWAS data file

Return type:

A tuple containing two Path objects:

Notes

  • The data is downloaded from the Japanese Database of Clinical and Genomic Data, specifically the hum0014 dataset version 6 with 158k samples.

  • Akiyama, Masato, et al. Characterizing rare and low-frequency height-asssociated variants in the Japanese population. Nature Communications 10, (2019): 4393. https://doi.org/10.1038/s41467-019-12276-5

ideal_genom.get_examples.get_top_cond_trumpet_quantitative() Path

Downloads and processes conditional analysis data for height-associated variants from BBJ study.

This function retrieves conditional analysis data for height-associated variants from a BBJ (BioBank Japan) 2019 study. It downloads an Excel file from the provided URL, extracts relevant columns (rsID, candidate genes, chromosome, and position), filters for autosomal variants, and saves the processed data as a tab-separated CSV file.

The function checks if the processed CSV file already exists before downloading to avoid redundant operations. After processing, the original Excel file is deleted to save space.

Returns:

Path – for height-associated variants.

Return type:

Path to the processed CSV file containing the top conditional analysis hits

Side effects

  • Downloads an Excel file from an external URL if not already processed

  • Creates a CSV file in the data/sumstats directory

  • Removes the downloaded Excel file after processing

ideal_genom.get_examples.get_top_loci_trumpet_quantitative() Path

Downloads and processes top genetic loci data from a GWAS study on height.

This function retrieves a dataset from the supplementary materials of a Biobank Japan (BBJ) height GWAS study published in Nature Communications (2019). It downloads an Excel file containing significant loci, extracts relevant columns, filters out X chromosome variants, and saves the processed data as a CSV file.

Returns:

Path

Return type:

Path to the processed CSV file containing filtered top genetic loci.

Notes

  • The function checks if the processed CSV already exists before downloading

  • The original Excel file is deleted after processing

  • Only autosomal variants are kept (X chromosome variants are filtered out)

  • The processed file contains ‘Variants’ and ‘New_Locus’ columns

ideal_genom.get_examples.get_trumpet_binary_example() Path

Downloads and prepares a GWAS summary statistics file for analysis. This function retrieves a specific GWAS summary statistics file (GCST90278092) from the EBI FTP server. It checks if the file already exists locally before downloading. After download, it decompresses the gzipped file.

Returns:

Path

Return type:

Path to the uncompressed GWAS summary statistics file.

Notes

  • The file is stored in the ‘data/sumstats’ directory relative to the package root

  • If the file already exists locally, no download is performed

  • The original gzipped file is removed after decompression

ideal_genom.get_examples.get_trumpet_quantitative_example() Path

Downloads and extracts a quantitative GWAS summary statistics example file for generating a trumpet plot. This function checks if the BBJ Height GWAS summary statistics file already exists in the local data directory. If not, it downloads the file from the Human Database (DBCLS), extracts it from the zip archive, decompresses the gzipped file, and saves it to the data/sumstats directory.

Returns:

Path – (2019_BBJ_Height_autosomes_BOLT.txt)

Return type:

Path to the extracted and decompressed GWAS summary statistics file

Side effects

  • Creates directories if they don’t exist

  • Downloads files from the internet if necessary

  • Extracts and decompresses files