This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcf tools fixref error

Hello,

I am trying to run the fixref plugin found here, to correct for snpflip errors in my topmed imputation. I found this code here: https://samtools.github.io/bcftools/howtos/plugin.fixref.html

for i in {1..22}
do
bcftools norm --check-ref e -f $OUTDIR/DAC14_send_to_topmed/Homo_sapiens_assembly38_withchrfa.fa $OUTDIR/DAC14_send_to_topmed/DAC14_chr$i\_hg38_nonduplicates.vcf.gz -Ou -o /dev/null

As my build is hg38 and I need to keep the chr prefix in my reference file, I decided to use the GATK HG38 Build called: Homo_sapiens_assembly38.fasta found here: https://console.cloud.google.com/storage/browser/genomics-public-data/resources/broad/hg38/v0;tab=objects?prefix=&forceOnObjectsSortingFiltering=false

I keep receiving this error message:

Failed to load the fai index: /sc/arion/projects/psychgen2/MAP2_dac/data/imputation/DAC14_send_to_topmed/Homo_sapiens_assembly38_withchr.fasta [E::fai_build_core] Format error, unexpected "<" at line 2

I cannot seem to find the solution to this error.

snpflip bcftools topmed fixref imputation

2 answers

The message is quite clear to me. Your fasta sequence is NOT a fasta sequence.

Format error, unexpected "<" at line 2

Show us the output of

head -n 3 /sc/arion/projects/psychgen2/MAP2_dac/data/imputation/DAC14_send_to_topmed/Homo_sapiens_assembly38_withchr.fasta 

interesting.... perhaps I downloaded it incorrectly?

 head -n 3 /sc/arion/projects/psychgen2/MAP2_dac/data/imputation/DAC14_send_to_topmed/Homo_sapiens_assembly38_withchr.fasta

<!DOCTYPE html>
<html lang="en">

I used this to download...perhaps cannot do this from a cloud?

wget https://storage.cloud.google.com/genomics-public-data/resources/broad/hg38/v0/Homo_sapiens_assembly38.fasta?_ga=2.192584233.-289538108.1613068749

Also, I used this as I simply need a reference genome for running the fixref plugin that uses hg38 and chr prefix. Supposedly this is the main one available from GATK? In this same cloud, this was the only available fasta file...others were vcf.gz which couldn't work for this fixref script.

you downloaded the web page...

from cloud.google.com , I think you need to download it from the browser.

interesting.... perhaps I downloaded it incorrectly?

 head -n 3 /sc/arion/projects/psychgen2/MAP2_dac/data/imputation/DAC14_send_to_topmed/Homo_sapiens_assembly38_withchr.fasta

<!DOCTYPE html>
<html lang="en">

I used this to download...perhaps cannot do this from a cloud?

wget https://storage.cloud.google.com/genomics-public-data/resources/broad/hg38/v0/Homo_sapiens_assembly38.fasta?_ga=2.192584233.-289538108.1613068749

Also, I used this as I simply need a reference genome for running the fixref plugin that uses hg38 and chr prefix. Supposedly this is the main one available from GATK? In this same cloud, this was the only available fasta file...others were vcf.gz which couldn't work for this fixref script.

Log in to answer this question.