Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some "FILTER" lines not defined in raw VCF header #508

Open
simondrue opened this issue Aug 21, 2024 · 0 comments
Open

Some "FILTER" lines not defined in raw VCF header #508

simondrue opened this issue Aug 21, 2024 · 0 comments
Assignees
Labels

Comments

@simondrue
Copy link

Hi,

I get the following error when trying to parse a raw (--qc-output-all) VCF from Sniffles2 (v2.4.0) through BCFtools:

[W::vcf_parse_filter] FILTER 'COV_CHANGE_DUP' is not defined in the header
[W::vcf_parse_filter] FILTER 'COV_CHANGE_DEL' is not defined in the header

I can see that COV_CHANGE_INS (and multiple others) are in the header, but these two seems to be missing.

For now I have implmented the following temporary fix by reheadering the VCFs manually:

# Fix header in raw VCF
# Get header and remove last line
bcftools view -h ${{TEMP_DIR}}/raw.vcf | head -n -1 > ${{TEMP_DIR}}/hdr.txt

# Add FILTER lines to header
echo '##FILTER=<ID=COV_CHANGE_DUP,Description="Coverage change filter for DUP">' >> ${{TEMP_DIR}}/hdr.txt
echo '##FILTER=<ID=COV_CHANGE_DEL,Description="Coverage change filter for DEL">' >> ${{TEMP_DIR}}/hdr.txt

# Add last line of header
bcftools view -h ${{TEMP_DIR}}/raw.vcf | tail -n 1 >> ${{TEMP_DIR}}/hdr.txt

# Reheader
bcftools reheader \
    --threads {cores} \
    --header ${{TEMP_DIR}}/hdr.txt \
    --output ${{TEMP_DIR}}/reheadered.vcf \
    ${{TEMP_DIR}}/raw.vcf

Hoping you can fix this soon

Thank you for a nice tool!

Kind regards,
Simon

@lfpaulin lfpaulin self-assigned this Aug 21, 2024
@lfpaulin lfpaulin added the bug label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants