Entering edit mode
                    4.7 years ago
        curious
        
    
        ▴
    
    900
    I want every row to be an id and every column a genotype for a different sample:
id1 0 2 1
id2 0 2 1
I know I can do this in python, but trying to get better with unix because the tools are usually faster
bcftools query -f '%ID[\t%GT]\n'  my_vcf.vcf |  awk -F "|" '{for(i=1; i<=NF; i++) { print $i+$i }}'
I think this is almost there by I almost there but obviously I'm off. Any hints are greatly appreciated thank you.
How is your output look like? I think you should have two for loops, the first loops the samples, and for each sample loop the GT
just this command
bcftools query -f '%ID[\t%GT]\n' my_vcf.vcfgives me this:I hope to get this with awk or similar:
right now i just get this