# VCF format 4.1 uncompressed file import fails with AC field error

**URL:** <https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436>\
**Category:** Help \[0.1\]\
**Created:** [March 5, 2018, 7:47pm UTC](https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436 "2018-03-05T19:47:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaborkorodi-hms](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/gaborkorodi-hms/32/126_2.png) [@gaborkorodi-hms](https://discuss.hail.is/u/gaborkorodi-hms)\
**Post date:** [March 5, 2018, 7:47pm UTC](https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436/1 "2018-03-05T19:47:33Z")

</div>

The following error is presented when trying to read uncompressed .vcf file, which is (VCFv4.1). Any ideas or workarounds if I want to convert this into a .vds?

```auto
is.hail.utils.HailException: encountered problem with file file:/scratch/files/blah/blah/blah/blah/blah/blah/chr2.pass.gtonly.minDP0.genotypes.vcf
  Your input file has a malformed header: Count < 0 for fixed size VCF header field AC
    at is.hail.utils.ErrorHandling$class.fatal(ErrorHandling.scala:6)
    at is.hail.utils.package$.fatal(package.scala:27)
    at is.hail.io.vcf.LoadVCF$.apply(LoadVCF.scala:218)
    at is.hail.HailContext.importVCFs(HailContext.scala:557)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
    at py4j.Gateway.invoke(Gateway.java:280)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.GatewayConnection.run(GatewayConnection.java:214)
    at java.lang.Thread.run(Thread.java:748)

Hail version: 0.1-5c275cc
Error summary: HailException: encountered problem with file file:/scratch/files/blah/blah/blah/blah/blah/blah/chr2.pass.gtonly.minDP0.genotypes.vcf
  Your input file has a malformed header: Count < 0 for fixed size VCF header field AC

```

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [March 5, 2018, 7:49pm UTC](https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436/2 "2018-03-05T19:49:16Z")

</div>

What is the INFO line for AC?

---

<div class="post-metadata">

**Author:** ![gaborkorodi-hms](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/gaborkorodi-hms/32/126_2.png) [@gaborkorodi-hms](https://discuss.hail.is/u/gaborkorodi-hms)\
**Post date:** [March 5, 2018, 7:50pm UTC](https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436/3 "2018-03-05T19:50:25Z")

</div>

```auto
##fileformat=VCFv4.1
##source=pseq
##INFO=<ID=AC,Number=-1,Type=Integer,Description="Allele count for each alternate allele">
##INFO=<ID=AF,Number=-1,Type=Float,Description="Frequency for each alternate allele (estimated from primary data, not called genotypes)">
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Combined depth across samples">
##INFO=<ID=AVGDP,Number=1,Type=Float,Description="Average Depth per Sample">
##INFO=<ID=GC,Number=-1,Type=Integer,Description="Genotype Counts">
##INFO=<ID=GN,Number=1,Type=Integer,Description="Total Number of Genotypes">
##INFO=<ID=HWEAF,Number=-1,Type=Float,Description="Genotype likelihood based Allele Frequency assuming HWE">
##INFO=<ID=HWDGF,Number=-1,Type=Float,Description="Genotype likelihood based Genotype Frequency ignoring HWE">
##INFO=<ID=IBC,Number=1,Type=Float,Description="Inbreeding Coefficients calculated from genotype likelihoods">
##INFO=<ID=HWE_SLP,Number=1,Type=Float,Description="Signed log p-values testing statistics based Hardy Weinberg ln(Likelihood Ratio)">
##INFO=<ID=ABE,Number=1,Type=Float,Description="Expected allele Balance towards Reference Allele on Heterozygous Sites">
##INFO=<ID=ABZ,Number=1,Type=Float,Description="Average Z-scores of Allele Balance towards Reference Allele on Heterozygous Sites">
##INFO=<ID=NS_NREF,Number=1,Type=Integer,Description="Number of samples with non-reference reads">
##INFO=<ID=BQZ,Number=1,Type=Float,Description="Correlation between base quality and alleles">
##INFO=<ID=CYZ,Number=1,Type=Float,Description="Correlation between cycle and alleles">
##INFO=<ID=STZ,Number=1,Type=Float,Description="Correlation between strand and alleles">
##INFO=<ID=NMZ,Number=1,Type=Float,Description="Correlation between mismatch counts per read and alleles">
##INFO=<ID=IOR,Number=1,Type=Float,Description="Inflated rate of observing of other alleles in log10 scale">
##INFO=<ID=NM0,Number=1,Type=Float,Description="Average number of mismatches in the reads with ref alleles">
...

```

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [March 5, 2018, 7:52pm UTC](https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436/4 "2018-03-05T19:52:14Z")

</div>

I’m inclined to agree with wherever this error is coming from (probably htsjdk) that your VCF is malformed! If AC/AF fields don’t exist, try removing them from the header entirely

---

<div class="post-metadata">

**Author:** ![gaborkorodi-hms](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/gaborkorodi-hms/32/126_2.png) [@gaborkorodi-hms](https://discuss.hail.is/u/gaborkorodi-hms)\
**Post date:** [March 5, 2018, 8:05pm UTC](https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436/5 "2018-03-05T20:05:05Z")

</div>

I will report back, thanks for the quick response

---

<div class="post-metadata">

**Author:** ![gaborkorodi-hms](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/gaborkorodi-hms/32/126_2.png) [@gaborkorodi-hms](https://discuss.hail.is/u/gaborkorodi-hms)\
**Post date:** [March 5, 2018, 11:51pm UTC](https://discuss.hail.is/t/vcf-format-4-1-uncompressed-file-import-fails-with-ac-field-error/436/6 "2018-03-05T23:51:25Z")

</div>

Removing the field just errors on the next field that is -1… and the next… and the next. Changing the value to `A` or `G`, based on VCF documentation solves the issue. Also, using `.` for `any value` also works. Sorry about the confusion. Works as advertised once the format notation has been corrected.
