Question: Changing BCF genome coordinates (Picard LiftOverVcf error)
gravatar for wpierrick
2.8 years ago by
wpierrick80 wrote:

Hello all,

I am trying to convert my BCF files from GrCH38 to GrCH37. I am using Picard LiftOverVcf as it can work with BCF too. The BCF's I'm using are valid, I worked with these files (but only made a BED out of it) already and everything was fine.

My command line is

java -jar "/home/user/binaries/Picard/picard.jar" LiftoverVcf  \
  I=./Input.bcf  O=./Output_GRCH37.bcf  CHAIN=GRCh38_to_GRCh37.chain  \
  REJECT=./rejected_variants.vcf  R=./Homo_sapiens.GRCh37.dna.toplevel.fasta \

For some reason, it doesn't work and I get the following error message:

Exception in thread "main" htsjdk.tribble.TribbleException$MalformedFeatureFile: Unable to parse header with error: Input stream does not contain a BCF encoded file; BCF magic header info not found, at record 0 with position 0:, for input source: file:./Input.bcf`

The header of my BCF:

bcftools view -h input.bcf | head

##FILTER=<ID=PASS,Description="All filters passed">
##Bunch of contigs
##bcftools_viewCommand=view -iFILTER="PASS" -m2 -M2 -O b ./input.bcf
##bcftools_viewCommand=view -h input.bcf

I initially thought it was because the version of my file was too "new" for Picard, but it gives the same error with the latest build. I am fairly confident I'm inputting the right files as well.

Any thought on how to fix that/my headers?

Thanks a lot!

ADD COMMENTlink modified 2.6 years ago by h.mon32k • written 2.8 years ago by wpierrick80
gravatar for Pierre Lindenbaum
2.7 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum133k wrote:

I'm not sure picard/htsjdk can properly handle bcf. Convert the bcf to vcf with bcftools view and retry with a vcf file.

ADD COMMENTlink written 2.7 years ago by Pierre Lindenbaum133k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1830 users visited in the last hour