This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Removing sites/reads from BGZIp VCf

I have a vcf compressed and indexed (.vcf.gz and .tbi)

I have a list of sites that I need to remove from this file (delete forever) while having the other information.

Eg:

chr8 pos:125907085:125907085

what would be the best way to go about this?

vcf tabix filter

1 answer

gunzip -c file.vcf.gz |\
awk -F '\t' '!($1=="chr8" && int($2)==125907085))' > out.vcf && \
bgzip out.vcf && \
tabix -p vcf out.vcf.gz

is there a more optimal way of achieving this, lets say i have like 100 positions to remove

eg:

chr1 start-end

chr8 start-end

Log in to answer this question.