Exporting haploid and diploid allele dosage from vcf file on chrX

25 views
Skip to first unread message

Mathias Gorski

unread,
Aug 20, 2025, 7:29:22 AMAug 20
to plink2-users
Dear all,

I am trying to export the allele dosages oon chrX by this command:
plink2 \
        --pfile "$infileBgen"  \
        --extract $SNP_list_file \
--export vcf vcf-dosage=DS-only \
        --out "$outfilename"

but I get the error
"Error: --export vcf-dosage=DS-only mode can only be used with all-diploid data."

It is clear to me, that males are not coded all-diploid. I am fine with the haploid allele dosage in males and the diploid allele dosage in women. 

Is there a way to get these out in vcf format? I would then afterwards separate the men from the women ... or is it necessary to separate the data one step before into men and women and then to extract via DS-only?

Thank you in advance!

best, Mathias

Chris Chang

unread,
Aug 20, 2025, 9:52:01 PMAug 20
to Mathias Gorski, plink2-users
You can use "--export vcf vcf-dosage=DS" for chrX, since the ploidy information is encoded in the GT field in that case.  Or "--export Av" if you're mainly trying to generate a variant-major text matrix.

--
You received this message because you are subscribed to the Google Groups "plink2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plink2-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/plink2-users/243c2619-5ba0-48a3-88d4-9ef5c338c712n%40googlegroups.com.
Message has been deleted

Mathias Gorski

unread,
Aug 22, 2025, 9:18:43 AM (14 days ago) Aug 22
to plink2-users
Hi, 

this is extremely helpful and solved my problem!

Thank you so much! 

Best, Mathias
Reply all
Reply to author
Forward
0 new messages