Apply effect score based on allele match rather than variant match

18 views
Skip to first unread message

Ricky Magner

unread,
Aug 7, 2025, 5:55:44 PMAug 7
to plink2-users
Hi all,

I've been trying to use plink2 to set up a quick PRS demo, and I'm having some trouble ensuring scores are applied according to the right order of the alleles. In particular, I have my PGS files with scores that have IDs of the form `chrom:pos:effect:other`. But when I use the `--set-all-var-ids` flag with `plink2 --score` this will generate IDs of the form `chrom:pos:alt:ref`. I can't guarantee however that the effect allele in my PGS file will always be ref or alt, so I'd like the tool to intelligently figure out for each chrom/pos which alleles are present in my samples, and apply the appropriate score. Which combination of flags would I use to achieve this effect?

Thanks,
Ricky

Chris Chang

unread,
Aug 7, 2025, 6:07:06 PMAug 7
to Ricky Magner, plink2-users
If you only have SNPs, one option is to use something like "--set-all-var-ids @:#:\$1:\$2" to put the alleles in *alphabetical* order in your plink2-fileset IDs, and reformat the score file in the same way.  (However, if you have indels, it is not safe to ignore allele order in this manner; in that case there is no alternative to sorting out REF vs. ALT in the PGS file.)

--
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/2e383cf5-cb88-44cc-a227-413fb01fdbdfn%40googlegroups.com.

Ricky Magner

unread,
Aug 8, 2025, 11:14:42 AMAug 8
to plink2-users
Good idea on sorting in alphabetical order for consistency on SNPs, but point taken on INDELs. Thanks for the suggestion!
Reply all
Reply to author
Forward
0 new messages