Question: Changing BCF genome coordinates (Picard LiftOverVcf error)
0
gravatar for wpierrick
15 months ago by
wpierrick80
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 \
  ALLOW_MISSING_FIELDS_IN_HEADER=true

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

##fileformat=VCFv4.2
##FILTER=<ID=PASS,Description="All filters passed">
##contig=<ID=chr1,length=248956422>
##Bunch of contigs
##bcftools_viewVersion=1.3+htslib-1.3
##bcftools_viewCommand=view -iFILTER="PASS" -m2 -M2 -O b ./input.bcf
##bcftools_viewCommand=view -h input.bcf
#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT

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 12 months ago by h.mon26k • written 15 months ago by wpierrick80
0
gravatar for Pierre Lindenbaum
13 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum121k 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 13 months ago by Pierre Lindenbaum121k
Please log in to add an answer.

Help
Access

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