Entering edit mode
6.0 years ago
karl.fetter
•
0
Hello All,
I'm trying to merge 2 vcf.gz files and I'm running into a strange behavior using bcftools merge. All of the positions in my second file are being setting to missing (./.) during the merge. Does anyone have any tips for how I might fix this problem?
Here is my command:
bcftools merge -O v -m file1.vcf.gz file2.vcf.gz > out.vcf
Thanks for your help!
ALL ? can you confirm this ? is there any position that shouldn't be set to './.' (unknown ) ? see also : https://github.com/samtools/bcftools/issues/402
Thanks for the suggestion, I can confirm this. I looked closer at the file and while both input files are 85K loci large, the output is 171K. What is happening is that the two files are being concatenated and sites in file2 are set to unknown in the top half, and sites in file1 are set to unknown in the bottom half.
I thought perhaps the problem is the ID column in file2 is set to '.' for every position, and in file1 the ID column is complete and reads CHR_POS. I add the ID field to file2 to see if that was the problem. Unfortunately that did not fix it. So I'm back to square 1. Do you know which field bcftools uses to merge? My files are not in the same order. Perhaps that's the problem?
thx.
It's always better to work with sorted files. So you should give it a try. The other thing I see is, you are using
-m
in your command. But there is an argument missing for it, isn't it?fin swimmer