{"action":"created","issue":{"url":"https://api.github.com/repos/samtools/hts-specs/issues/58","labels_url":"https://api.github.com/repos/samtools/hts-specs/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/samtools/hts-specs/issues/58/comments","events_url":"https://api.github.com/repos/samtools/hts-specs/issues/58/events","html_url":"https://github.com/samtools/hts-specs/issues/58","id":51603439,"number":58,"title":"VCF: Clarify GL Genotype Field Ordering","user":{"login":"adamnovak","id":5062495,"avatar_url":"https://avatars.githubusercontent.com/u/5062495?v=3","gravatar_id":"","url":"https://api.github.com/users/adamnovak","html_url":"https://github.com/adamnovak","followers_url":"https://api.github.com/users/adamnovak/followers","following_url":"https://api.github.com/users/adamnovak/following{/other_user}","gists_url":"https://api.github.com/users/adamnovak/gists{/gist_id}","starred_url":"https://api.github.com/users/adamnovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamnovak/subscriptions","organizations_url":"https://api.github.com/users/adamnovak/orgs","repos_url":"https://api.github.com/users/adamnovak/repos","events_url":"https://api.github.com/users/adamnovak/events{/privacy}","received_events_url":"https://api.github.com/users/adamnovak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-10T19:57:39Z","updated_at":"2015-02-05T16:05:14Z","closed_at":null,"body":"The description of the GL field says that:\r\n\r\n    If A is the allele in REF and B,C,... are the alleles as ordered in ALT, the ordering of genotypes for the likelihoods is given by: F(j/k) = (k*(k+1)/2)+j.\r\n\r\nIt is unclear to me how one is supposed to interpret this equation as defining an ordering of anything. What do `j` and `k` represent? Why are we dividing one by the other? What does the value returned by the `F` function represent?\r\n\r\nI *think* what is happening is that `j` represents the number of the first allele of a diploid pair (with 0 for the ref allele) `k` represents the number of the second, the \"/\" is really denoting that the argument of the function is the unphased genotype composed from those two alleles, and the result of the function is the index in the GL array at which the likelihood of that genotype is to be found. If that is the case, this should be described more clearly in the spec. If that is *not* the case, this should *definitely* be described more clearly in the spec.\r\n\r\nFurthermore, for triploid or higher sites, the spec merely says genotype likelihoods should appear in \"the canonical order\". What order is that, exactly?"},"comment":{"url":"https://api.github.com/repos/samtools/hts-specs/issues/comments/73071842","html_url":"https://github.com/samtools/hts-specs/issues/58#issuecomment-73071842","issue_url":"https://api.github.com/repos/samtools/hts-specs/issues/58","id":73071842,"user":{"login":"atks","id":3708476,"avatar_url":"https://avatars.githubusercontent.com/u/3708476?v=3","gravatar_id":"","url":"https://api.github.com/users/atks","html_url":"https://github.com/atks","followers_url":"https://api.github.com/users/atks/followers","following_url":"https://api.github.com/users/atks/following{/other_user}","gists_url":"https://api.github.com/users/atks/gists{/gist_id}","starred_url":"https://api.github.com/users/atks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atks/subscriptions","organizations_url":"https://api.github.com/users/atks/orgs","repos_url":"https://api.github.com/users/atks/repos","events_url":"https://api.github.com/users/atks/events{/privacy}","received_events_url":"https://api.github.com/users/atks/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T16:05:14Z","updated_at":"2015-02-05T16:05:14Z","body":"The below wiki explains the ordering of genotypes given ploidy and alleles in the general case.\r\n\r\nhttp://genome.sph.umich.edu/wiki/Relationship_between_Ploidy,_Alleles_and_Genotypes\r\n"}}