This is a test version of Biostars. For the public version, visit https://www.biostars.org.
plink2 fails to calculate allele frequency

Hello everyone. I am trying to calculate the equal frequency in groups. code show as below:

plink2 --vcf <VCF path> --freq --pheno <population-file path> --loop-cats population

But I now get an error:

r + plink2-temporary.psam written. 99 samples (0 females, 0 males, 99 ambiguous; 99 founders) loaded from plink2-temporary.psam. Error: plink2-temporary.pvar has a split chromosome. Use --make-pgen + --sort-vars to remedy this.

I tried adding at the end of my code:

plink2 --vcf <VCF path> --freq --pheno <population-file path> --make-pgen --sort-vars

But still the same error occurs. I don't know how to fix this, hope someone can help me take a look, thanks a lot

plink2

1 answer

Remove —freq from your command. Wait until —make-pgen + —sort-vars has completed, and then run —freq on the resulting sorted .pgen fileset rather than the unsorted VCF.

thank you very much for your help

Log in to answer this question.