I'm working with imputed data in multisample bcf format which contains a FORMAT/GP field for each sample.
I would like to set to missing (./.) a genotype in a sample where the max(FORMAT/GP) is less than a given threshold (say 0.99). For instance, 0.1,0.8,0.1 would be set as missing, whereas 1,0,0 wouldn't.
I would like to do this in bcftools, using the +setGT plugin. I've tried doing this using several commands such as:
bcftools +setGT input.bcf -- -t q -n . -i'max(FORMAT/GP)>0.99'
However, this seems to work by checking if any sample at a position has a max value of less than 0.99, and then sets all genotypes at that position as missing. To be clear, want this to run on a per-sample basis only set GTs as missing in individuals that have a max value of less than 0.99, rather than all of them.
Can anyone help me with the command I need?