extract based on position

643 views
Skip to first unread message

Robert Corty

unread,
Feb 10, 2022, 7:27:31 PM2/10/22
to plink2-users
Hi all,

I would like to extract some SNPs from my psam,pvar,pgen files. I have the chromosome and position of all the SNPs, but not the rsID.

I have tried using this approach:

Options in effect:
  --extract range MYSNPFILE
  --make-bed
  --out MYOUTFILE
  --pfile MYPSAM,PVAR,PGENFILES

and was met with this error:
Error: Invalid chromosome code on line 1 of --extract bed1 file.

Here's the entirety of my snp file that I am currently using... (I have other files with more rows)

CHR     BP1     BP2
12      112090022       112090022


Another approach I tried was using  "12:112090022" as the ID, but that left me with no matching SNPs. (I have verified manually that this SNP is in the pvar file).

Any help would be much appreciated!

Robert

Christopher Chang

unread,
Feb 10, 2022, 8:14:23 PM2/10/22
to plink2-users
plink does not currently expect a header line in this file.  I'll probably modify plink2 soon to tolerate one header line starting with "chrom", any capitalization.

Christopher Chang

unread,
Feb 11, 2022, 4:46:44 PM2/11/22
to plink2-users
Actually, it looks like I made this modification two years ago; if you are using a build from January 2020 or earlier, can you update and retry?
Reply all
Reply to author
Forward
0 new messages