Пример #1
0
def get_r_human_readable(pop: str, var1: str, var2: str, ref_genome: str = "GRCh37"):
    bm = ld_matrix(pop).bm()
    ht = ld_index(pop).ht()
    chrom, pos, ref, alt = var1.split("-")
    var1 = (hl.parse_locus(f"{chrom}:{pos}", ref_genome), [ref, alt])
    chrom, pos, ref, alt = var2.split("-")
    var2 = (hl.parse_locus(f"{chrom}:{pos}", ref_genome), [ref, alt])
    return get_r_for_pair_of_variants(bm, ht, var1, var2)
Пример #2
0
def get_r_within_gene_in_pop(pop: str, gene: str):
    """
    Gets LD information (`r`) for all pairs of variants within `gene` for a given `pop`.

    Warning: this returns a table quadratic in number of variants. Exercise caution with large genes.

    :param pop: Population for which to get LD information
    :param gene: Gene symbol as string
    :return: Table with pairs of variants
    """
    return get_r_within_gene(
        ld_matrix(pop).bm(),
        ld_index(pop).ht(), gene, None, 'GRCh37')