Answers.Body: <p>In the case of unphased VCF <code>0/1</code> and <code>1/0</code> are exactly equivalent and the order has no meaning.</p>
  <p>Throughout the VCF specification, it is always encouraged to use numerical precedence in order to order the genotypes, e.g. <code>0/0</code>, <code>0/1</code>, <code>1/1</code> would be the preferred representations for diploid bi-allelic genotypes.</p>
  <p>However it is not strictly enforced in the VCF specification as for now and you could have <code>1/0</code>, <code>2/0</code>, etc, and bcftools will not complain parsing them. The presence of two representation in the same VCF might indicate that the data comes from multiple variant callers or has been through manual editing, since for example variant callers will always use one representation only (numerical precedence usually)</p>
  <p>Also, the order does impact how you read some of the sample information fields, for example the AD (allelic depth), for which the values are read following the order present in the GT field.</p>
  <p>I had a look at the VCF <a href="https://samtools.github.io/hts-specs/VCFv4.2.pdf" rel="nofollow noreferrer">4.2</a> and <a href="https://samtools.github.io/hts-specs/VCFv4.3.pdf" rel="nofollow noreferrer">4.3</a> spec, but indeed is not so precise there on these details.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-05T07:25:02.313Z
Answers.LastActivityDate: 2021-10-06T09:38:41.483Z
Answers.LastEditDate: 2021-10-06T09:38:41.483Z
Answers.UserDisplayName: JRodrigoF
Body: <p>Order of alleles in genotype field (on <a href="https://www.internationalgenome.org/wiki/Analysis/vcf4.0/" rel="nofollow noreferrer">VCFs</a>) can be used <a href="https://www.biostars.org/p/5298/" rel="nofollow noreferrer">to infer haplotypes</a></p>
  <p>However, what about unphased genotypes? I have a VCF file where I only have unphased genotypes:</p>
  <pre><code>0/1
  1/0
  1/1
  1/2
  2/1
  </code></pre>
  <p>However, I have, for example, both <code>0/1</code> and <code>1/0</code>. Does the order of alleles have some different meaning with unphased genotypes, or genotypes with same alleles (e.g., <code>0/1</code> and <code>1/0</code>) can be considered synonymous?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-05T07:36:16.940Z
Comments.Text: The fact that they are unphased necessarily means there is no order to them. However, the convention is usually to place the smaller value first, like `0/1` or `1/2` etc. But in reality it doesn't matter.
Comments.UserDisplayName: user438383
Tags: <vcf><variant-calling><genotyping><phasing>
Title: Meaning of order of alleles in VCF GT field for unphased genotypes
ThreadText: # Meaning of order of alleles in VCF GT field for unphased genotypes
  
  (Asked by: username_0 on 2021-10-05)
  
  Order of alleles in genotype field (on [VCFs](https://www.internationalgenome.org/wiki/Analysis/vcf4.0/)) can be used [to infer haplotypes](https://www.biostars.org/p/5298/)
  
  However, what about unphased genotypes? I have a VCF file where I only have unphased genotypes:
  
  ```
  0/1
  1/0
  1/1
  1/2
  2/1
  
  ```
  
  However, I have, for example, both `0/1` and `1/0`. Does the order of alleles have some different meaning with unphased genotypes, or genotypes with same alleles (e.g., `0/1` and `1/0`) can be considered synonymous?
  
  **Tags:** vcf, variant-calling, genotyping, phasing
  
  > **Comments:**
  > **username_1**: The fact that they are unphased necessarily means there is no order to them. However, the convention is usually to place the smaller value first, like `0/1` or `1/2` etc. But in reality it doesn't matter.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-10-05. Score: 3 | Accepted answer
  
  In the case of unphased VCF `0/1` and `1/0` are exactly equivalent and the order has no meaning.
  
  Throughout the VCF specification, it is always encouraged to use numerical precedence in order to order the genotypes, e.g. `0/0`, `0/1`, `1/1` would be the preferred representations for diploid bi-allelic genotypes.
  
  However it is not strictly enforced in the VCF specification as for now and you could have `1/0`, `2/0`, etc, and bcftools will not complain parsing them. The presence of two representation in the same VCF might indicate that the data comes from multiple variant callers or has been through manual editing, since for example variant callers will always use one representation only (numerical precedence usually)
  
  Also, the order does impact how you read some of the sample information fields, for example the AD (allelic depth), for which the values are read following the order present in the GT field.
  
  I had a look at the VCF [4.2](https://samtools.github.io/hts-specs/VCFv4.2.pdf) and [4.3](https://samtools.github.io/hts-specs/VCFv4.3.pdf) spec, but indeed is not so precise there on these details.
  
  
  ---
  
  