plink-ng icon indicating copy to clipboard operation
plink-ng copied to clipboard

pgenlibr: get chromosome and position for idx

Open niekverw opened this issue 4 years ago • 3 comments

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.

niekverw avatar Feb 18 '21 10:02 niekverw

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.

chrchang avatar Feb 18 '21 16:02 chrchang

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.

niekverw avatar Feb 22 '21 20:02 niekverw

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

chrchang avatar Feb 22 '21 20:02 chrchang