|
- import pandas as pd
- import sys, argparse, os
-
- men = pd.read_table(sys.argv[1],header=None,low_memory=False)
- vote = pd.read_table(sys.argv[2],low_memory=False)
- men[1]=men[1].astype(str)
- merged_df = pd.merge(vote, men, how='inner', left_on=['CHROM','POS'], right_on = [0,1])
- lcl5_dat = merged_df[(merged_df[5]!='./.') & (merged_df[5]!='0/0')]
- sub = lcl5_dat[['CHROM','POS','REF','ALT',4,5,6,7,8,'LCL5_consensus_calls', 'LCL5_detect_number','LCL5_same_diff',11]]
- sub['mendelian_state'] = 'MIE'
- sub.loc[sub[11]=='1:1:1','mendelian_state'] = 'MC'
- sub.columns=['CHROM','POS','REF','ALT','variant_type','LCL5','LCL6','LCL7','LCL8','LCL5_consensus_calls','LCL5_detect_number','LCL5_same_diff','mendelian_detail','mendelian_state']
- sub.to_csv(sys.argv[3],sep="\t",index=0)
|