My this question is the follow-up / extension of C: Copy Sample ID from VCF file to ID column
I have a file like:
rsid1:sample1,sample2,sample3 rsid2:sample1,sample5 rsid3:sample4, sample6 rsid4:sample6
Each line is paired with the second line, that is , rsid1 and rsid2 are paired, rsid3 and rsid4 are paired and so on. I want to print only those samples that are present in a pair, so the desired output would be:
rsid1:sample1 rsid2:sample1 rsids3:sample6 rsid4:sample6
or is it possible to get the direct output like this from a VCF file (answered by PIERRE in the above link, but last time I did not ask this pair feature).
Any help appreciated.