Question: Error with bcftools and vcftools and removing individuals
0
gravatar for seta
6 months ago by
seta1.3k
Sweden
seta1.3k wrote:

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

vcftools bcftools vcf • 180 views
ADD COMMENTlink written 6 months ago by seta1.3k

(actually there is just one empty column)

so you're VCF is broken. an empty column is not valid. https://samtools.github.io/hts-specs/VCFv4.2.pdf

ADD REPLYlink written 6 months ago by Pierre Lindenbaum128k

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?

ADD REPLYlink written 6 months ago by seta1.3k

Hello,

could you please show the header and one variant line?

fin swimmer

ADD REPLYlink written 6 months ago by finswimmer13k

just use cut ...

ADD REPLYlink written 6 months ago by Pierre Lindenbaum128k

I also used cut but vcf-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

ADD REPLYlink written 6 months ago by seta1.3k
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: 1506 users visited in the last hour