You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
765B

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