#!/usr/bin/env python3

# Converts PLINK covariate and fam file into a covariate file for Gemma

import sys
import pandas as pd
import argparse
import numpy as np


EOL=chr(10)

def parseArguments():
    parser = argparse.ArgumentParser(description='fill in missing bim values')
    parser.add_argument('--sumstat',type=str,required=True)
    parser.add_argument('--chro',type=str,required=True,help="File with phenotype and covariate data")
    parser.add_argument('--begin',type=int,required=True,help="File with phenotype and covariate data")
    parser.add_argument('--end',type=int,required=True,help="File with phenotype and covariate data")
    parser.add_argument('--bpheader', type=str,help="comma separated list of covariates",default="")
    parser.add_argument('--pheno',type=str,required=True,help="comma separated list of  pheno column")
    parser.add_argument('--phe_out', type=str,help="output fam file")
    parser.add_argument('--cov_out', type=str,help="output covariate file")
    parser.add_argument('--covqual_file', type=str,help="output covariate file")
    parser.add_argument('--cov_file', type=str,help="output covariate file")
    parser.add_argument('--nona', type=int,help="output covariate file", default=0)
    parser.add_argument('--gxe_out', type=str,help="output gxe file (gemma use)")
    parser.add_argument('--gxe', type=str,help="gxe covariate (gemma use)")
    parser.add_argument('--form_out', type=int,help="format output : 1:Gemma, 2:boltlmm, 3:FastLmm, 4:gcta", required=True)
    args = parser.parse_args()
    return args



