Incorrect number of AD fields (2) at 1:878906 cannot merge
0
0
Entering edit mode
5.8 years ago
jaybee ▴ 170

Hello

I have a directory named cases, where I have 4 .vcf.gz files of merged vcf files of Indels and another 4 .vcf.gz files of merged vcf files of SNPs.

I want to now merge all the 4 merged indels into 1 file.

I received these 4 sets of indels and snps into 4 separate folders, and for set 1, the samples are named: S1, S2, S3....S50 For set 2, also, the samples are named: S1, S2, S3, ....S50 Similarly for set3 and set4.

when I try and merge these 4 merged indel files into one using:

~cases/$ /usr/bin/bcftools merge Indel/*indel.vcf.gz -Oz -o Indels.vcf.gz

I receive:

Incorrect number of AD fields (2) at 1:878906 cannot merge

How can I solve this?

bcftools vcf WES • 2.6k views
ADD COMMENT
1
Entering edit mode

Hello jaybee ,

what version of bcftools are you using?

Are you sure that bcftools merge is the right tool for your purpose? This tools merges vcf file from different samples to one multisample vcf . You have the same sample names in the different files. This should lead to the error message:

Error: Duplicate sample names (S1), use --force-samples to proceed anyway.

When applying the suggested --force-samples the duplicate names get enumerated S1, 2:S1, 3:S1 Is this what you want to do or are you looking for bcftools concat, which would join vcf files of the same samples but different regions in on file?

Incorrect number of AD fields (2) at 1:878906 cannot merge

Is this the first line of one your input files? Could you please show us this line and also show the header line for AD?

~cases/$ /usr/bin/bcftools merge Indel/*indel.vcf.gz -Oz -o Indels.vcf.gz

You were told that using * is not a good practice. Why are you using it here again? Explicit is better than implicit!

fin swimmer

ADD REPLY
0
Entering edit mode

Hello fin swimmer

  1. I am using the latest version of bcftools 0.1.19
  2. I am not sure, because I am still learning and I do not know which command is best suited for which purpose.
  3. I know That I have 4 sets of cases, with the same sample names, but i do know that they are from different patients. So, they should have unique, separate IDs or sample names.
  4. 4.

are you looking for bcftools concat, which would join vcf files of the same samples but different regions in on file?

I do not understand what that means. what is meant by " ..but different regions in on the file"?

  1. I didn't know * is not a good practice. So, Do I always make a list and then write the command?

Thank you~!

ADD REPLY

Login before adding your answer.

Traffic: 1319 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6