Answers.Body: <p>No, <code>./1</code> isn't valid. You can find the VCF specifications at <a href="https://samtools.github.io/hts-specs/" rel="nofollow noreferrer">https://samtools.github.io/hts-specs/</a>. The current version is <a href="https://samtools.github.io/hts-specs/VCFv4.4.pdf" rel="nofollow noreferrer">VCFv4.4</a> and this is the genotype section which hasn't really changed much from previous versions as far as I recall:</p>
  <blockquote>
  <p>GT (String): Genotype, encoded as allele value preceded by either of /
  or | depending on whether that allele is considered phased. The first
  phasing indicator may be omitted and is implicitly defined as / if any
  phasing indicators are / and | otherwise. 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, /0/1, or 1/2, etc.
  Haploid calls, e.g. on Y, male non-pseudoautosomal X, or mitochondria,
  should be indicated by having only one allele value. A triploid call
  might look like 0/0/1, and a partially phased triploid call could be
  |0/1/2 to indicate that the first allele is phased with another
  variant in the VCF. 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 phasing indicators are as follows (see
  the PS and PSL fields below for more details on incorporating phasing
  information into the genotypes):</p>
  <ul>
  <li>/ : allele is unphased</li>
  <li>| : allele is phased (according to the phase-set indicated in PS or PSL)</li>
  </ul>
  <p>For symbolic structural variant alleles, GT=0 indicates the absence of any of the ALT symbolic structural
  variants defined in the record. Implementer should note that merging a VCF record containing only symbolic
  structural variant ALT alleles with a record containing other alleles will result a change of the meaning of the
  GT=0 haplotypes from the record containing only symbolic SVs.</p>
  </blockquote>
  <p>This is the bit you are most interested in:</p>
  <blockquote>
  <p>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).</p>
  </blockquote>
  <p>So, <code>./1</code> doesn't mean anything. You could use <code>./.</code> which is the standard for &quot;not genotyped&quot;, or you could simply not have a GT field at all since that isn't actually required by the standard, so a VCF file with no genotype field at all can be a perfectly valid and standard compliant VCF.</p>
  <p>In other words, just think about what you really need. Do you absolutely need a GT field? If not, just leave it out and you're done. If you do, you can use <code>./.</code> if you want to say &quot;I don't know what the genotype here is&quot; (but be aware that some tools interpret <code>./.</code> as &quot;this might not be a real call&quot;), but don't use <code>./1</code> since that won't be understood by anyone.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-13T20:59:41.400Z
Answers.Text: `./1` is valid - it's contained a lot in [the output from decompose operations](https://genome.sph.umich.edu/wiki/Vt#Decompose).
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-13T21:15:50.353Z
Answers.Text: @RamRS I don't see why that makes it valid. It isn't mentioned in the specs as far as I can tell, and I don't see anything in the specs that would support that, so why do you say it is valid? There are _loads_ of tools, including commonly used popular ones, that produce invalid vcf files. To be fair, it is an extremely complex format, and it isn't easy to get it right, but the fact that one tool does something is really no indication that that thing is valid. Do you know what they use `./1` to mean?
Answers.UserDisplayName: terdon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-13T21:27:22.193Z
Answers.Text: I assumed that it does not break the format even if it does not adhere to specs 100%, so it's not really invalid. I think they mean that it's pseudo-haploid. When a multiallelic `1/2` GT is broken into 2 biallelic sites, it does not really yield `0/1` and `0/2` but `./1` and `./2` as each entry is kinda sorta haploid.
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-13T21:53:32.003Z
Answers.Text: @RamRS as someone whose day job involves convincing clients that just because their file has a vcf extension, that don't make it no valid vcf, the standard is all I can rely on. If it doesn't comply with the standard, it isn't a valid vcf file and whether or not software can read it correctly is anyone's guess. That said, `bcftools`, which is famously strict, doesn't complain about `1/.` but other tools might. And since it isn't in the specs, we can only say it isn't valid.
Answers.UserDisplayName: terdon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-13T19:03:37.227Z
Answers.LastActivityDate: 2024-02-13T19:03:37.227Z
Answers.UserDisplayName: terdon
Body: <p>I have a VCF file coming from a structural variant detection tool that doesn't add GT value. I can add GT values, for example by using this tool: <a href="https://vatools.readthedocs.io/en/latest/vcf_genotype_annotator.html" rel="nofollow noreferrer">https://vatools.readthedocs.io/en/latest/vcf_genotype_annotator.html</a>. I know there exist the alternate allele (1), but I don't know if it's homozygous or heterozygous.</p>
  <p>My collaborator wants a VCF with genotype. If an SV is called but not genotyped, I was wondering if ./1 could mean unknown allele and alternate allele for a diploid genome (working with human DNA). Although, if it is not a standard format, it may be a problem.</p>
  <p>Is <code>./1</code> a valid value to add or does it have to be <code>0/1</code> or <code>1/1</code>? Thanks.</p>
  
