aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations/gemma.py
blob: 9a972babc2d3ce13821b95db4763da2c0cfd2211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"""Procedures related gemma computations"""


def generate_pheno_txt_file(trait_filename: str,
                            values: str,
                            tmpdir: str = "/tmp") -> str:
    """Given VALUES, and TMPDIR, generate a valide traits file"""
    with open(f"{tmpdir}/gn2/{trait_filename}", "w") as _file:
        for value in values:
            if value == "x":
                _file.write("NA\n")
            else:
                _file.write(f"{value}\n")
    return f"{tmpdir}/gn2/{trait_filename}"