-3

输入1

1 886817 2 122 C:0.983607 T:0.0163934

1 886817 3 123 C :2.111 CATTTT :1.11

输入 2

1 886817 rs10465241 C T 100 通过 AC=1573;

1 886817CATTTT 874 通过 AVGPOST =0.9884;

输出

1 886817 rs10465241 CT 100 通过 AC=1573;REF=0.983607;ALT=0.0163934

1 886817。CATTTT 874 通过 AVGPOST=0.9884;REF=2.111;ALT=1.11

输出是根据加粗的列匹配生成的。REF 和 ALT 值正在添加

4

1 回答 1

1

我想我刚刚回答了这个问题。然而,一些小的变化:

awk 'FNR==NR { split($5,a,":"); split($6,b,":"); c[$1,$2,a[1],b[1]]="REF=" a[2] ";ALT=" b[2]; next } ($1,$2,$4,$5) in c { print $0 c[$1,$2,$4,$5] }' file1 file2

结果:

1 886817 rs10465241 C T 100 PASS AC=1573;REF=0.983607;ALT=0.0163934
1 886817 . C CATTTT 874 PASS AVGPOST=0.9884;REF=2.111;ALT=1.11
于 2012-12-06T12:28:18.503 回答