{"action":"opened","issue":{"url":"https://api.github.com/repos/chapmanb/bcbio-nextgen/issues/1334","repository_url":"https://api.github.com/repos/chapmanb/bcbio-nextgen","labels_url":"https://api.github.com/repos/chapmanb/bcbio-nextgen/issues/1334/labels{/name}","comments_url":"https://api.github.com/repos/chapmanb/bcbio-nextgen/issues/1334/comments","events_url":"https://api.github.com/repos/chapmanb/bcbio-nextgen/issues/1334/events","html_url":"https://github.com/chapmanb/bcbio-nextgen/issues/1334","id":148118507,"number":1334,"title":"Drop the incorrect genoype attributes for decomposes SNP's. ","user":{"login":"NeillGibson","id":15608993,"avatar_url":"https://avatars.githubusercontent.com/u/15608993?v=3","gravatar_id":"","url":"https://api.github.com/users/NeillGibson","html_url":"https://github.com/NeillGibson","followers_url":"https://api.github.com/users/NeillGibson/followers","following_url":"https://api.github.com/users/NeillGibson/following{/other_user}","gists_url":"https://api.github.com/users/NeillGibson/gists{/gist_id}","starred_url":"https://api.github.com/users/NeillGibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeillGibson/subscriptions","organizations_url":"https://api.github.com/users/NeillGibson/orgs","repos_url":"https://api.github.com/users/NeillGibson/repos","events_url":"https://api.github.com/users/NeillGibson/events{/privacy}","received_events_url":"https://api.github.com/users/NeillGibson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-13T16:47:34Z","updated_at":"2016-04-13T16:47:34Z","closed_at":null,"body":"Hi, \r\n\r\nWould it be possible to drop the incorrect genotype attributes for decomposed variants?\r\n\r\nThe Freebayes variant calling pipe currently decomposes longer variants to SNPs/indels if possible and keeps all genotype attributes. \r\n```\r\nvcfallelicprimitives -t DECOMPOSED --keep-geno\r\n```\r\n\r\nhttps://github.com/chapmanb/bcbio-nextgen/blob/master/bcbio/variation/freebayes.py#L128\r\n\r\nThe total set of genotype attributes kept is \r\n\r\n```\r\nGT\r\nAO\r\nDP\r\nGQ\r\nPL\r\nQA\r\nQR\r\nRO\r\n```\r\n\r\nOf  these genotype attributes the following can be corrupt for decomposed multi-allelic variants. \r\nThey are corrupt because the number of values for these attributes doesn't correspond anymore with the number of alleles in the VCF ALT colum. \r\n\r\n```\r\nPL\r\nAO\r\nQA \r\n```\r\n\r\nThis causes a BCFTools assertions to fail that is used for some subset operations like for example \r\n```\r\nbcftools view -s ^sample_to_exclude --trim-alt-alleles    my_file.vcf  \r\n```\r\nhttps://github.com/samtools/bcftools/issues/404\r\n\r\nThis could be fixed by dropping the PL, AO and QA  attributes for the all or just the decomposed variants.  \r\n\r\nThis would leave the following attributes for the decomposed SNPs. \r\n```\r\nGT\r\nDP\r\nGQ\r\nQR\r\nRO\r\n```\r\n\r\nI tried dropping the PL,AO and QA attributes for the decomposed variants and the resulting VCF file still seems to be valid. I did this by first splitting the VCF file into decomposed and non-decomposed variants. \r\n\r\nI thought the following command would just remove the possible corrupt GT attributes from the decomposed variants and also output the non-decomposed variants unchanged. \r\n```\r\nbcftools annotate -x FMT/PL,FMT/AO,FMT/QA  -i INFO/DECOMPOSED=1 my.vcf\r\n```\r\n\r\nIt however filters all the non-decomposed variants / outputs only variants with the DECOMPOSED flag set. \r\n\r\nMaybe another tool could  be added that only removes the possible corrupt genotype attributes for the decomposed variants? \r\nOr I could open a ticket at vcflib to ask for an option \"--keep-minimal-geno\"  ? \r\n\r\nDo you have any ideas on how to handle this?\r\n"}}