This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Comparision of two VCF file with vcftools. Chromosome order error message

Hi,

I'm using the vcftools for the first time. I'm trying to compare two VCF files with the following command line:

vcftools --vcf Sample_All.vcf --diff Sample_indA.vcf --diff-site --out Multiple_vs_indA

and I get the following error message:

Error: Both files must be sorted in the same chromosomal order.
chr1 in file 2 appears to be out of order.

But I know that in both VCF file I have the chr1 included, so, why do I have this message? Plus I have tried to had the --not-chr chr1 parameter to my command line, as I understand it was advised to do in this case, but then I have the same error message but on chr2 ... Is it normal? What should I do to resolve this issue? Or maybe it is just a warning message?

Thank you

C.

vcftools vcf

show us the output of:

grep -v "#" Sample_All.vcf | cut -f 1 | uniq | tr "\n" " "

and

grep -v "#" Sample_indA.vcf | cut -f 1 | uniq | tr "\n" " "

1 answer

Hi,

I assume the output of these two commands should be the same, right? I have tried to sort my files, and now it seems to work.

Many thanks!

C.

Log in to answer this question.