Dear all,
I'm trying to remove an individuals from a multi-sample vcf file using bcftools and vcftools, but none of them worked well.
Also, in this file, there is no variant information at all sites for this individual (actually there is just one empty column), but this individual used for the calculation of "AN" in the INFO filed.
I used bcftools with bcftools view -s indv26 file1.vcf -o out.vcf
, it gave me the error "Number of columns does not match the number of samples", which is right as I explained above the empty column). In addition, I used vcftools with vcftools --vcf file2.vcf --remove-indv indv26 --recode --recode-INFO-all
. It removed the individual of interest, but it didn't update AN in the INFO filed. Could you please help me out what shall I do?
Sorry, the corresponding variant of the removed individuals also will be removed from the multi-sample vcf file, yes?
Thanks
so you're VCF is broken. an empty column is not valid. https://samtools.github.io/hts-specs/VCFv4.2.pdf
Yes, this empty column actually has a header (sample name) and this sample also used for the calculation of AN. I tried to remove this sample, but the error appeared as I mentioned in the post. Could you please let me know how I can solve the issue?
Hello,
could you please show the header and one variant line?
fin swimmer
just use
cut
...I also used
cut
butvcf-validator
didn't confirm the resulting vcf file. Finally, I used vcftools to remove the individual and used vcffixup (from vcflib) to update the AN. It worked well, but took very long time to finish. It will be great if someone has any faster suggestion.Thanks