Skip to content

mecfs_bio.build_system.task.gwaslab.gwaslab_util

Classes:

  • Variant

    Represents a genetic variant.

Functions:

Variant

Represents a genetic variant.

Attributes:

chromosome instance-attribute

chromosome: int

effect_allele instance-attribute

effect_allele: str

id property

id: str

id_normalized property

id_normalized: str

non_effect_allele instance-attribute

non_effect_allele: str

position instance-attribute

position: int

df_to_variants

df_to_variants(df: DataFrame) -> list[Variant]
Source code in mecfs_bio/build_system/task/gwaslab/gwaslab_util.py
def df_to_variants(df: pd.DataFrame) -> list[Variant]:
    return [
        Variant(
            chromosome=df[GWASLAB_CHROM_COL].iloc[i],
            position=df[GWASLAB_POS_COL].iloc[i],
            effect_allele=df[GWASLAB_EFFECT_ALLELE_COL].iloc[i],
            non_effect_allele=df[GWASLAB_NON_EFFECT_ALLELE_COL].iloc[i],
        )
        for i in range(len(df))
    ]

gwaslab_download_ref_if_missing

gwaslab_download_ref_if_missing(ref: str) -> Path
Source code in mecfs_bio/build_system/task/gwaslab/gwaslab_util.py
def gwaslab_download_ref_if_missing(ref: str) -> Path:
    result = gl.get_path(ref)
    if not result:
        gl.download_ref(ref)
        result = gl.get_path(ref)
    return result