I have a big file containing 27 columns and nearly 6 million rows. The following is a little example of my file
head data
0.65 0.722222 1.0 0.75 0
0.35 0.277778 0.0 0.25 0
0 0.666667 0.75 0.5 0.5625
0 0.333333 0.25 0.5 0.4375
Rows are SNPs and columns are individuals. and I have "2 rows per each SNP" (one for reference allele and the other for alternative allele). In the example above I showed data for 2 SNPs (rows 1 and 2 correspond to SNP1 and rows 3 and 4 correspond to SNP2). I want to check if for each SNP, both ref and alt allele frequencies are 0, replace them with 9. this is my desired output:
head desired
0.65 0.722222 1.0 0.75 9
0.35 0.277778 0.0 0.25 9
9 0.666667 0.75 0.5 0.5625
9 0.333333 0.25 0.5 0.4375
0.65 0.722222 1.0 0.75 0
and the corresponding line is0 0.722222 1.0 0.75 0.3
(so field 1 is 0 in one line and the last field is 0 in the other), what should happen? Should both 0s be made 9s? Neither? $\endgroup$