text: user298: I have always thought that 1/0 and 0/1 in VCF genotype fields are equivalent. And yet, GATK uses both. For example, these are two variants called in the same sample and the same run of GATK 4.1.4.0:
  chr7    117120317   .   ATTCATTGTTTTGAAAGAAAGATGGAAGAATGAACTGAAG    A   748.97  .   AC=1;AF=0.5;AN=2;DP=64;ExcessHet=3.0103;FS=0;MLEAC=1;MLEAF=0.5;MQ=60;QD=11.89;SOR=7.223 GT:AD:DP:GQ:PL:SB   1/0:0,36:63:99:2294,1042,933:0,0,0,36
  chr7    117120306   .   GACGCGCT    G   516.6   .   AC=1;AF=0.5;AN=2;BaseQRankSum=0.826;DP=70;ExcessHet=3.0103;FS=0;MLEAC=1;MLEAF=0.5;MQ=60;MQRankSum=0;QD=8.2;ReadPosRankSum=-5.786;SOR=0.976  GT:AD:DP:GQ:PL:SB   0/1:37,26:63:99:524,0,1203:0,20,0,26
  
  And here are the same lines redacted for clarity:
  chr7    117120317   .   AT..AG  A   [...]   GT:AD:DP:GQ:PL:SB   1/0:0,36:63:99:2294,1042,933:0,0,0,36
  chr7    117120306   .   GA..CT  G   [...]   GT:AD:DP:GQ:PL:SB   0/1:37,26:63:99:524,0,1203:0,20,0,26
  
  As you can see, one is genotyped as 1/0 and the other as 0/1. The VCF specs say:
  
  GT (String): Genotype, encoded as allele values separated by either of / or |. The allele values are 0 for the
  reference allele (what is in the REF field), 1 for the first allele listed in ALT, 2 for the second allele list in
  ALT and so on. For diploid calls examples could be 0/1, 1 | 0, or 1/2, etc. Haploid calls, e.g. on Y, male
  non-pseudoautosomal X, or mitochondrion, are indicated by having only one allele value. A triploid call might
  look like 0/0/1. If a call cannot be made for a sample at a given locus, ‘.’ must be specified for each missing
  allele in the GT field (for example ‘./.’ for a diploid genotype and ‘.’ for haploid genotype). The meanings of
  the separators are as follows (see the PS field below for more details on incorporating phasing information into
  the genotypes):
  
  / : genotype unphased
  | : genotype phased
  
  
  This suggests that although 1|0 is not the same as 0|1, the unphased 0/1 and 1/0 genotypes are completely equivalent. Which makes perfect sense given that the N/N genotypes are unphased, so n/N must be equivalent to N/n.
  So, my questions are: why does gatk produce some lines with 0/1 and others with 1/0? Is it a bug? Am I missing something? I can't imagine a developer writing code to pick either 0/1 or 1/0 randomly, so presumably they indicate some difference in what gatk sees about a variant. So are 0/1 and 1/0 not 100% equivalent somehow?
  
   I have seen How is the GT field in a VCF file defined? which suggests the two are equivalent, but this seems to be contradicted by GATK's own output which is why I am asking this again to get a clear and preferably referenced answer.
  
  user3848: Convention
  The convention is it should be in ascending ordering, i.e. 0/1. The question is, why the convention broken?
  Phasing I think, at a guess, the answer is it depends what reference genome you are using. I would suggest that this result would not occur if the reference genome is mum (or dad) and the alleles are occurring in the child. The output supports this idea because it is marked with '/', i.e. they are not phased, thus the reference genome is neither mum nor dad.
  Example provided The thing I would like to point out is in the example given 117120306 and 117120317 are not randomly scattered across the genome but appear to be 11 bp apart. For a human genome those are very strongly linked.
  Linkage hypothesis Thus I would suggest the answer is linkage in this example, given the reference genome isn't a parent. The mutations are occurring on different strands therefore better represented as 0/1 and then 1/0, i.e. one strand comprises 'A' allele and the opposite strand is the 'G' allele.
  Why is unphased linkage important In this scenario the interpretation could be hugely important because it would be stating that each allele has come from different parents. This would be more important than maintaining convention. In an inherited disorder there is a risk the child has a dominant phenotype, when each parent could have been heterozygous. Clearly it depends whether the mutation is forcing an amino acid mutation, at 11bp it is certainly possible, i.e. mutation in the first codon upstream and mutation in the second codon downstream.
  More generally in any population analysis, linkage is an enormously important issue and central to any calculation. The point is simply that most analysis infers independent segregation of each allele and in this example that remains a good assumption because the allele (I am suggesting) are on opposite strands. If they were on the same strand it would create a bias away from panmixia.
  The hypothesis is formed on this example alone and if the alleles were 10 megabp apart it would be impossible to conclude they were linked, therefore the convention of 0/1 should hold. That's my guess, its not a bad guess.
  
