title: Cannot sort VCF with bcftools due to invalid input
body: <p>I am trying to compress &amp; index a VCF file and am facing several issues. <br></p>
  <ol>
  <li>When I use bgzip/tabix, it throws an error saying it cannot be indexed due to some unsorted values.</li>
  </ol>
  <pre><code># code used to bgzip and tabix
  bgzip -c fn.vcf &gt; fn.vcf.gz
  tabix -p vcf fn.vcf.gz
  
  # below is the error returnd
  [E::hts_idx_push] Unsorted positions on sequence #1: 115352924 followed by 115352606
  tbx_index_build failed: fn.vcf.gz
  </code></pre>
  <ol start="2">
  <li>When I use <code>bcftools sort</code> to sort this VCF to tackle #1, it throws an error due to invalid entries.</li>
  </ol>
  <pre><code># code used to sort 
  bcftools sort -O z --output-file fn.vcf.gz fn.vcf
  
  # below is the error returned
  Writing to /tmp/bcftools-sort.YSrhjT
  [W::vcf_parse_format] Extreme FORMAT/AD value encountered and set to missing at chr12:115350908
  [E::vcf_parse_format] Invalid character '\x0F' in 'GT' FORMAT field at chr12:115352482
  Error encountered while parsing the input
  Cleaning
  </code></pre>
  <ol start="3">
  <li>I've tried sorting using linux commands to get around #2. However, when I run the below code, the size of <code>fout.vcf</code> is almost half of <code>fin.vcf</code>, indicating something might be going wrong.</li>
  </ol>
  <pre><code>grep &quot;^#&quot; fin.vcf &gt; fout.vcf
  grep -v &quot;^#&quot; fin.vcf | sort -k1,1V -k2,2n &gt;&gt; fout.vcf
  </code></pre>
  <p>Please let me know if you have any advice regarding:</p>
  <ul>
  <li>How I could sort/fix the problematic inputs in my VCF in a safe &amp; feasible way. (The file is 340G so I cannot simply open the file and edit.)</li>
  <li>Why my linux <code>sort</code> might be behaving in an odd way. (i.e. returning file much smaller than the original.)</li>
  </ul>
  <p>Any comments or suggestions are appreciated!</p>