Question: Incorrect number of AD fields (2) at 1:878906 cannot merge
0
gravatar for jaybee
8 months ago by
jaybee40
South Korea
jaybee40 wrote:

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 wes vcf • 367 views
ADD COMMENTlink written 8 months ago by jaybee40
1

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 REPLYlink modified 8 months ago • written 8 months ago by finswimmer12k

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 REPLYlink modified 7 months ago • written 7 months ago by jaybee40
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: 1013 users visited in the last hour