示例#1
0
文件: traits.py 项目: saulwiggin/arv
def biological_age(genome):
    """Biological aging (telomere lengths)."""
    assert_european(genome)

    ages = {
        "rs10936599": {"TT": 7.82, "CT":  3.91, "CC":  0,    None: 0},
        "rs2736100":  {"AA": 3.14, "AC": 0,     "CC": -3.14, None: 0},
        "rs9420907":  {"AA": 0,    "AC": -2.76, "CC": -5.52, None: 0},
        "rs755017":   {"AA": 0,    "AG": -2.47, "GG": -4.94, None: 0},
        "rs11100479": {"CC": 5.98, "CT": -2.99, "TT":  0,    None: 0},
        "rs10165485": {"TT": 0,    "CT": -2.23, "CC": -4.46, None: 0},
    }

    age = [unphased_match(genome[rsid], t) for (rsid, t) in ages.items()]

    def qual(age):
        if age <= 0:
            return "younger"
        elif age > 0:
            return "older"

    msg = "From %.1f years %s to %.1f years %s than actual age\n" % (
            abs(min(age)), qual(min(age)), abs(max(age)), qual(max(age)))
    msg += "The sum is %.1f years %s, compared to actual age" % (
            abs(sum(age)), qual(sum(age)))
    return msg
示例#2
0
文件: traits.py 项目: saulwiggin/arv
def eye_color(genome):
    "Eye color."
    assert_european(genome)
    return unphased_match(genome["rs12913832"], {
        "AA": "Brown eyes, although 14% have green and 1% have blue",
        "AG": "Most likely brown or green, but 7% have blue",
        "GG": "Most likely blue, but 30% have green and 1% brown",
        None: "Unable to determine"})
示例#3
0
文件: traits.py 项目: saulwiggin/arv
def blood_glucose(genome):
    """Blood glucose."""
    assert_european(genome)
    return unphased_match(genome["rs560887"], {
        "CC": "Average fasting plasma glucose levels of 5.18mmol/L",
        "CT": "Average fasting plasma glucose levels of 5.12mmol/L",
        "TT": "Average fasting plasma glucose levels of 5.06mmol/L",
        None: "Unable to determine"})
示例#4
0
文件: traits.py 项目: saulwiggin/arv
def aspargus_detection(genome):
    """Aspargus metabolite detection."""
    assert_european(genome)
    return unphased_match(genome["rs4481887"], {
        "AA": "Higher odds of smelling aspargus in urine",
        "AG": "Medium odds of smelling aspargus in urine",
        "GG": "Typical odds of smelling aspargus in urine",
        None: "Unable to determine"})
示例#5
0
文件: traits.py 项目: saulwiggin/arv
def heroin_addiction(genome):
    """Heroin addiction."""
    assert_european(genome)
    return unphased_match(genome["rs1799971"], {
        "AA": "Typical odds of addiction",
        "AG": "Higher odds of addiction",
        "GG": "Higher odds of addiction",
        None: "Unable to determine"})
示例#6
0
文件: traits.py 项目: saulwiggin/arv
def caffeine_metabolism(genome):
    """Caffeine metabolism."""
    assert_european(genome)
    return unphased_match(genome["rs762551"], {
        "AA": "Fast metabolizer",
        "AC": "Slow metabolizer",
        "CC": "Slow metabolizer",
        None: "Unable to determine"})
示例#7
0
文件: traits.py 项目: saulwiggin/arv
def smoking_behaviour(genome):
    """Smoking behaviour."""
    assert_european(genome)
    return unphased_match(genome["rs1051730"], {
        "AA": "Likely to smoke more than average",
        "AG": "Likely to smoke a little bit more than average",
        "GG": "Likely to smoke typical amount of cigarettes per day",
        None: "Unable to determine"})
示例#8
0
文件: traits.py 项目: saulwiggin/arv
def birth_weight(genome):
    """Birth weight."""
    assert_european(genome)
    weights = {
        "rs7903146": {"TT":   0, "CT": -30, "CC": -60, None: 0},
        "rs1799884": {"TT": +54, "CT": +27, "CC":   0, None: 0},
    }
    weight = [unphased_match(genome[rsid], w) for (rsid, w) in weights.items()]
    return "From %.1fg to %.1fg (sum: %.1fg) compared to typical weight" % (
            min(weight), max(weight), sum(weight))
示例#9
0
文件: traits.py 项目: saulwiggin/arv
def breastfeeding_iq(genome):
    "Breastfeeding and IQ."
    assert_european(genome)
    s = ""

    if "C" in str(genome["rs174575"].genotype):
        s += "Being breastfed raised subjects' IQ by 6-7 points on average (rs174575)\n"
    else:
        s += "Little to no effect of being breastfed on IQ (rs174575)\n"

    if "A" in str(genome["rs1535"].genotype):
        s += "Being breastfed raised subjects' IQ by 4-5 points on average (rs1535)\n"
    else:
        s += "Little or no effect of being breastfed on IQ (rs1535)\n"

    return s
示例#10
0
文件: traits.py 项目: saulwiggin/arv
def hair_curl(genome):
    assert_european(genome)
    return unphased_match(genome["rs17646946"], {
        "AA": "Straighter hair on average",
        "AG": "Straighter hair on average",
        "GG": "Slightly curlier hair on average"})