Skip to content

mecfs_bio.assets.reference_data.genetic_map.genetic_map_hg38

Reference asset: the Eagle hg38 (GRCh38) genetic map and its parsed parquet.

Provides the per-position recombination rate (cM/Mb) for recombination tracks of GRCh38 locus plots, such as the coloc locus stack plots.

The raw map (genetic_map_hg38_withX.txt.gz) is space-separated with columns "chr position COMBINED_rate(cM/Mb) Genetic_Map(cM)"; the header names carry characters we would only rename away, so the download's read-spec renames the four columns positionally. Parsing is a plain read-plus-sort, so it is expressed as a PipeDataFrameTask (read via the download's read-spec, sort by CHR/POS, write parquet) rather than a bespoke task.

Attributes:

GENETIC_MAP_HG38 module-attribute

GENETIC_MAP_HG38 = PipeDataFrameTask.create(
    source_task=GENETIC_MAP_HG38_RAW,
    asset_id="genetic_map_hg38",
    out_format=ParquetOutFormat(),
    pipes=[SortPipe(by=[GWASLAB_CHROM_COL, GMAP_POS_COL])],
    backend="polars",
)

GENETIC_MAP_HG38_RAW module-attribute

GENETIC_MAP_HG38_RAW = DownloadFileTask(
    meta=ReferenceFileMeta(
        group="genetic_map",
        sub_group="hg38",
        sub_folder=PurePath("raw"),
        id=AssetId("genetic_map_hg38_eagle"),
        extension=".txt.gz",
        read_spec=DataFrameReadSpec(
            DataFrameTextFormat(
                separator=" ",
                has_header=True,
                column_names=_OUTPUT_COLUMNS,
                schema_overrides={
                    GWASLAB_CHROM_COL: pl.Int64(),
                    GMAP_POS_COL: pl.Int64(),
                    GMAP_RATE_COL: pl.Float64(),
                    GMAP_CM_COL: pl.Float64(),
                },
            )
        ),
    ),
    url="https://storage.googleapis.com/broad-alkesgroup-public/Eagle/downloads/tables/genetic_map_hg38_withX.txt.gz",
    md5_hash="70f0be81e1ad1314ccc88e48091bcba1",
)