chrchang / plink-ng

A comprehensive update to the PLINK association analysis toolset. Beta testing of the first new version (1.90), focused on speed and memory efficiency improvements, is finishing up. Development is now focused on building out support for multiallelic, phased, and dosage data in PLINK 2.0.
https://www.cog-genomics.org/plink/2.0/
412 stars 125 forks source link

pgenlibr: get chromosome and position for idx #170

Open niekverw opened 3 years ago

niekverw commented 3 years ago

I was wondering if it's possible to obtain the chromosome and position by idx using pgenlibr, or if it is possible to add this feature?

Thanks so much. The pgenlibr is really useful for an R user like me.

chrchang commented 3 years ago

This isn't currently built-in, but if you use plink2 --set-all-var-ids on your dataset first, it's straightforward to extract chrom/pos from the ID strings.

niekverw commented 3 years ago

Thanks for your answer! I understand, but I actually need the ID's to be as they are, since they can be genes or other variants that are not captured by the position/variants alone.

chrchang commented 3 years ago

You can use --recover-var-ids to recover the original IDs whenever they're needed.