original_text: 298: <p>I have always thought that <code>1/0</code> and <code>0/1</code> in VCF genotype fields are equivalent. And yet, GATK uses both. For example, these are two variants called in the same sample and the same run of GATK 4.1.4.0:</p>
  <pre><code>chr7    117120317   .   ATTCATTGTTTTGAAAGAAAGATGGAAGAATGAACTGAAG    A   748.97  .   AC=1;AF=0.5;AN=2;DP=64;ExcessHet=3.0103;FS=0;MLEAC=1;MLEAF=0.5;MQ=60;QD=11.89;SOR=7.223 GT:AD:DP:GQ:PL:SB   1/0:0,36:63:99:2294,1042,933:0,0,0,36
  chr7    117120306   .   GACGCGCT    G   516.6   .   AC=1;AF=0.5;AN=2;BaseQRankSum=0.826;DP=70;ExcessHet=3.0103;FS=0;MLEAC=1;MLEAF=0.5;MQ=60;MQRankSum=0;QD=8.2;ReadPosRankSum=-5.786;SOR=0.976  GT:AD:DP:GQ:PL:SB   0/1:37,26:63:99:524,0,1203:0,20,0,26
  </code></pre>
  <p>And here are the same lines redacted for clarity:</p>
  <pre><code>chr7    117120317   .   AT..AG  A   [...]   GT:AD:DP:GQ:PL:SB   1/0:0,36:63:99:2294,1042,933:0,0,0,36
  chr7    117120306   .   GA..CT  G   [...]   GT:AD:DP:GQ:PL:SB   0/1:37,26:63:99:524,0,1203:0,20,0,26
  </code></pre>
  <p>As you can see, one is genotyped as <code>1/0</code> and the other as <code>0/1</code>. <a href="https://samtools.github.io/hts-specs/VCFv4.3.pdf" rel="nofollow noreferrer">The VCF specs</a> say:</p>
  <blockquote>
  <p>GT (String): Genotype, encoded as allele values separated by either of / or |. The allele values are 0 for the
  reference allele (what is in the REF field), 1 for the first allele listed in ALT, 2 for the second allele list in
  ALT and so on. For diploid calls examples could be 0/1, 1 | 0, or 1/2, etc. Haploid calls, e.g. on Y, male
  non-pseudoautosomal X, or mitochondrion, are indicated by having only one allele value. A triploid call might
  look like 0/0/1. If a call cannot be made for a sample at a given locus, ‘.’ must be specified for each missing
  allele in the GT field (for example ‘./.’ for a diploid genotype and ‘.’ for haploid genotype). The meanings of
  the separators are as follows (see the PS field below for more details on incorporating phasing information into
  the genotypes):</p>
  <ul>
  <li>/ : genotype unphased</li>
  <li>| : genotype phased</li>
  </ul>
  </blockquote>
  <p>This suggests that although <code>1|0</code> is not the same as <code>0|1</code>, the <em>unphased</em> <code>0/1</code> and <code>1/0</code> genotypes are completely equivalent. Which makes perfect sense given that the <code>N/N</code> genotypes are unphased, so <code>n/N</code> must be equivalent to <code>N/n</code>.</p>
  <p>So, my questions are: why does gatk produce some lines with <code>0/1</code> and others with <code>1/0</code>? Is it a bug? Am I missing something? I can't imagine a developer writing code to pick either <code>0/1</code> or <code>1/0</code> randomly, so presumably they indicate some difference in what gatk sees about a variant. So are <code>0/1</code> and <code>1/0</code> not 100% equivalent somehow?</p>
  <hr />
  <p><sub> I have seen <a href="https://bioinformatics.stackexchange.com/q/14356/298">How is the GT field in a VCF file defined?</a> which suggests the two are equivalent, but this seems to be contradicted by GATK's own output which is why I am asking this again to get a clear and preferably referenced answer.</sub></p>
   3848: <p><strong>Convention</strong>
  The convention is it should be in ascending ordering, i.e. 0/1. The question is, why the convention broken?</p>
  <p><strong>Phasing</strong> I think, at a guess, the answer is it depends what reference genome you are using. I would suggest that this result would not occur if the reference genome is mum (or dad) and the alleles are occurring in the child. The output supports this idea because it is marked with '/', i.e. they are not phased, thus the reference genome is neither mum nor dad.</p>
  <p><strong>Example provided</strong> The thing I would like to point out is in the example given <code>117120306</code> and <code>117120317</code> are not randomly scattered across the genome but appear to be 11 bp apart. For a human genome those are very strongly linked.</p>
  <p><strong>Linkage hypothesis</strong> Thus I would suggest the answer is linkage in this example, given the reference genome isn't a parent. The mutations are occurring on different strands therefore better represented as 0/1 and then 1/0, i.e. one strand comprises 'A' allele and the opposite strand is the 'G' allele.</p>
  <p><strong>Why is unphased linkage important</strong> In this scenario the interpretation could be hugely important because it would be stating that each allele has come from different parents. This would be more important than maintaining convention. In an inherited disorder there is a risk the child has a dominant phenotype, when each parent could have been heterozygous. Clearly it depends whether the mutation is forcing an amino acid mutation, at 11bp it is certainly possible, i.e. mutation in the first codon upstream and mutation in the second codon downstream.</p>
  <p>More generally in any population analysis, linkage is an enormously important issue and central to any calculation. The point is simply that most analysis infers independent segregation of each allele and in this example that remains a good assumption because the allele (I am suggesting) are on opposite strands. If they were on the same strand it would create a bias away from panmixia.</p>
  <p>The hypothesis is formed on this example alone and if the alleles were 10 megabp apart it would be impossible to conclude they were linked, therefore the convention of 0/1 should hold. That's my guess, its not a bad guess.</p>
  