plink2 convert vcf to pgen: the DS (whenever DS=0) info is lost.

12 views
Skip to first unread message

travi

unread,
Nov 21, 2025, 1:46:29 PM (13 days ago) Nov 21
to plink2-users
I use plink2 convert vcf to pgen. I then converted *.pgen back to vcf.gz using the following command. 
In the new vcf.gz, the DS is missing whenever DS=0. 
It means the new vcf.gz does not have a regular vcf format and it will have issue in the downstream analysis. 

plink2 --vcf chr22_8snps_hg38_ori2.vcf.gz  dosage=DS --hard-call-threshold 0.1 --out try_chr22_8snps_hg38_ori2
plink2  --pfile  try_chr22_8snps_hg38_ori2   --set-missing-var-ids @:#:\$r:\$a   --export vcf vcf-dosage=DS bgz   --out chr22_8snps_hg38_ori2_back_from_plink2

#####chr22_8snps_hg38_ori2
#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  NE10003438      NE10005390      NE10007958
chr22   16770736        rs5992542       C       G       .       .       IMPUTED;AF=0.850184;R2=0.617169;AC=10;AN=10     GT:DS   1|1:1.931       1|1:1.957       1|1:1.912
chr22   16771098        .       G       C       .       .       IMPUTED;AF=0.3092;R2=0.518924;AC=4;AN=10        GT:DS   1|1:1.592       0|1:1.005       0|0:0.089
chr22   16771361        rs6518616       G       A       .       .       IMPUTED;AF=0.397659;R2=0.667273;AC=6;AN=10      GT:DS   0|0:0   1|0:0.941       1|1:1.765
chr22   16772010        rs12484687      C       T       .       .       IMPUTED;AF=0.272416;R2=0.517005;AC=4;AN=10      GT:DS   1|1:1.494       0|1:1.002       0|0:0.072
chr22   16772632        rs58005956      TTG     T       .       .       IMPUTED;AF=0.396064;R2=0.663177;AC=6;AN=10      GT:DS   0|0:0   1|0:0.941       1|1:1.756

plink2 --vcf chr22_8snps_hg38_ori2.vcf.gz  dosage=DS --hard-call-threshold 0.1 --out try_chr22_8snps_hg38_ori2
plink2  --pfile  try_chr22_8snps_hg38_ori2   --set-missing-var-ids @:#:\$r:\$a   --export vcf vcf-dosage=DS bgz   --out chr22_8snps_hg38_ori2_back_from_plink2

#####chr22_8snps_hg38_ori2_back_from_plink2
#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  NE10003438      NE10005390      NE10007958
22      16770736        rs5992542       C       G       .       .       IMPUTED;AF=0.850184;R2=0.617169;AC=10;AN=10     GT:DS   1|1:1.931       1|1:1.957       1|1:1.912
22      16771098        22:16771098:G:C G       C       .       .       IMPUTED;AF=0.3092;R2=0.518924;AC=4;AN=10        GT:DS   .|.:1.592       0|1:1.005       0|0:0.089
22      16771361        rs6518616       G       A       .       .       IMPUTED;AF=0.397659;R2=0.667273;AC=6;AN=10      GT:DS   0|0     1|0:0.941       .|.:1.765
22      16772010        rs12484687      C       T       .       .       IMPUTED;AF=0.272416;R2=0.517005;AC=4;AN=10      GT:DS   .|.:1.494       0|1:1.002       0|0:0.072
22      16772632        rs58005956      TTG     T       .       .       IMPUTED;AF=0.396064;R2=0.663177;AC=6;AN=10      GT:DS   0|0     1|0:0.941       .|.:1.756

Chris Chang

unread,
Nov 21, 2025, 1:48:39 PM (13 days ago) Nov 21
to travi, plink2-users
That is what vcf-dosage=DS-force is for.

--
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/a9f2fa61-f3ea-4062-9f9d-2775e66ee99cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages