#./plink --bfile WGS_Omni25_BIN_wo_ConsentsIssues --extract wholeattempt.txt --recode vcf-iid --out ./new_vcf
#File converts vcf file into dataframe of SNP data from ADNI

import pandas as pd
import vcf

def read(f):

    reader = vcf.Reader(open(f))
    df = pd.DataFrame([vars(r) for r in reader])
    out = df.merge(pd.DataFrame(df.INFO.tolist()),
                   left_index=True, right_index=True)
    out.to_csv("SNP.csv")
    return out

if __name__ == "__main__":
    print(read("new_vcf.vcf"))