Tags: <vcf>
Title: Is ./1 a valid GT value to add to VCF?
ThreadText: # Is ./1 a valid GT value to add to VCF?
  
  (Asked by: username_0 on 2024-02-13)
  
  I have a VCF file coming from a structural variant detection tool that doesn't add GT value. I can add GT values, for example by using this tool: <https://vatools.readthedocs.io/en/latest/vcf_genotype_annotator.html>. I know there exist the alternate allele (1), but I don't know if it's homozygous or heterozygous.
  
  My collaborator wants a VCF with genotype. If an SV is called but not genotyped, I was wondering if ./1 could mean unknown allele and alternate allele for a diploid genome (working with human DNA). Although, if it is not a standard format, it may be a problem.
  
  Is `./1` a valid value to add or does it have to be `0/1` or `1/1`? Thanks.
  
  **Tags:** vcf
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-02-13. Score: 1 | Accepted answer
  
  No, `./1` isn't valid. You can find the VCF specifications at <https://samtools.github.io/hts-specs/>. The current version is [VCFv4.4](https://samtools.github.io/hts-specs/VCFv4.4.pdf) and this is the genotype section which hasn't really changed much from previous versions as far as I recall:
  
  > GT (String): Genotype, encoded as allele value preceded by either of /
  > or | depending on whether that allele is considered phased. The first
  > phasing indicator may be omitted and is implicitly defined as / if any
  > phasing indicators are / and | otherwise. 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, /0/1, or 1/2, etc.
  > Haploid calls, e.g. on Y, male non-pseudoautosomal X, or mitochondria,
  > should be indicated by having only one allele value. A triploid call
  > might look like 0/0/1, and a partially phased triploid call could be
  > |0/1/2 to indicate that the first allele is phased with another
  > variant in the VCF. 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 phasing indicators are as follows (see
  > the PS and PSL fields below for more details on incorporating phasing
  > information into the genotypes):
  >
  > * / : allele is unphased
  > * | : allele is phased (according to the phase-set indicated in PS or PSL)
  >
  > For symbolic structural variant alleles, GT=0 indicates the absence of any of the ALT symbolic structural
  > variants defined in the record. Implementer should note that merging a VCF record containing only symbolic
  > structural variant ALT alleles with a record containing other alleles will result a change of the meaning of the
  > GT=0 haplotypes from the record containing only symbolic SVs.
  
  This is the bit you are most interested in:
  
  > 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).
  
  So, `./1` doesn't mean anything. You could use `./.` which is the standard for "not genotyped", or you could simply not have a GT field at all since that isn't actually required by the standard, so a VCF file with no genotype field at all can be a perfectly valid and standard compliant VCF.
  
  In other words, just think about what you really need. Do you absolutely need a GT field? If not, just leave it out and you're done. If you do, you can use `./.` if you want to say "I don't know what the genotype here is" (but be aware that some tools interpret `./.` as "this might not be a real call"), but don't use `./1` since that won't be understood by anyone.
  
  > **Comments:**
  > **username_2**: `./1` is valid - it's contained a lot in [the output from decompose operations](https://genome.sph.umich.edu/wiki/Vt#Decompose).  
  > **username_1**: @username_2 I don't see why that makes it valid. It isn't mentioned in the specs as far as I can tell, and I don't see anything in the specs that would support that, so why do you say it is valid? There are _loads_ of tools, including commonly used popular ones, that produce invalid vcf files. To be fair, it is an extremely complex format, and it isn't easy to get it right, but the fact that one tool does something is really no indication that that thing is valid. Do you know what they use `./1` to mean?  
  > **username_2**: I assumed that it does not break the format even if it does not adhere to specs 100%, so it's not really invalid. I think they mean that it's pseudo-haploid. When a multiallelic `1/2` GT is broken into 2 biallelic sites, it does not really yield `0/1` and `0/2` but `./1` and `./2` as each entry is kinda sorta haploid.  
  > **username_1**: @username_2 as someone whose day job involves convincing clients that just because their file has a vcf extension, that don't make it no valid vcf, the standard is all I can rely on. If it doesn't comply with the standard, it isn't a valid vcf file and whether or not software can read it correctly is anyone's guess. That said, `bcftools`, which is famously strict, doesn't complain about `1/.` but other tools might. And since it isn't in the specs, we can only say it isn't valid.  
  
  ---
  
  