update-chr issues with PLINK 1.9
1
1
Entering edit mode
4.9 years ago
curious ▴ 820

Hello,

I am trying to update rsids then chromosome # in a PLINK file

.bim file starts out looking like this:

23  23:2700157:G:A  0   2700157 A   G
23  23:2700163:G:A  0   2700163 A   G
23  23:2703633:A:G  0   2703633 G   A

I make a update_rsid.txt file:

23:2700157:G:A X:2700157:G:A
23:2700163:G:A X:2700163:G:A
23:2703633:A:G X:2703633:A:G

run:

plink \
--bfile my_file \
--keep-allele-order \
--update-name update_rsid.txt \
--make-bed \
--out my_file_rsid_updated

updated bim file looks good now:

23  X:2700157:G:A   0   2700157 A   G
23  X:2700163:G:A   0   2700163 A   G
23  X:2703633:A:G   0   2703633 G   A

I make update_chr.txt:

X:2700157:G:A X
X:2700163:G:A X
X:2703633:A:G X

then try to update chrs:

plink \
--bfile my_file_rsid_updated \
--keep-allele-order \
--update-chr update_chr.txt \
--make-bed \
--out my_file_chr_updated

plink spits out this:

--update-chr: 10728 values updated.

but if I open the bim file it looks like nothing happened:

23  X:2700157:G:A   0   2700157 A   G
23  X:2700163:G:A   0   2700163 A   G
23  X:2703633:A:G   0   2703633 G   A

Am I implementing something wrong?

plink • 4.6k views
ADD COMMENT
1
Entering edit mode
4.9 years ago

plink 1.9 treats the chromosome codes “23” and “X” as interchangeable, but for backward compatibility it defaults to outputting the numeric form. Use —output-chr (https://www.cog-genomics.org/plink/1.9/data#irreg_output ) to change this for a specific run.

Note that plink 2.0 outputs X instead of 23 by default; if you don’t want to use —output-chr all the time, an alternative is to use 2.0 when possible.

ADD COMMENT
0
Entering edit mode

when I use --output-chr X, I get error. When I use --output-chr M it seems to accurately recode my chr 23 variants as X

X   X:2700157:G:A   0   2700157 A   G
X   X:2700163:G:A   0   2700163 A   G
X   X:2703633:A:G   0   2703633 G   A

Does this seem right, but I am a little baffled by it so am afraid to trust without understanding. Thank you so much

ADD REPLY
0
Entering edit mode

As explained in the documentation, —output-chr’s argument is the mitochondrial code, since that changes the most between datasets.

ADD REPLY
0
Entering edit mode

Thank you again, I didn't quite get that part of the documentation but I do now with the clarification.

ADD REPLY

Login before adding your answer.

Traffic: 1966 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6