INNER CODE UNIT · Python

run_king

brentp/peddy · peddy/king.py:6

def run_king(vcf_path, ped_obj):

    king = which('king')
    if king is None:
        raise Exception("requested king analysis, but king executable not found")
    plink = which('plink')
    if plink is None:
        raise Exception("requested king analysis, but plink executable not found")
    out = os.path.basename(vcf_path)
    if out.endswith(".gz"):
        out = out[:-3]
    if out.endswith(".vcf"): out = out[:-4]

    elog = open(out + ".plink.err", "w")
    olog = open(out + ".plink.log", "w")
    subprocess.check_call([plink, "--vcf", vcf_path, "--make-bed",
                           "--noweb",
                           "--out", out, "--biallelic-only", "--geno",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…